ffead.server.doc
ExtHandler.h
1 /*
2  Copyright 2009-2012, Sumeet Chhetri
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 /*
17  * ExtHandler.h
18  *
19  * Created on: Jun 17, 2012
20  * Author: Sumeet
21  */
22 
23 #ifndef EXTHANDLER_H_
24 #define EXTHANDLER_H_
25 #include "AfcUtil.h"
26 #include "HttpRequest.h"
27 #include "HttpResponse.h"
28 #include "TemplateHandler.h"
29 #include "DynamicView.h"
30 #include "Reflector.h"
31 #include "Document.h"
32 #include "View.h"
33 #include <dlfcn.h>
34 #include "Constants.h"
35 #include "Logger.h"
36 #include "map"
37 
38 typedef string (*DCPPtr) ();
39 typedef ClassInfo (*FunPtr) ();
40 typedef string (*TemplatePtr) (map<string, void*>);
41 
42 class ExtHandler {
43 public:
44  ExtHandler();
45  virtual ~ExtHandler();
46  static string getContentStr(string url,string locale,string ext);
47  static bool handle(HttpRequest* req, HttpResponse& res, void* dlib, void* ddlib, string resourcePath,
48  map<string, string> tmplMap, map<string, string> vwMap,string ext, map<string, string> props,
49  map<string, string> ajaxIntfMap);
50 };
51 
52 #endif /* EXTHANDLER_H_ */