DCL 3.7.4
Loading...
Searching...
No Matches
EShopServlet.h
Go to the documentation of this file.
1#ifndef __ESHOP_H__
2#define __ESHOP_H__ 20041207
3
4#ifndef __DCL_SQL_H__
5#include <dcl/SQL.h>
6#endif
7#ifndef __DCL_HTTP_SERVLET_EX_H__
8#include <dcl/HttpServletEx.h>
9#endif
10#ifndef __DCL_TEXT_TEMPLATE_H__
11#include <dcl/TextTemplate.h>
12#endif
13
14#include "EShopSession.h"
15
16__DCL_BEGIN_NAMESPACE
17
18class EShopSession;
19
21{
23public:
25
26protected:
27 virtual void onInitialize()
29
30 virtual void onCleanup()
32
33 virtual void onService(HttpServletContextEx& ctx)
35
36private:
37 SQLConnectionPool* __pSQLConnPool;
38
39 String __strTemplateDir;
40
41 TextTemplate* __pHead;
42 TextTemplate* __pFoot;
43 TextTemplate* __pViewOrder;
44 TextTemplate* __pViewProduct;
45 TextTemplate* __pViewShoppingBasket;
46
47 void printError(
49 const String str
50 );
51
52 bool onViewProduct(
54 const EShopSession& session
55 );
56
57 void onViewShoppingBasket(
59 const EShopSession& session
60 );
61
62 void onViewOrder(
64 const EShopSession& session
65 );
66
67 void onViewSalesReport(
69 const EShopSession& session
70 );
71
72 void printPageHeader(
73 Writer& out,
74 const EShopSession& session
75 );
76
77 void printFile(
78 Writer& out,
79 const wchar_t* pszFileName
80 );
81
82 void printLoginForm(
83 Writer& out
84 );
85
86public:
87 String readTemplate(const wchar_t* filename) const
89};
90
91#define COMMAND_STR L"cm"
107
108#define CATEGORY_STR L"cid"
109#define PRODUCT_STR L"pid"
110
111/*
112QUERY_STRING example
113"?cm=1&cid=1" ==> CM_PRODUCT_LIST, CATEGORY_ID=1
114"?cm=2&&pid=1" ==> CM_PRODUCT_INFO, PRODUCT_ID=1
115*/
116
117__DCL_END_NAMESPACE
118
119#endif // __ESHOP_H__
#define __DCL_THROWS1(e)
Definition Config.h:152
COMMAND_ID
@ CM_VIEW_SHOPPING_BASKET
@ CM_VIEW_PRODUCT
@ CM_ABOUT
@ CM_SESSION_MANAGEMENT
@ CM_LOGIN
@ CM_ORDER
@ CM_VIEW_ORDER
@ CM_PRODUCT_MANAGEMENT
@ CM_VIEW_QNA
@ CM_LOGOUT
@ CM_VIEW_LOGIN_FORM
@ CM_SALES_REPORT
#define DECLARE_CLASSINFO(class_name)
Definition Object.h:227
virtual void onInitialize() __DCL_THROWS1(Exception *)
virtual void onCleanup() __DCL_THROWS1(Exception *)
String readTemplate(const wchar_t *filename) const __DCL_THROWS1(IOException *)
virtual void onService(HttpServletContextEx &ctx) __DCL_THROWS1(Exception *)