Пример #1
0
void
removeDisabledProviders( ProviderList &providers, const ProviderRefTimeList &reftimes )
{
   ProviderRefTimeList::const_iterator rit;
   ProviderList::iterator it = providers.begin();

   WEBFW_USE_LOGGER( "handler" );

   while( it != providers.end() ) {
      rit = reftimes.find( it->providerWithPlacename() );

      if( rit != reftimes.end() && rit->second.disabled ) {
         WEBFW_LOG_DEBUG("removeDisabledProviders: removing provider: " << it->providerWithPlacename() );
         it = providers.erase( it );
      } else {
         ++ it;
      }
   }
}
Пример #2
0
MetaModelConfList
configureMetaModelConf( const wdb2ts::config::ActionParam &params )
{
	const string META_MODEL_KEY("meta_model-");
	MetaModelConfList metaModelConf;
	
	WEBFW_USE_LOGGER( "main" );

	string::size_type i;
	
	for( wdb2ts::config::ActionParam::const_iterator it = params.begin(); 
	     it!=params.end(); 
	     ++it ) 
	{
		i=it->first.find( META_MODEL_KEY );
			
		if( i != string::npos && i==0 ) {
			string provider=it->first;
			provider.erase(0, META_MODEL_KEY.size() );
			//miutil::replace( provider, "_", " ");

			ProviderList pvList = ProviderList::decode( provider );
			
			MetaModelConf conf;
			
			if( conf.parseConf( it->second.asString() ) ){
				for( ProviderList::iterator pit = pvList.begin(); pit != pvList.end(); ++pit )
					metaModelConf[pit->providerWithPlacename()] = conf;
			}else {
				WEBFW_LOG_ERROR( "Failed to parse value for: " << it->first << " (" << it->second << ")." );
			}
		}
	}

	std::ostringstream logMsg;
	for( MetaModelConfList::iterator metaIt = metaModelConf.begin();
	     metaIt != metaModelConf.end(); 
	     ++metaIt )
		logMsg << "Meta: " << metaIt->first << ": " << metaIt->second << endl;
	WEBFW_LOG_DEBUG( logMsg.str() );
	
	return metaModelConf;
}