DCL 3.7.4
Loading...
Searching...
No Matches
HtmlView.h
Go to the documentation of this file.
1#ifndef __DCL_HS_HTML_VIEW_H__
2#define __DCL_HS_HTML_VIEW_H__ 20050904
3
4#ifndef __DCL_ARRAY_H__
5#include <dcl/Array.h>
6#endif
7#ifndef __DCL_LISTED_HASH_MAP_H__
8#include <dcl/ListedHashMap.h>
9#endif
10
11#ifndef __DCL_SQL_H__
12#include <dcl/SQL.h>
13#endif
14#ifndef __DCL_TEXT_TEMPLATE_H__
15#include <dcl/TextTemplate.h>
16#endif
17#ifndef __DCL_HS_SESSION_H__
18#include "Session.h"
19#endif
20
21__DCL_BEGIN_NAMESPACE
22
23class HtmlPage;
24
31
32#define DECLARE_CLASSINFO_EX(class_name) \
33DECLARE_CLASSINFO(class_name) \
34public: \
35 static HtmlView* createObject(HtmlPage* pPage);
36
37#define IMPLEMENT_CLASSINFO_EX(class_name, base_class_name) \
38IMPLEMENT_CLASSINFO(class_name, base_class_name) \
39HtmlView* class_name::createObject(HtmlPage* pPage) \
40{ \
41 return new class_name(pPage); \
42}
43
44class HtmlView : public TextTemplate
45{
47public:
48 enum
49 {
50 HTML_ONLY = 0,
51 ERROR_VIEW = 1,
52 PERM_DENIED_VIEW = 2,
53
54 DIALOG_WRAPPER = 10,
55 HEAD_VIEW = 11,
56 SIGN_FORM = 12,
57 MENU_VIEW = 13,
58 HEAD_SIGN_MENU_FORM = 14,
59
60 CLASS_LIST_VIEW = 21,
61
62 DATA_SOURCE_LIST_VIEW = 26,
63 DATA_SOURCE_WRITE_FORM = 27,
64 DATA_SOURCE_DETAIL_VIEW = 28,
65
66 PAGE_CATEGORY_FORM = 30,
67 PAGE_LIST_VIEW = 31,
68 PAGE_WRITE_FORM = 32,
69 PAGE_DETAIL_VIEW = 33,
70
71 ZIPCODE_LIST_VIEW = 41,
72 SIGN_CHECK_FORM = 46,
73
74 USER_LIST_VIEW = 51,
75 USER_WRITE_FORM = 52,
76 USER_DETAIL_VIEW = 53,
77 USER_SEARCH_FORM = 54,
78 USER_ACTIVITY_VIEW = 55,
79
80// GROUP_LIST_VIEW = 61,
81// GROUP_WRITE_FORM = 62,
82// GROUP_DETAIL_VIEW = 63,
83// GROUP_SEARCH_FORM = 64,
84// GROUP_ACTIVITY_VIEW = 65,
85
86 MESSAGE_LIST_VIEW = 76,
87 MESSAGE_WRITE_FORM = 77,
88 MESSAGE_DETAIL_VIEW = 78,
89
90 } CLASS_ID;
91
92 struct CLASS_INFO {
93 int nDsType;
94 int nClassID;
95 const wchar_t* pszClassName;
96 HtmlView* (*pfnCreateObject)(HtmlPage* pPage);
97 const wchar_t* pszDesc;
98 const wchar_t* className() const;
99 };
100
101 static const CLASS_INFO __aClasses[];
102 static const int __nClassCount;
103
104 static const CLASS_INFO* getClassInfo(int nClassID);
105 static const wchar_t* className(int nClassID);
106
107protected:
111
112 StringToStringMap __mapParams;
113#ifdef __DCL_DEBUG
114 String __strParams;
115#endif
116
117public:
118 const HtmlPage* page() const { return __pPage; }
119 String SELF() const;
120 String VNO() const;
121
122protected:
123 static size_t split(const String& str, StringStringArray& v);
124 static void dump(Session& session);
125 static String getDefault(ListedStringToStringArrayMap& map,
126 const String& strKey);
127
128 static size_t getShortString(SQLField& field, size_t _len,
129 String& strLong, String& strShort);
130
131protected:
133
134public:
135 static HtmlView* createObject(HtmlPage* pPage, int nClassID, int nIndex);
136
137 virtual void init(SQLFields& fields)
139
140 // 뷰의 Text 컨텐츠를 출력한다.
141 virtual void onPrint(Session& session)
143
144 // 페이지의 부분이 아닌 HTTP GET을 처리한다.
145 // Content-Type, Content-Length등을 처리해 주어야 한다.
146 virtual void onGet(Session& session)
148
149 // Content-Type, Content-Length등을 처리해 주어야 한다.
150 virtual void onPost(Session& session)
152
153};
154
155class FormView : public HtmlView
156{
158public:
159 FormView(HtmlPage* pPage);
160
161 virtual void onPrint(Session& session)
163
164 virtual void onPost(Session& session)
166};
167
168class ErrorView : public HtmlView
169{
171public:
172 ErrorView(HtmlPage* pPage);
173};
174
176{
178public:
179 PermDeniedView(HtmlPage* pPage);
180
181 virtual void onPrint(Session& session)
183};
184
185class HeadView : public HtmlView
186{
188public:
189 HeadView(HtmlPage* pPage);
190
191 virtual void onPrint(Session& session)
193
194 static void __onPrint(HtmlView* pView)
196};
197
198class SignForm : public FormView
199{
201public:
202 SignForm(HtmlPage* pPage);
203
204 virtual void onPrint(Session& session)
206
207 virtual void onGet(Session& session)
209
210 virtual void onPost(Session& session)
212
213 static void __onPrint(HtmlView* pView, Session& session)
215
216 static void __onGet(HtmlView* pView, Session& session)
218
219 static void __onPost(HtmlView* pView, Session& session)
221};
222
223class MenuView : public HtmlView
224{
226public:
227 MenuView(HtmlPage* pPage);
228
229 virtual void init(SQLFields& fields)
231
232 virtual void onPrint(Session& session)
234
235 static void __onPrint(
236 const String& strMenuFile,
237 HtmlView* pView,
238 Session& session
240
241protected:
243};
244
246{
248public:
250
251 virtual void init(SQLFields& fields) __DCL_THROWS1(Exception*);
252
253 virtual void onPrint(Session& session) __DCL_THROWS1(Exception*);
254
255 virtual void onGet(Session& session) __DCL_THROWS1(Exception*);
256
257 virtual void onPost(Session& session) __DCL_THROWS1(Exception*);
258
259protected:
261};
262
264{
266protected:
267 String __strWidth;
268 String __strHeight;
269 String __strInnerPageID;
270
271public:
273
274 virtual void init(SQLFields& fields)
276
277 virtual void onPrint(Session& session) __DCL_THROWS1(Exception*);
278};
279
281{
283protected:
285
286 virtual void init(SQLFields& fields)
288
289 virtual void onPrint(Session& session)
291
292protected:
295};
296
297__DCL_END_NAMESPACE
298
299#endif // __DCL_HS_HTML_VIEW_H__
#define __DCL_THROWS1(e)
Definition Config.h:152
#define DECLARE_CLASSINFO_EX(class_name)
Definition HtmlView.h:32
DATA_SOURCE_TYPE
Definition HtmlView.h:26
@ DS_BOARD
Definition HtmlView.h:28
@ DS_MENU
Definition HtmlView.h:29
@ DS_NONE
Definition HtmlView.h:27
DialogWrapper(HtmlPage *pPage)
virtual void init(SQLFields &fields) __DCL_THROWS1(Exception *)
Definition HtmlView.cpp:612
virtual void onPrint(Session &session) __DCL_THROWS1(Exception *)
Definition HtmlView.cpp:628
String __strMenuFile
Definition HtmlView.h:260
String VNO() const
Definition HtmlView.cpp:293
virtual void onPost(Session &session) __DCL_THROWS1(Exception *)
Definition HtmlView.cpp:381
HtmlView(HtmlPage *pPage)
virtual void onGet(Session &session) __DCL_THROWS1(Exception *)
Definition HtmlView.cpp:373
int __nClassID
Definition HtmlView.h:110
int __nIndex
Definition HtmlView.h:109
const HtmlPage * page() const
Definition HtmlView.h:118
StringToStringMap __mapParams
Definition HtmlView.h:112
static void dump(Session &session)
Definition HtmlView.cpp:164
String SELF() const
Definition HtmlView.cpp:287
virtual void onPrint(Session &session) __DCL_THROWS1(Exception *)
Definition HtmlView.cpp:349
static String getDefault(ListedStringToStringArrayMap &map, const String &strKey)
Definition HtmlView.cpp:256
static HtmlView * createObject(HtmlPage *pPage, int nClassID, int nIndex)
Definition HtmlView.cpp:126
static size_t split(const String &str, StringStringArray &v)
Definition HtmlView.cpp:143
virtual void init(SQLFields &fields) __DCL_THROWS1(Exception *)
Definition HtmlView.cpp:298
static size_t getShortString(SQLField &field, size_t _len, String &strLong, String &strShort)
Definition HtmlView.cpp:266
HtmlPage * __pPage
Definition HtmlView.h:108
String __strMenuFile
Definition HtmlView.h:242
String className() const
Definition Object.cpp:163
Definition SQL.h:48