fintp_base
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BatchFilter.h
Go to the documentation of this file.
1 /*
2 * FinTP - Financial Transactions Processing Application
3 * Copyright (C) 2013 Business Information Systems (Allevo) S.R.L.
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>
17 * or contact Allevo at : 031281 Bucuresti, 23C Calea Vitan, Romania,
18 * phone +40212554577, office@allevo.ro <mailto:office@allevo.ro>, www.allevo.ro.
19 */
20 
21 #ifndef XSLTFILTER_H
22 #define XSLTFILTER_H
23 
24 #ifdef WIN32
25  #define __MSXML_LIBRARY_DEFINED__
26 #endif
27 
28 #include "../AbstractFilter.h"
29 #include "../XmlUtil.h"
30 
31 #include <xalanc/XalanTransformer/XalanTransformer.hpp>
32 
33 class ExportedObject BatchFilter : public AbstractFilter
34 {
35 
36  public:
37 
38  static const string BatchFILE; //Batch File Name, from Properties (.config file, Batch filter parameter )
39  static const string BatchPARAM; //Batch Parameters, from TransportHeaders
40  static const string BatchUSEEXT;
41  static const string BatchOUTPUTFORMAT;
42 
43  static const string OUTPUT_METHOD_TEXT;
44  static const string OUTPUT_METHOD_XML;
45  static const string OUTPUT_METHOD_NONE;
46 
47  BatchFilter();
48  ~BatchFilter();
49 
50  // return true if the filter supports logging payload to a file
51  // note for overrides : return true/false if the payload can be read without rewinding ( not a stream )
52  bool canLogPayload();
53  // return true if the filter can execute the requested operation in client/server context
54  bool isMethodSupported( FilterMethod method, bool asClient );
55 
56 
57  FilterResult ProcessMessage( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* inputOutputData, NameValueCollection& transportHeaders, bool asClient );
58  FilterResult ProcessMessage( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* inputData, unsigned char* outputData, NameValueCollection& transportHeaders, bool asClient );
59  FilterResult ProcessMessage( XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument* inputData, unsigned char** outputData, NameValueCollection& transportHeaders, bool asClient );
60 
61  static void Terminate();
62 
63  private:
64 
65  void validateProperties( NameValueCollection& headers );
66  void replyOutputFormat( NameValueCollection& headers, int format );
67 
68  static XALAN_CPP_NAMESPACE_QUALIFIER XalanTransformer* getTransformer();
69 
70  XALAN_CPP_NAMESPACE_QUALIFIER XalanCompiledStylesheet* getBatch( const string filename );
71 
72  static bool m_ExtensionsInstalled;
73  static XercesDOMTreeErrorHandler* m_ErrorReporter;
74  static XALAN_CPP_NAMESPACE_QUALIFIER XalanTransformer* m_Transformer;
75  static map< string, const XALAN_CPP_NAMESPACE_QUALIFIER XalanCompiledStylesheet* > m_BatchCache;
76 };
77 
78 #endif