DCL 3.7.4
Loading...
Searching...
No Matches
MessageWriteForm.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/DateTime.h>
8#include <dcl/Files.h>
9#include <dcl/Dir.h>
10#include <dcl/Regex.h>
11
12#include <dcl/Html.h>
13#include <dcl/URI.h>
14
15#include "ServletMain.h"
16#include "MessageTree.h"
17#include "HtmlPage.h"
18#include "MessageView.h"
19
20#if __DCL_HAVE_THIS_FILE__
21#undef __THIS_FILE__
22static const char_t __THIS_FILE__[] = __T("fastpage/MessageWriteForm.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
41
43 : MessageView(pPage)
44{
45 __nThumbnailImageSize = 0;
46}
47
50{
51 MessageView::init(fields);
52
53 __mapParams.lookup(L"LIST", __strListPage);
54 __mapParams.lookup(L"DETAIL", __strDetailPage);
55
56 String rValue;
57 if (__mapParams.lookup(L"THUMBNAIL_SIZE", rValue)) {
58 __nThumbnailImageSize = Integer::parse(rValue, 10, 110);
59 if (__nThumbnailImageSize <= 0)
60 __nThumbnailImageSize = 110;
61 }
62}
63
64static String __GetLinkInsertedString(const wchar_t* psz)
65{
66 // "http://"로 시작하고 공백이 아닌 문자열
67 // 즉, L"http://"로 시작하고 space( \r\n) 이전까지
68 Regex re(
69 L"http://[^ \t\r\n\"\'<>]+",
70// "(http://[^ \t\r\n]+)|"
71// "(mailto:[a-z0-9_-]+@[a-z0-9_-]+(.[a-z0-9_-]+){1,2})",
72// "http://[^ \t\r\n]+|mailto:[a-z0-9_-]+@[a-z0-9._-]+",
74 );
75
76 const wchar_t* begin = psz;
77 const wchar_t* end = psz + String::length(psz);
78 StringBuilder r;
79
81 while (begin < end && re.search(begin, end, m)) {
82 __DCL_ASSERT(m.size() > 0);
83
84 if (begin < m[0].first) {
85 r.append(begin, m[0].first);
86 }
87 r.append(L"<a href=\"")
88 .append(m[0].first, m[0].second)
89 .append(L"\" target=\"_new\">")
90 .append(m[0].first, m[0].second)
91 .append(L"</a>");
92
93 begin = m[0].second;
94 }
95
96 if (begin < end) {
97 r.append(begin, end);
98 }
99
100 return r;
101}
102
105{
106 // GET 일 때만 사용
107 ListedStringToStringArrayMap& mapQuery = session.__ctx.__queryMap;
108 SQLQuery& q = session.__query;
109
110 String strTableID = String::valueOf(__nTableID);
111 String strDsID = String::valueOf(__nDsID);
112
113 String strMessageID = getDefault(mapQuery, L"modify");
114 if (strMessageID.isEmpty()) {
115 // 새글
116 assign(L"BODY_TYPE", L"-1");
117 assign(L"BODY_VALUE", L"");
118 erase(L"ATTACH");
119 assign(L"WRITER", session.__strUserName);
120 /*
121 ListedStringToStringArrayMap::ConstIterator itMap = mapQuery.find(L"msg");
122 if (itMap != mapQuery.end())
123 mapQuery[L"reply"] = (*itMap).value;
124 */
125 strMessageID = getDefault(mapQuery, L"reply");
126 if (strMessageID.isEmpty() || strMessageID == L"0") {
127 // 시작글
128 if (session.isSysAdmin()) {
129 TextTemplate& IS_ADMIN = (*this)[L"IS_ADMIN"];
130 IS_ADMIN.assign(L"VNO", VNO());
131 assign(L"IS_ADMIN", IS_ADMIN);
132 }
133 else
134 erase(L"IS_ADMIN");
135
136 assign(L"SUBJECT", String());
137 }
138 else {
139 // 답글
140 erase(L"IS_ADMIN");
141 assign(L"ACTION_EX", L"reply=" + strMessageID);
142
143 StringBuilder strRe = L"Re: ";
144 q.execute(L""
145 "SELECT SUBJECT"
146 "\n FROM DCL_MESSAGE_" + strTableID + L""
147 "\n WHERE DS_ID = " + strDsID + L""
148 "\n AND MESSAGE_ID = " + strMessageID
149 );
150 q.fetch();
151 if (!q.eof() && !q.fields()[0].isNull())
152 strRe += q.fields()[0].asString();
153
154 assign(L"SUBJECT", strRe);
155 }
156 }
157 else {
158 // 수정
159 erase(L"IS_ADMIN");
160 TextTemplate& IS_MODIFY = (*this)[L"IS_MODIFY"];
161 IS_MODIFY.assign(L"VNO", VNO());
162 assign(L"IS_MODIFY", IS_MODIFY);
163 assign(L"ACTION_EX", L"modify=" + strMessageID);
164
165 q.execute(L""
166 "SELECT M.TYPE AS BODY_TYPE, M.SUBJECT, M.BODY_ORG,"
167 "\n U.USER_NAME AS WRITER,"
168 "\n A.NO, A.FILENAME, CEILING(A.SIZE / 1024) AS KSIZE"
169 "\n FROM (DCL_MESSAGE_" + strTableID + L" AS M"
170 "\n INNER JOIN DCLWC_USER AS U"
171 "\n ON(M.USER_ID = U.USER_ID))"
172 "\n LEFT OUTER JOIN DCL_MESSAGE_A_" + strTableID + L" AS A"
173 "\n ON (M.DS_ID = A.DS_ID AND M.MESSAGE_ID = A.MESSAGE_ID)"
174 "\n WHERE M.DS_ID = " + strDsID + L""
175 "\n AND M.MESSAGE_ID = " + strMessageID + L""
176 "\n ORDER BY A.NO ASC"
177 );
178 q.fetch();
179 if (!q.eof()) {
180 assign(q.fields(), L"");
181 SQLField& fBODY_ORG = q.fields().byName(L"BODY_ORG");
182 String strBodyValue;
183 if (!fBODY_ORG.isNull()) {
184 strBodyValue = fBODY_ORG.asString();
185 strBodyValue = String::escape(strBodyValue, strBodyValue.length());
186 }
187 assign(L"BODY_VALUE", strBodyValue);
188
189 SQLField& AttachNo = q.fields().byName(L"NO");
190 if (AttachNo.isNull())
191 erase(L"ATTACH");
192 else {
193 TextTemplate& ATTACH = (*this)[L"ATTACH"];
194 TextTemplate& LIST = ATTACH[L"LIST"];
195 do {
196 LIST.assign(L"VNO", VNO());
197 LIST.assign(L"MESSAGE_ID", strMessageID);
198 LIST.assign(L"NO", q.fields().byName(L"NO").asString());
199 LIST.assign(L"FILENAME", q.fields().byName(L"FILENAME").asString());
200 LIST.assign(L"KSIZE", q.fields().byName(L"KSIZE").asString());
201 ATTACH.append(L"LIST", LIST);
202 q.fetch();
203 } while(!q.eof());
204
205 assign(L"ATTACH", ATTACH);
206 }
207 }
208 }
209
210 MessageView::onPrint(session);
211}
212
213#if 0
215 const char* pszSrcFile,
216 const char* pszContentType,
217 const char* pszThumbnailFile,
218 int nSize // = 110
219 );
220#endif
221
224{
225// HtmlView::dump(*(__pPage->session()));
226// return ;
227
228 ListedStringToStringArrayMap& mapQuery = session.__ctx.__queryMap;
229 ListedStringToStringArrayMap& mapForm = session.__ctx.__formMap;
230 SQLQuery& q = session.__query;
231
232 String strTableID = String::valueOf(__nTableID);
233 String strDsID = String::valueOf(__nDsID);
234
235 String strListPage = getDefault(mapQuery, L"list");
236
237 if (session.isSysGuest()) {
238 StringBuilder strRefresh = L"?page=";
239 if (!strListPage.isEmpty())
240 strRefresh += strListPage;
241 else
242 strRefresh += __strListPage;
243 __pPage->refresh(session, strRefresh);
244 return;
245 }
246
247#define CM_UPDATE 0
248#define CM_INSERT_START 1
249#define CM_INSERT_REPLY 2
250
251 int nCM = CM_UPDATE;
252 bool bNotice = false;
253 int nBodyType = BODY_TYPE_PLAIN_BR;
254
255 String strMessageID = getDefault(mapQuery, L"modify");
256 if (strMessageID.isEmpty()) {
257 strMessageID = getDefault(mapQuery, L"reply");
258 if (strMessageID.isEmpty() || strMessageID == L"0") // 새로운 시작글
259 nCM = CM_INSERT_START;
260 else // 답글
261 nCM = CM_INSERT_REPLY;
262 }
263 else // 수정
264 nCM = CM_UPDATE;
265
266 nBodyType = Integer::parse(
267 getDefault(mapForm, L"BODY_TYPE"),
268 10,
269 nBodyType
270 );
271 if (nBodyType > BODY_TYPE_MAX)
272 nBodyType = BODY_TYPE_PLAIN_BR;
273
274 if (mapForm.find(L"NOTICE") != mapForm.end()) {
275 bNotice = true;
276
277 // mapForm의 action을 잘못 기술했다.
278 // 공지사항은 항상 시작글이고 답글은 없으며 수정할 때에도 이 값은 없어야 한다.
280 }
281
282 String strSubject = getDefault(mapForm, L"SUBJECT");
283 String strBodyOrg = getDefault(mapForm, L"BODY_VALUE");
284 String strBodyPlain = Html::strip(strBodyOrg, NULL); // 모든 html element
285 String strBodyHtml;
286
287 if (!strSubject.trim().isEmpty()) {
288 strSubject = Html::escape(strSubject, L"<>");
289 }
290
291 switch(nBodyType) {
292 case BODY_TYPE_PLAIN_BR :
293 strBodyHtml =
294 __GetLinkInsertedString(
296 strBodyOrg,
297 4, // TAB 문자를 4개의 ' '로 변환
298 String(), // 빈 문자열
299 L"<br>"
300 )
301 );
302 break;
303 case BODY_TYPE_PLAIN_P :
304 strBodyHtml =
305 __GetLinkInsertedString(
307 strBodyOrg,
308 4, // TAB 문자를 4개의 ' '로 변환
309 L"<p>",
310 L"</p>"
311 )
312 );
313 break;
314 case BODY_TYPE_HTML :
315 strBodyHtml = strBodyOrg.replace_r(L"<[ \t\r\n]*body", L"<div", true);
316 strBodyHtml = strBodyHtml.replace_r(L"/[ \t\r\n]*body", L"/div", true);
317 strBodyHtml = Html::strip(
318 strBodyHtml,
319 L"!,--,html,head,title,meta,link,script,style,body"
320 ",mapForm,input,button,textarea,select,option"
321 );
322 break;
323 }
324
325 int nAttachNo = 1;
326 if (nCM == CM_UPDATE) {
327 q.execute(L""
328 "SELECT MESSAGE_ID"
329 "\n FROM DCL_MESSAGE_" + strTableID + L""
330 "\n WHERE DS_ID = " + strDsID + L""
331 "\n AND MESSAGE_ID = " + strMessageID + L""
332 "\n AND USER_ID = " + String::valueOf(session.__nUserID)
333 );
334 q.fetch();
335 if (!q.eof()) {
336 q.prepare(L""
337 "UPDATE DCL_MESSAGE_" + strTableID + L""
338 "\n SET TYPE = :TYPE, SUBJECT = :SUBJECT"
339 ", BODY_ORG = :BODY_ORG, BODY_PLAIN = :BODY_PLAIN"
340 ", BODY_HTML = :BODY_HTML, UPDATE_TIME = CURRENT_TIMESTAMP"
341 "\n WHERE DS_ID = " + strDsID + L""
342 " AND MESSAGE_ID = " + strMessageID
343 );
344 SQLParams& params = q.params();
345 params.byName(L"TYPE").setValue(nBodyType);
346 params.byName(L"SUBJECT").setValue(strSubject);
347 params.byName(L"BODY_ORG").setValue(strBodyOrg);
348 params.byName(L"BODY_PLAIN").setValue(strBodyPlain);
349 params.byName(L"BODY_HTML").setValue(strBodyHtml);
350 q.execute();
351
352 // 삭제할 이전 첨부파일을 삭제한다.
353 StringArray& vDeleteAttach = mapForm[L"DELETE_ATTACH"];
354 String strEraseAttach = String::join(vDeleteAttach, L',');
355 if (!strEraseAttach.isEmpty()) {
356 q.execute(L""
357 "DELETE FROM DCL_MESSAGE_A_" + strTableID + L""
358 "\n WHERE DS_ID = " + strDsID + L""
359 "\n AND MESSAGE_ID = " + strMessageID + L""
360 "\n AND NO IN (L" + strEraseAttach + L")"
361 );
362 if (q.affectedRows()) {
363 for(size_t i = 0; i < vDeleteAttach.size(); i++) {
364 String strFileName = __GetLocalFileName(
365 __pPage->site()->strAttachmentDir,
366 strDsID,
367 strMessageID,
368 vDeleteAttach[i]
369 );
370 if (Files::exists(strFileName))
371 Files::unlink(strFileName);
372 }
373 }
374 }
375
376 // 첨부파일이 있는 경우 새로운 첨부파일의 시작번호를 얻어온다.
377 q.execute(L""
378 "SELECT MAX(NO) FROM DCL_MESSAGE_A_" + strTableID + L""
379 "\n WHERE DS_ID = " + strDsID + L""
380 "\n AND MESSAGE_ID = " + strMessageID
381 );
382 q.fetch();
383 if (!q.fields()[0].isNull())
384 nAttachNo = q.fields()[0].asInteger() + 1;
385 }
386 /*
387 else
388 {
389 EOF인 경우 메시지가 없거나 세션 사용자의 글이 아닌 경우이다. 무시한다.
390 }
391 */
392
393 }
394 else {
395 // INSERT
396 int nParentID = 0;
397 int nPrevID = 0;
398 int nMessageID, nStartID, nChild = 0;
399 int64_t nReplyID = 1;
400
401 q.execute(L"SET AUTOCOMMIT = 0");
402 q.execute(L"COMMIT");
403 q.execute(L""
404 "SELECT MESSAGE_ID, NOTICE_ID"
405 "\n FROM DCLWC_DATA_SOURCE"
406 "\n WHERE DS_ID = " + strDsID + L""
407 "\n FOR UPDATE"
408 );
409 q.fetch();
410 if (bNotice)
411 nMessageID = nStartID = q.fields()[1].asInteger();
412 else
413 nMessageID = nStartID = q.fields()[0].asInteger();
414
415 if (nCM == CM_INSERT_REPLY) {
417
418 q.execute(L""
419 "SELECT MESSAGE_ID, START_ID, REPLY_ID, NCHILD"
420 "\n FROM DCL_MESSAGE_" + strTableID + L""
421 "\n WHERE DS_ID = " + strDsID + L""
422 "\n AND MESSAGE_ID = " + strMessageID
423 );
424 q.fetch();
425 if (q.eof()) {
426 // 상위 메시지가 없음
427 }
428
429 nParentID = q.fields()[0].asInteger();
430 nStartID = q.fields()[1].asInteger();
431 nReplyID = q.fields()[2].asInt64();
432 nChild = q.fields()[3].asInteger();
433
435 mt.getPosition(nReplyID, pos);
436 if (nChild == mt.width()
437 || pos.nDepthIndex == (mt.depth() - 1)
438 ) {
439 // 부모노드가
440 // 최대 답글 개수에 도달했거나 최대 깊이에 도달했기 때문에
441 // 더이상 답글을 달 수 없다.
442
443 }
444
445 // 답글의 REPLY_ID를 구한다.
446 // 내림차순은 자식노드의 마지막부터, 오름차순은 첫번째부터 구한다.
447 int64_t nPrevReplyID = 0;
448 if (__nSequence < 0) {
449 int64_t _r = nReplyID;
450 nReplyID = mt.getChildID(nReplyID, mt.width() - nChild - 1);
451 if (nChild > 0)
452 nPrevReplyID = mt.getChildID(_r, mt.width() - nChild);
453 }
454 else {
455 int64_t _r = nReplyID;
456 nReplyID = mt.getChildID(nReplyID, nChild);
457 if (nChild > 0)
458 nPrevReplyID = mt.getChildID(_r, nChild - 1);
459 }
460
461 if (nChild > 0) {
462 __DCL_TRACE2(L"%d, %ls\n", nChild, Int64::toString(nPrevReplyID).data());
463 q.execute(L""
464 "SELECT MESSAGE_ID FROM DCL_MESSAGE_" + strTableID + L""
465 "\n WHERE DS_ID = " + strDsID + L""
466 "\n AND START_ID = " + String::valueOf(nStartID) + L""
467 "\n AND REPLY_ID = " + Int64::toString(nPrevReplyID)
468 );
469 q.fetch();
470 __DCL_ASSERT(!q.eof());
471 nPrevID = q.fields()[0].asInteger();
472 }
473 }
474 else {
475 StringBuilder strSQL = L""
476 "SELECT MAX(MESSAGE_ID) FROM DCL_MESSAGE_" + strTableID + L""
477 "\n WHERE DS_ID = " + strDsID + L""
478 "\n AND PARENT_ID = 0";
479 if (!bNotice)
480 strSQL += L" AND MESSAGE_ID <= 2000000000";
481
482 TRACE0(L"000\n");
483 q.execute(strSQL);
484 q.fetch();
485 __DCL_ASSERT(!q.eof());
486 if (!q.fields()[0].isNull())
487 nPrevID = q.fields()[0].asInteger();
488 TRACE0(L"111\n");
489 }
490
491 q.prepare(L""
492 "INSERT INTO DCL_MESSAGE_" + strTableID + L""
493 "\n (DS_ID, MESSAGE_ID, PREV_ID, NEXT_ID, PARENT_ID, START_ID, REPLY_ID,"
494 " TYPE, USER_ID, SUBJECT, BODY_ORG, BODY_PLAIN, BODY_HTML,"
495 " UPDATE_TIME)"
496 "\n VALUES"
497 "\n (:DS_ID, :MESSAGE_ID, :PREV_ID, :NEXT_ID, :PARENT_ID, :START_ID, :REPLY_ID,"
498 " :BODY_TYPE, :USER_ID, :SUBJECT, :BODY_ORG, :BODY_PLAIN, :BODY_HTML,"
499 " CURRENT_TIMESTAMP)"
500 );
501 SQLParams& params = q.params();
502 params.byName(L"DS_ID").setValue(__nDsID);
503 params.byName(L"MESSAGE_ID").setValue(nMessageID);
504 if (__nSequence < 0) {
505 params.byName(L"PREV_ID").setValue(0);
506 params.byName(L"NEXT_ID").setValue(nPrevID);
507 }
508 else {
509 params.byName(L"PREV_ID").setValue(nPrevID);
510 params.byName(L"NEXT_ID").setValue(0);
511 }
512 params.byName(L"PARENT_ID").setValue(nParentID);
513 params.byName(L"START_ID").setValue(nStartID);
514 params.byName(L"REPLY_ID").setValue(nReplyID);
515 params.byName(L"BODY_TYPE").setValue(nBodyType);
516 params.byName(L"USER_ID").setValue(session.__nUserID);
517 params.byName(L"SUBJECT").setValue(strSubject);
518 params.byName(L"BODY_ORG").setValue(strBodyOrg);
519 params.byName(L"BODY_PLAIN").setValue(strBodyPlain);
520 params.byName(L"BODY_HTML").setValue(strBodyHtml);
521 q.execute();
522
523 if (nPrevID > 0) {
524 if (__nSequence < 0)
525 q.execute(L""
526 "UPDATE DCL_MESSAGE_" + strTableID + L""
527 "\n SET PREV_ID = " + String::valueOf(nMessageID) + L""
528 "\n WHERE DS_ID = " + strDsID + L""
529 "\n AND MESSAGE_ID = " + String::valueOf(nPrevID)
530 );
531 else
532 q.execute(L""
533 "UPDATE DCL_MESSAGE_" + strTableID + L""
534 "\n SET NEXT_ID = " + String::valueOf(nMessageID) + L""
535 "\n WHERE DS_ID = " + strDsID + L""
536 "\n AND MESSAGE_ID = " + String::valueOf(nPrevID)
537 );
538 }
539
540 if (nCM == CM_INSERT_REPLY) {
541 String strChildID;
542 if (nChild == 0)
543 strChildID = L", CHILD_ID = " + String::valueOf(nMessageID);
544
545 q.execute(L""
546 "UPDATE DCL_MESSAGE_" + strTableID + L""
547 "\n SET NCHILD = NCHILD + 1" + strChildID + L""
548 "\n WHERE DS_ID = " + strDsID + L""
549 "\n AND MESSAGE_ID = " + strMessageID
550 );
551 }
552
553 if (bNotice)
554 q.execute(L""
555 "UPDATE DCLWC_DATA_SOURCE"
556 "\n SET NOTICE_ID = NOTICE_ID + 1"
557 "\n WHERE DS_ID = " + strDsID
558 );
559 else
560 q.execute(L""
561 "UPDATE DCLWC_DATA_SOURCE"
562 "\n SET MESSAGE_ID = MESSAGE_ID + 1"
563 "\n WHERE DS_ID = " + strDsID
564 );
565 q.execute(L"COMMIT");
566 q.execute(L"SET AUTOCOMMIT = 1");
567 strMessageID = String::valueOf(nMessageID);
568 }
569
570 // 첨부파일이 있으면 삽입한다.
571 StoredHttpFormData& formFile = session.__ctx.__formFileMap;
572 if (!formFile.isEmpty()) {
573 String strDir = __pPage->site()->strAttachmentDir + strDsID;
574 if (!Files::exists(strDir))
575 Files::mkdir(strDir);
576
577 if (__nThumbnailImageSize > 0) {
578 strDir = __pPage->site()->strThumbnailDir + strDsID;
579 if (!Files::exists(strDir))
580 Files::mkdir(strDir);
581 }
582
583 q.prepare(L""
584 "INSERT INTO DCL_MESSAGE_A_" + strTableID + L""
585 "\n (DS_ID, MESSAGE_ID, NO, FILENAME, TYPE)"
586 "\n VALUES"
587 "\n (L" + strDsID + L", L" + strMessageID + L""
588 ", :NO, :FILENAME, :TYPE)"
589 );
590 for(size_t i = 0; i < formFile.size(); i++) {
591 StoredHttpFormData::FileInfoArray& v = formFile[i];
592 for(size_t j = 0; j < v.size(); j++)
593 {
594 StoredHttpFormData::FileInfo& info = v[j];
595
596 String strLocalFileName = __GetLocalFileName(
597 __pPage->site()->strAttachmentDir,
598 strDsID,
599 strMessageID,
600 String::valueOf(nAttachNo)
601 );
603 info.tempFilename,
604 strLocalFileName
605 );
606 if (__nThumbnailImageSize > 0) {
607#if 0
609 strLocalFileName,
610 info.strContentType,
612 __pPage->site()->strThumbnailDir,
613 strDsID,
614 strMessageID,
615 String::valueOf(nAttachNo)
616 ) + L".jpg",
617 __nThumbnailImageSize
618 );
619#endif
620 }
621 q.params()[0].setValue(nAttachNo);
622 q.params()[1].setValue(info.filename);
623 q.params()[2].setValue(info.contentType);
624 q.execute();
625
626 nAttachNo++;
627 }
628 }
629 }
630
631 StringBuilder strNext = getDefault(mapQuery, L"next");
632 if (!strNext.isEmpty())
633 strNext = L"?page=" + strNext.toString();
634 else {
635 strNext = L"?page=" + __strDetailPage;
636 strNext += L"&msg=" + strMessageID;
637 }
638
639 if (!strListPage.isEmpty())
640 strNext += L"&list=" + URLEncoder::encode(strListPage);
641
642 __pPage->refresh(session, strNext);
643}
644
645__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 CM_UPDATE
#define IMPLEMENT_CLASSINFO_EX(class_name, base_class_name)
Definition HtmlView.h:37
IOException *size_t r
Definition MediaInfo.cpp:82
__DCL_BEGIN_NAMESPACE String __GetLocalFileName(const String &strAttachDir, const String &strDsID, const String &strMessageID, const String &strAttachNo)
#define BODY_TYPE_HTML
Definition MessageView.h:15
#define BODY_TYPE_MAX
Definition MessageView.h:17
#define BODY_TYPE_PLAIN_P
Definition MessageView.h:14
#define BODY_TYPE_PLAIN_BR
Definition MessageView.h:13
#define CM_INSERT_START
#define CM_INSERT_REPLY
__DCL_BEGIN_NAMESPACE String __GetLocalFileName(const String &strAttachDir, const String &strDsID, const String &strMessageID, const String &strAttachNo)
#define TRACE0
Definition Object.h:359
#define __DCL_ASSERT(expr)
Definition Object.h:394
#define __T(str)
Definition Object.h:60
#define __DCL_TRACE2(fmt, arg1, arg2)
Definition Object.h:400
__DCL_BEGIN_NAMESPACE bool GenThumbnailImage(const char *pszSrcFile, const char *pszContentType, const char *pszThumbnailFile, int nSize)
Definition ThumbNail.cpp:15
static void mkdir(const String &_path, int _mode=0755) __DCL_THROWS1(IOException *)
Definition Files.cpp:218
static bool exists(const String &_path)
Definition Files.cpp:109
static void rename(const String &_oldpath, const String &_newpath) __DCL_THROWS1(IOException *)
Definition Files.cpp:67
static void unlink(const String &_path) __DCL_THROWS1(IOException *)
Definition Files.cpp:97
static String strip(const String &_str, const wchar_t *_elementNames)
Definition Html.cpp:230
static String format(const String &_str, int _tab2Space, const String &_beginOfLine, const String &_endOfLine)
Definition Html.cpp:122
static String escape(const String &_str, const wchar_t *_chars)
Definition Html.cpp:69
String VNO() const
Definition HtmlView.cpp:293
StringToStringMap __mapParams
Definition HtmlView.h:112
static String getDefault(ListedStringToStringArrayMap &map, const String &strKey)
Definition HtmlView.cpp:256
HtmlPage * __pPage
Definition HtmlView.h:108
String toString(unsigned _base=10) const
Definition Numeric.inl:117
static int parse(const wchar_t *_number, unsigned _base=10) __DCL_THROWS1(NumericConvertException *)
Definition Numeric.inl:36
int depth() const
Definition MessageTree.h:91
int width() const
Definition MessageTree.h:96
void getPosition(int64_t nReplyID, Position &rPos) const
int64_t getChildID(int64_t nReplyID, int nWidthIndex) const
virtual void init(SQLFields &fields) __DCL_THROWS1(Exception *)
virtual void onPrint(Session &session) __DCL_THROWS1(Exception *)
int __nReplyDepth
Definition MessageView.h:37
MessageWriteForm(HtmlPage *pPage)
virtual void onPrint(Session &session) __DCL_THROWS1(Exception *)
virtual void onPost(Session &session) __DCL_THROWS1(Exception *)
virtual void init(SQLFields &fields) __DCL_THROWS1(Exception *)
size_t size() const
Definition Regex.h:57
Definition Regex.h:32
@ ICASE
Definition Regex.h:35
Definition SQL.h:48
_CONST SQLField & byName(const wchar_t *_name) _CONST __DCL_THROWS1(InvalidIndexException *)
Definition SQLQuery.cpp:77
SQLParam & byName(const wchar_t *_name) _CONST __DCL_THROWS1(InvalidIndexException *)
Definition SQLQuery.cpp:157
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
int64_t affectedRows() const
Definition SQL.inl:96
bool eof() const
Definition SQL.inl:91
void fetch() __DCL_THROWS1(SQLException *)
Definition SQLQuery.cpp:336
static ByteString encode(const ByteString &_str)
Definition URI.cpp:82