DCL 4.0
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 virtual void onCleanup()
31 virtual void onService(HttpServletContextEx& ctx)
33
34private:
35 SQLConnectionPool* m_pSQLConnPool;
36
37 String __strTemplateDir;
38
39 TextTemplate* m_pHead;
40 TextTemplate* m_pFoot;
41 TextTemplate* m_pViewOrder;
42 TextTemplate* m_pViewProduct;
43 TextTemplate* m_pViewShoppingBasket;
44
45 void printError(
47 const String str
48 );
49
50 bool onViewProduct(
52 const EShopSession& session
53 );
54
55 void onViewShoppingBasket(
57 const EShopSession& session
58 );
59
60 void onViewOrder(
62 const EShopSession& session
63 );
64
65 void onViewSalesReport(
67 const EShopSession& session
68 );
69
70 void printPageHeader(
71 Writer& out,
72 const EShopSession& session
73 );
74
75 void printFile(
76 Writer& out,
77 const wchar_t* pszFileName
78 );
79
80 void printLoginForm(
81 Writer& out
82 );
83
84public:
85 String readTemplate(const wchar_t* filename) const
87};
88
89
90#define COMMAND_STR L"cm"
106
107#define CATEGORY_STR L"cid"
108#define PRODUCT_STR L"pid"
109
110/*
111QUERY_STRING example
112"?cm=1&cid=1" ==> CM_PRODUCT_LIST, CATEGORY_ID=1
113"?cm=2&&pid=1" ==> CM_PRODUCT_INFO, PRODUCT_ID=1
114*/
115
116__DCL_END_NAMESPACE
117
118#endif // __ESHOP_H__
#define __DCL_THROWS1(e)
Definition Config.h:167
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:210
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 *)