DCL 3.7.4
Loading...
Searching...
No Matches
MessageDetailView.cpp
Go to the documentation of this file.
1#include <dcl/Config.h>
2
3#ifdef __WINNT__
4#include <windows.h>
5#endif
6
7#include <dcl/Files.h>
9#include <dcl/URI.h>
10
11#include <dcl/DateTime.h>
12
13#include "ServletMain.h"
14#include "HtmlPage.h"
15#include "MessageTree.h"
16#include "LinkUtility.h"
17
18#include "MessageView.h"
19
20#if __DCL_HAVE_THIS_FILE__
21#undef __THIS_FILE__
22static const char_t __THIS_FILE__[] = __T("fastpage/MessageDetailView.cpp");
23#endif
24
25__DCL_BEGIN_NAMESPACE
26
27inline String __GetLocalFileName(
28 const String& strAttachDir,
29 const String& strDsID,
30 const String& strMessageID,
31 const String& strAttachNo
32)
33{
34 return strAttachDir
35 + strDsID + L"/"
36 + strMessageID + L"-"
37 + strAttachNo + L".dat";
38}
39
40/*
41 QUERY_STRING
42 ?p=N&m=N,...[&l=N[,G]]
43 ?p=N&v=N&m=N&c={good|bad|del}[&l=N[,G]]
44 ?p=N&v=N&m=N&a=N[&l=N[,G]]
45
46*/
47
49
51 : MessageView(pPage)
52{
53 __nParts = 5;
54 __nRows = 20;
55
56 __nFilter = 0;
57 __nSubject = 0;
58}
59
62{
63 MessageView::init(fields);
64
65 __mapParams.lookup(L"WRITE", __strWritePage);
66 __mapParams.lookup(L"LIST", __strListPage);
67 __mapParams.lookup(L"ATTACH_TITLE", __strAttachTitle);
68
69 String rValue;
70 if (__mapParams.lookup(L"PARTS", rValue) && !rValue.isEmpty()) {
71 __nParts = Integer::parse(rValue, 10, __nParts);
72 if (__nParts < 5 || __nParts > 20)
73 __nParts = 5;
74 }
75
76 if (__mapParams.lookup(L"ROWS", rValue) && !rValue.isEmpty()) {
77 __nRows = Integer::parse(rValue, 10, __nRows);
78 if (__nRows <= 0)
79 __nRows = 20;
80 }
81
82 if (__mapParams.lookup(L"FILTER", rValue) && !rValue.isEmpty()) {
83 StringArray list;
84 rValue.split(L',', list);
85 StringArray::Iterator itList = list.begin();
86 for(; itList != list.end(); itList++) {
87 (*itList).trim();
88 if (!(*itList).isEmpty()) {
89 if (!(*itList).compareNoCase(L"SELF"))
90 __nFilter |= FILTER_SELF;
91 else if (!(*itList).compareNoCase(L"CHILDREN"))
92 __nFilter |= FILTER_CHILDREN;
93 else {
94 // invalid value
95 __DCL_TRACE1(L"Warning! Invalid Params: FILTER=%ls\n", rValue.data());
96 }
97 }
98 }
99 }
100
101 if (__mapParams.lookup(L"MSG", rValue) && !rValue.isEmpty()) {
102 __strMsg = rValue.trim(L" ,");
103 }
104
105 if (__mapParams.lookup(L"SORT", rValue) && !rValue.isEmpty()) {
106 if (!rValue.compareNoCase(L"ASC") || !rValue.compareNoCase(L"DESC"))
107 __strSort = rValue;
108 else {
109 __DCL_TRACE1(L"Warning! Invalid Params: SORT=%ls\n", rValue.data());
110 }
111 }
112 else {
113 if (__nSequence)
114 __strSort = L"DESC";
115 else
116 __strSort = L"ASC";
117 }
118
119 if (__mapParams.lookup(L"SUBJECT", rValue) && !rValue.isEmpty()) {
120 StringArray list;
121 rValue.split(L',', list);
122 StringArray::Iterator itList = list.begin();
123 for(; itList != list.end(); itList++) {
124 (*itList).trim();
125 if (!(*itList).isEmpty()) {
126 if (!(*itList).compareNoCase(L"PARENT"))
127 __nSubject |= SUBJECT_PARENT;
128 else if (!(*itList).compareNoCase(L"PREV"))
129 __nSubject |= SUBJECT_PREV;
130 else if (!(*itList).compareNoCase(L"NEXT"))
131 __nSubject |= SUBJECT_NEXT;
132 else {
133 // invalid value
134 __DCL_TRACE1(L"Warning! Invalid Params: SUBJECT=%ls\n", rValue.data());
135 }
136 }
137 }
138 }
139}
140
143{
144#ifdef __DCL_DEBUG
145// showNullMacro(true, true);
146#endif
147 ListedStringToStringArrayMap& mapQuery = session.__ctx.__queryMap;
148 SQLQuery& q = session.__query;
149
150 String strTableID = String::valueOf(__nTableID);
151 String strDsID = String::valueOf(__nDsID);
152 String strUserID = String::valueOf(session.__nUserID);
153
154 int nCurrentPart = Integer::parse(getDefault(mapQuery, L"part"), 10, 1);
155 int nRows = __nRows;
156
157 /*
158 strListPage n[&msg][&...], L"list=" of QUERY_STRING
159 strListPageEnc URLEncode(strListPage)
160 strThisPage n[&msg=n][&rows=n][&...] part 제외
161 strThisEx strThisPage + [&part=n][&list=strListPageEnc]
162 strThisEnc URLEncode(strThisPage)
163 */
164 String strListPage = getDefault(mapQuery, L"list");
165 String strListPageEnc;
166 String strWritePage = __strWritePage;
167 String strDetailPage = __pPage->__strPageID;
168 StringBuilder strThisPage = __pPage->__strPageID;
169 String strMsg;
170 bool bAddParentToList = false;
171
172 if (strListPage.isEmpty()) {
173 bAddParentToList = __strListPage.contains(L"&msg");
174 strListPage = __strListPage;
175 }
176
177 strListPageEnc = URLEncoder::encode(strListPage);
178
179 if (!__strMsg.isEmpty())
180 strMsg = __strMsg;
181 else
182 strMsg = String::join(mapQuery[L"msg"], L',', false);
183
184 TextTemplate* pNOTICE = &(*this)[L"NOTICE"];
185 TextTemplate* pSTART = &(*this)[L"START"];
186 TextTemplate* pREPLY = &(*this)[L"REPLY"];
187 TextTemplate& EMPTY = (*this)[L"EMPTY"];
188
189 assign(L"IS_GUEST", session.isSysGuest() ? L"true" : L"false");
190 assign(L"WRITE", strWritePage);
191 assign(L"LIST", strListPage);
192 EMPTY.assign(L"LIST", strListPage);
193
194 if (strMsg.isEmpty()) {
195 assign(L"EMPTY", EMPTY);
196 return;
197 }
198 strThisPage += L"&msg=" + strMsg;
199
200 String strWhereEx;
201 switch(__nFilter) {
202 default :
203 case FILTER_SELF :
204 strWhereEx = L" AND M.MESSAGE_ID IN (" + strMsg + L")";
205 break;
206 case FILTER_CHILDREN :
207 strWhereEx = L" AND M.PARENT_ID IN (" + strMsg + L")";
208 break;
209 case FILTER_SELF | FILTER_CHILDREN :
210 strWhereEx = L" AND (M.MESSAGE_ID IN (" + strMsg + L") OR M.PARENT_ID IN (L" + strMsg + L"))";
211 break;
212 }
213
214 __DCL_ASSERT(nRows > 0);
215
216 TextTemplate* pPART_LINK = atP(L"PART_LINK");
217 int nUsingRecord = nRows;
218 int nTotalRecord = nUsingRecord;
219 int nTotalPart = 1;
220 if (nCurrentPart != 1 || pPART_LINK) {
221 q.execute(L""
222 "SELECT COUNT(*) "
223 "\n FROM DCL_MESSAGE_" + strTableID + L" AS M"
224 "\n WHERE M.DS_ID = " + strDsID + strWhereEx
225 );
226 q.fetch();
227 nTotalRecord = q.fields()[0].asInteger();
228
229 if (nTotalRecord == 0) {
230 assign(L"EMPTY", EMPTY);
231
232 MessageView::onPrint(session);
233 return;
234 }
235
236 nTotalPart = nTotalRecord / nUsingRecord;
237 if (nTotalRecord % nUsingRecord)
238 nTotalPart++;
239 }
240
241 if (nCurrentPart <= 0 || nCurrentPart > nTotalPart)
242 nCurrentPart = nTotalPart;
243
244 StringBuilder strThisEx = strThisPage;
245 if (nCurrentPart > 1)
246 strThisEx += L"&part=" + String::valueOf(nCurrentPart);
247
248 if (!strListPageEnc.isEmpty())
249 strThisEx += L"&list=" + strListPageEnc;
250
251 String strThisEnc = URLEncoder::encode(strThisPage);
252
253 assign(L"_LIST", strListPageEnc);
254 assign(L"_THIS", strThisEnc);
255
256 StringBuilder strFieldEx;
257 StringBuilder strJoinEx;
258
259 if (__nSubject & SUBJECT_PARENT) {
260 strJoinEx += L"\n LEFT OUTER JOIN DCL_MESSAGE_" + strTableID + L""
261 " AS P\n ON (M.DS_ID = P.DS_ID AND M.PARENT_ID = P.MESSAGE_ID)";
262
263 strFieldEx += L", P.SUBJECT AS P_SUBJECT";
264 }
265 if (__nSubject & SUBJECT_PREV) {
266
267 }
268 if (__nSubject & SUBJECT_NEXT) {
269
270 }
271
272 int nOffset = (nCurrentPart - 1) * nUsingRecord;
273
274 String strSQL = L""
275 "SELECT M.MESSAGE_ID, M.PREV_ID, M.NEXT_ID, M.PARENT_ID, M.REPLY_ID,"
276 "\n M.NCHILD, M.TYPE AS BODY_TYPE,"
277 "\n M.USER_ID, M.SUBJECT, M.BODY_HTML, M.UPDATE_TIME,"
278 "\n M.NREAD, M.NAGREE, M.NDISAGREE, (M.NAGREE + M.NDISAGREE) AS NVOTE,"
279 "\n (M.NAGREE - M.NDISAGREE) AS NDECISION, M.VOTE_END,"
280 "\n U.USER_NAME AS WRITER, R.USER_ID AS R_USER_ID"
281 + strFieldEx.toString() + L""
282 "\n FROM DCL_MESSAGE_" + strTableID + L" AS M"
283 "\n INNER JOIN DCLWC_USER U ON (M.USER_ID = U.USER_ID)"
284 "\n LEFT OUTER JOIN DCL_MESSAGE_R_" + strTableID + L" AS R"
285 "\n ON (M.DS_ID = R.DS_ID AND M.MESSAGE_ID = R.MESSAGE_ID"
286 " AND R.USER_ID = " + strUserID + L")"
287 + strJoinEx.toString() + L""
288 "\n WHERE M.DS_ID = " + strDsID + strWhereEx + L""
289 "\n ORDER BY M.START_ID " + __strSort + L", M.REPLY_ID ASC"
290 "\n LIMIT " + String::valueOf(nUsingRecord) + L""
291 "\n OFFSET " + String::valueOf(nOffset);
292
293 __DCL_TRACE1(L"\n%ls\n", strSQL.data());
294
295 q.execute(strSQL);
296 q.fetch();
297 if (q.eof()) {
298 assign(L"EMPTY", EMPTY);
299 }
300 else {
301 UpdateLink ul(atP(L"UPDATE_LINK"), strDetailPage, strWritePage, strThisEnc, strListPageEnc);
302 SiblingLink sl(atP(L"SIBLING_LINK"), strDetailPage, strListPageEnc);
303
305 SQLQuery qAttach(q.connection());
306 SQLQuery qInsert(q.connection());
307 SQLQuery qUpdate(q.connection());
308 qAttach.prepare(L""
309 "SELECT NO, NDOWNLOAD, FILENAME, TYPE, ICON, CEILING(SIZE / 1024) AS KSIZE"
310 "\n FROM DCL_MESSAGE_A_" + strTableID + L""
311 "\n WHERE DS_ID = " + strDsID + L""
312 "\n AND MESSAGE_ID = :MESSAGE_ID"
313 "\n ORDER BY NO ASC"
314 );
315 qInsert.prepare(L""
316 "INSERT INTO DCL_MESSAGE_R_" + strTableID + L""
317 "\n (DS_ID, MESSAGE_ID, USER_ID, NVOTE, UPDATE_TIME)"
318 "\n VALUES (L" + strDsID + L", :MESSAGE_ID, L" + strUserID
319 + L", 0, CURRENT_TIMESTAMP)"
320 );
321 qUpdate.prepare(L""
322 "UPDATE DCL_MESSAGE_" + strTableID + L""
323 "\n SET NREAD = NREAD + 1"
324 "\n WHERE DS_ID = " + strDsID + L""
325 "\n AND MESSAGE_ID = :MESSAGE_ID"
326 );
327
328 SQLFields& fields = q.fields();
329 TextTemplate* pDest = NULL;
330 while(!q.eof()) {
331 int nMessageID = fields.byName(L"MESSAGE_ID").asInteger();
332 int64_t nReplyID = fields.byName(L"REPLY_ID").asInt64();
333 int nUserID = fields.byName(L"USER_ID").asInteger();
334 String strMessageID = String::valueOf(nMessageID);
335
337 mt.getPosition(nReplyID, rPos);
338
339 if (pDest)
340 pDest->reset();
341
342 if (rPos.nDepthIndex == 0) {
343 if (IS_NOTICE_ID(nMessageID))
344 pDest = pNOTICE;
345 else
346 pDest = pSTART;
347 }
348 else
349 pDest = pREPLY;
350
351 pDest->assign(L"VNO", VNO());
352 if (bAddParentToList) {
353 StringBuilder str = strListPage + L"=";
354 str += fields.byName(L"PARENT_ID").asString();
355 strListPageEnc = URLEncoder::encode(str);
356
357 pDest->assign(L"LIST", str);
358 sl.assign(pDest, fields, strListPageEnc);
359 }
360 else {
361 pDest->assign(L"LIST", strListPage);
362 sl.assign(pDest, fields);
363 }
364 ul.assign(pDest, fields, session, strMessageID, strListPage, mt, rPos);
365
366 // U.WRITER, SUBJECT, BODY_HTML, UPDATE_TIME, NREAD, NVOTE
367 pDest->assign(fields, L"&nbsp");
368 pDest->assign(L"UPDATE_DATE", fields.byName(L"UPDATE_TIME").asDate().toString());
369
370 if (__nSubject & SUBJECT_PARENT) {
371 String str;
372 SQLField& field = fields.byName(L"P_SUBJECT");
373 if (!field.isNull())
374 str = field.asString();
375 if (str.isEmpty())
376 str = L"제목없음";
377 append(L"P_SUBJECT", str);
378 }
379
380 int nBodyType = fields.byName(L"BODY_TYPE").asInteger();
381 if (nBodyType < 0) {
382 StringBuilder strBodyHtml = L"<span style=\"color:red\">(L";
383 if (nBodyType == -1)
384 strBodyHtml += L"글쓴이가 글을 삭제했습니다";
385 else
386 strBodyHtml += L"관리자에 의해 삭제되었습니다.";
387 strBodyHtml += L")</span>";
388
389 pDest->assign(L"SUBJECT", L"삭제됨");
390 pDest->assign(L"BODY_HTML", strBodyHtml);
391 }
392 else {
393 if (fields.byName(L"SUBJECT").asString().isEmpty())
394 pDest->assign(L"SUBJECT", L"제목없음");
395 }
396
397 TextTemplate* pATTACH = pDest->atP(L"ATTACH");
398 TextTemplate* pIMAGE = pDest->atP(L"IMAGE");
399 if (pATTACH || pIMAGE) {
400 pDest->assign(L"ATTACH_TITLE", __strAttachTitle);
401
402 qAttach.params()[0].setValue(nMessageID);
403 qAttach.execute();
404 qAttach.fetch();
405 bool bFirst = true;
406 while (!qAttach.eof()) {
407 String strType = qAttach.fields().byName(L"TYPE").asString();
408 if (pATTACH) {
409 pATTACH->assign(L"SELF", SELF());
410 pATTACH->assign(L"MESSAGE_ID", strMessageID);
411 pATTACH->assign(qAttach.fields(), String());
412 if (bFirst)
413 pDest->assign(L"ATTACH", *pATTACH);
414 else
415 pDest->append(L"ATTACH", *pATTACH);
416 }
417 if (pIMAGE && strType.compareNoCase(L"image", 5) == 0) {
418 pIMAGE->assign(L"SELF", SELF());
419 pIMAGE->assign(L"MESSAGE_ID", strMessageID);
420 pIMAGE->assign(qAttach.fields(), String());
421 if (bFirst)
422 pDest->assign(L"IMAGE", *pIMAGE);
423 else
424 pDest->append(L"IMAGE", *pIMAGE);
425 }
426 bFirst = false;
427 qAttach.fetch();
428 }
429 }
430
431 if (!session.isSysGuest() && session.__nUserID != nUserID
432 && fields.byName(L"R_USER_ID").isNull()
433 ) {
434 qInsert.params()[0].setValue(nMessageID);
435 qInsert.execute();
436 qUpdate.params()[0].setValue(nMessageID);
437 qUpdate.execute();
438
439 pDest->assign(
440 L"NREAD",
441 String::valueOf(fields.byName(L"NREAD").asInteger() + 1)
442 );
443 }
444 append(L"EMPTY", *pDest);
445 q.fetch();
446 } // while(!q.eof())
447 }
448
449 if (pPART_LINK && nTotalPart > 1) {
450 PartLink pl(pPART_LINK, strThisPage, strListPageEnc);
451 pl.assign(this, nTotalPart, nCurrentPart, __nParts);
452 }
453
454 MessageView::onPrint(session);
455}
456
459{
460 HttpServletContextEx& ctx = session.__ctx;
461 SQLQuery& q = session.__query;
462
463 ListedStringToStringArrayMap& mapQuery = ctx.__queryMap;
464 ListedStringToStringArrayMap::ConstIterator itM = mapQuery.find(L"msg");
465 if (itM == mapQuery.end() || (*itM).value.isEmpty()) {
466 session.__ctx.setStatusCode(HTTP_STATUS_NOT_FOUND);
467 return;
468 }
469
470 String strMessageID = (*itM).value[0];
471 String strTableID = String::valueOf(__nTableID);
472 String strDsID = String::valueOf(__nDsID);
473
474 ListedStringToStringArrayMap::ConstIterator itA = mapQuery.find(L"attach");
475 if (itA != mapQuery.end() && (*itA).value.size() > 0) {
476 // attachment
477 q.execute(L""
478 "SELECT FILENAME, TYPE"
479 "\n FROM DCL_MESSAGE_A_" + strTableID + L""
480 "\n WHERE DS_ID = " + strDsID + L""
481 "\n AND MESSAGE_ID = " + strMessageID + L""
482 "\n AND NO = " + (*itA).value[0]
483 );
484 q.fetch();
485 if (!q.eof()) {
486 String strFileName = __pPage->site()->strAttachmentDir
487 + String::valueOf(__nDsID) + L"/"
488 + (*itM).value[0] + L"-"
489 + (*itA).value[0] + L".dat";
490
491 if (Files::exists(strFileName)) {
492 size_t nLen = (size_t) Files::size(strFileName);
493 String strName = q.fields()[0].asString();
494 String strType = q.fields()[1].asString();
495
496 FileInputStream in(strFileName);
497
498 ctx.setContentType(strType);
499 ctx.addHeader(
500 HttpHeader(L"Content-Length", String::valueOf(nLen))
501 );
502 ctx.addHeader(
504 L"Content-Disposition",
505 L"inline; filename=\"" + strName + L"\""
506 )
507 );
508
509 char aBuf[4096];
510 size_t n;
511 while((n = in.read(aBuf, 4096)) > 0) {
512 ctx.write(aBuf, n);
513 }
514
515 return;
516 }
517 }
518 }
519 else
520 {
521 if (!session.isSysGuest())
522 {
523#undef CM_UNKNOWN
524#undef CM_GOOD
525#undef CM_BAD
526#undef CM_ERASE
527
528#define CM_UNKNOWN 0
529#define CM_GOOD 1
530#define CM_BAD -1
531#define CM_ERASE 2
532
533 int nCM = CM_UNKNOWN;
534 ListedStringToStringArrayMap::ConstIterator itC = mapQuery.find(L"c");
535 if (itC != mapQuery.end() && (*itC).value.size() > 0) {
536 String strCM = (*itC).value[0];
537 if (strCM == L"good")
538 nCM = CM_GOOD;
539 else if (strCM == L"bad")
540 nCM = CM_BAD;
541 else if (strCM == L"erase")
542 nCM = CM_ERASE;
543 }
544
545 if (nCM == CM_GOOD || nCM == CM_BAD) {
546 String strUserID = String::valueOf(session.__nUserID);
547 q.execute(L""
548 "SELECT NVOTE FROM DCL_MESSAGE_R_" + strTableID + L""
549 "\n WHERE DS_ID = " + strDsID + L""
550 "\n AND MESSAGE_ID = " + strMessageID + L""
551 "\n AND USER_ID = " + strUserID
552 );
553 q.fetch();
554 if (!q.eof()) {
555 if (q.fields()[0].asInteger() == 0) {
556 q.execute(L""
557 "UPDATE DCL_MESSAGE_R_" + strTableID + L""
558 "\n SET VOTE = " + String::valueOf(nCM) + L""
559 "\n WHERE DS_ID = " + strDsID + L""
560 "\n AND MESSAGE_ID = " + strMessageID + L""
561 "\n AND USER_ID = " + strUserID
562 );
563
564 if (nCM == CM_GOOD)
565 q.execute(L""
566 "UPDATE DCL_MESSAGE_" + strTableID + L""
567 "\n SET NVOTE = NVOTE + 1 "
568 "\n WHERE DS_ID = " + strDsID + L""
569 "\n AND MESSAGE_ID = " + strMessageID
570 );
571 else
572 q.execute(L""
573 "UPDATE DCL_MESSAGE_" + strTableID + L""
574 "\n SET NBAD = NBAD + 1 "
575 "\n WHERE DS_ID = " + strDsID + L""
576 "\n AND MESSAGE_ID = " + strMessageID
577 );
578 }
579 }
580 }
581 else if (nCM == CM_ERASE) {
582 q.execute(L""
583 "SELECT M.USER_ID, A.NO"
584 "\n FROM DCL_MESSAGE_" + strTableID + L" AS M"
585 "\n LEFT OUTER JOIN DCL_MESSAGE_A_" + strTableID + L" AS A"
586 "\n ON (M.DS_ID = A.DS_ID AND M.MESSAGE_ID = A.MESSAGE_ID)"
587 "\n WHERE M.DS_ID = " + strDsID + L""
588 "\n AND M.MESSAGE_ID = " + strMessageID + L""
589 "\n AND M.SUBJECT IS NOT NULL"
590 "\n ORDER BY A.NO"
591 );
592 q.fetch();
593 if (!q.eof()) {
594 int nUserID = q.fields()[0].asInteger();
595 if (session.isSysAdmin() || session.__nUserID == nUserID) {
596 if (!q.fields()[1].isNull()) {
597 // 첨부파일이 있다.
598 do {
599 String strFileName = __GetLocalFileName(
600 __pPage->site()->strAttachmentDir,
601 strDsID,
602 strMessageID,
603 q.fields()[1].asString()
604 );
605 if (Files::exists(strFileName))
606 Files::unlink(strFileName);
607
608 q.fetch();
609 } while (!q.eof());
610
611 q.execute(L""
612 "DELETE FROM DCL_MESSAGE_A_" + strTableID + L""
613 "\n WHERE DS_ID = " + strDsID + L""
614 "\n AND MESSAGE_ID = " + strMessageID
615 );
616 }
617
618 String strBodyType;
619 if (session.__nUserID == nUserID)
620 strBodyType = L"-1";
621 else
622 strBodyType = L"-2";
623
624 q.execute(L""
625 "UPDATE DCL_MESSAGE_" + strTableID + L""
626 "\n SET TYPE = " + strBodyType + L""
627 "\n ,SUBJECT = NULL, BODY_ORG = NULL, BODY_PLAIN = NULL"
628 "\n ,BODY_HTML = :BODY_HTML, UPDATE_TIME = CURRENT_TIMESTAMP"
629 "\n WHERE DS_ID = " + strDsID + L""
630 "\n AND MESSAGE_ID = " + strMessageID
631 );
632 }
633
634 String strListPage = getDefault(mapQuery, L"l");
635 if (strListPage.isEmpty())
636 strListPage = __strListPage;
637 String strRefresh = L"?p=" + strListPage;
638 __pPage->refresh(session, strRefresh);
639 return;
640 }
641 }
642 } // if (!session.isSysGuest())
643
644 __pPage->print(session);
645 return;
646 }
647
648 session.__ctx.setStatusCode(HTTP_STATUS_NOT_FOUND);
649}
650
651__DCL_END_NAMESPACE
#define __THIS_FILE__
Definition _trace.h:14
#define NULL
Definition Config.h:312
wchar_t char_t
Definition Config.h:247
#define __DCL_THROWS1(e)
Definition Config.h:152
#define IMPLEMENT_CLASSINFO_EX(class_name, base_class_name)
Definition HtmlView.h:37
@ HTTP_STATUS_NOT_FOUND
#define CM_GOOD
__DCL_BEGIN_NAMESPACE String __GetLocalFileName(const String &strAttachDir, const String &strDsID, const String &strMessageID, const String &strAttachNo)
#define CM_BAD
#define CM_ERASE
#define CM_UNKNOWN
#define IS_NOTICE_ID(nMessageID)
Definition MessageView.h:19
#define __DCL_TRACE1(fmt, arg1)
Definition Object.h:399
#define __DCL_ASSERT(expr)
Definition Object.h:394
#define __T(str)
Definition Object.h:60
String toString() const
Definition DateTime.cpp:251
static bool exists(const String &_path)
Definition Files.cpp:109
static uint64_t size(const String &_path) __DCL_THROWS1(IOException *)
Definition Files.cpp:160
static void unlink(const String &_path) __DCL_THROWS1(IOException *)
Definition Files.cpp:97
String VNO() const
Definition HtmlView.cpp:293
StringToStringMap __mapParams
Definition HtmlView.h:112
String SELF() const
Definition HtmlView.cpp:287
static String getDefault(ListedStringToStringArrayMap &map, const String &strKey)
Definition HtmlView.cpp:256
HtmlPage * __pPage
Definition HtmlView.h:108
static int parse(const wchar_t *_number, unsigned _base=10) __DCL_THROWS1(NumericConvertException *)
Definition Numeric.inl:36
virtual void onGet(Session &session) __DCL_THROWS1(Exception *)
virtual void onPrint(Session &session) __DCL_THROWS1(Exception *)
virtual void init(SQLFields &fields) __DCL_THROWS1(Exception *)
MessageDetailView(HtmlPage *pPage)
void getPosition(int64_t nReplyID, Position &rPos) const
virtual void init(SQLFields &fields) __DCL_THROWS1(Exception *)
virtual void onPrint(Session &session) __DCL_THROWS1(Exception *)
int __nReplyDepth
Definition MessageView.h:37
Definition SQL.h:48
_CONST SQLField & byName(const wchar_t *_name) _CONST __DCL_THROWS1(InvalidIndexException *)
Definition SQLQuery.cpp:77
void prepare(const String &_sql) __DCL_THROWS1(SQLException *)
Definition SQLQuery.cpp:282
_CONST SQLParams & params() _CONST
Definition SQL.inl:106
_CONST SQLFields & fields() _CONST
Definition SQL.inl:101
void execute() __DCL_THROWS1(SQLException *)
Definition SQLQuery.cpp:316
bool eof() const
Definition SQL.inl:91
SQLConnection * connection() const
Definition SQL.inl:116
void fetch() __DCL_THROWS1(SQLException *)
Definition SQLQuery.cpp:336
static ByteString encode(const ByteString &_str)
Definition URI.cpp:82