Пример #1
0
void BatchFilter::replyOutputFormat( NameValueCollection& transportHeaders, int format )
{
	XALAN_USING_XALAN( FormatterListener );
	string formatAsString = "";
	
	switch( format )
	{
		case FormatterListener::OUTPUT_METHOD_TEXT :
			formatAsString = BatchFilter::OUTPUT_METHOD_TEXT;
			break;
			
		case FormatterListener::OUTPUT_METHOD_XML :
		case FormatterListener::OUTPUT_METHOD_DOM :
			formatAsString = BatchFilter::OUTPUT_METHOD_XML;
			break;
			
		default :
			formatAsString = BatchFilter::OUTPUT_METHOD_NONE;
			break;
	}
	
	if ( transportHeaders.ContainsKey( BatchOUTPUTFORMAT ) )
		transportHeaders[ BatchOUTPUTFORMAT ] = formatAsString;
	else
		transportHeaders.Add( BatchOUTPUTFORMAT, formatAsString );
}
void EventsWatcherDbOp::SetConfigCfgSection( const NameValueCollection& cfgSection )
{
	if ( cfgSection.ContainsKey( "provider" ) )
	{
		string provider = cfgSection[ "provider" ];

		// create a provider if necessary
		if ( m_DatabaseProvider == NULL )
			m_DatabaseProvider = DatabaseProvider::GetFactory( provider );
	}

	m_ConfigConnectionString.setDatabaseName( cfgSection[ "database" ] );
	m_ConfigConnectionString.setUserName( cfgSection[ "user" ] );
	m_ConfigConnectionString.setUserPassword( cfgSection[ "password" ] );
}