KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mvnforum > phpbb2mvnforum > db > ThreadBean


1 /*
2  * $Header: /cvsroot/mvnforum/mvnforum/contrib/phpbb2mvnforum/src/org/mvnforum/phpbb2mvnforum/db/ThreadBean.java,v 1.2 2006/04/15 03:57:15 minhnn Exp $
3  * $Author: minhnn $
4  * $Revision: 1.2 $
5  * $Date: 2006/04/15 03:57:15 $
6  *
7  * ====================================================================
8  *
9  * Copyright (C) 2002-2006 by MyVietnam.net
10  *
11  * All copyright notices regarding mvnForum MUST remain
12  * intact in the scripts and in the outputted HTML.
13  * The "powered by" text/logo with a link back to
14  * http://www.mvnForum.com and http://www.MyVietnam.net in
15  * the footer of the pages MUST remain visible when the pages
16  * are viewed on the internet or intranet.
17  *
18  * This program is free software; you can redistribute it and/or modify
19  * it under the terms of the GNU General Public License as published by
20  * the Free Software Foundation; either version 2 of the License, or
21  * any later version.
22  *
23  * This program is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  * GNU General Public License for more details.
27  *
28  * You should have received a copy of the GNU General Public License
29  * along with this program; if not, write to the Free Software
30  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31  *
32  * Support can be obtained from support forums at:
33  * http://www.mvnForum.com/mvnforum/index
34  *
35  * Correspondence and Marketing Questions can be sent to:
36  * info at MyVietnam net
37  *
38  * @author: Minh Nguyen
39  * @author: Mai Nguyen
40  */

41 package org.mvnforum.phpbb2mvnforum.db;
42
43 import java.sql.Timestamp JavaDoc;
44 import java.util.Collection JavaDoc;
45 import java.util.Iterator JavaDoc;
46
47 import org.w3c.dom.Document JavaDoc;
48 import org.w3c.dom.Element JavaDoc;
49 import org.w3c.dom.Node JavaDoc;
50
51 import net.myvietnam.mvncore.util.StringUtil;
52
53 /*
54  * Included columns: ThreadID, ForumID, MemberName, LastPostMemberName, ThreadTopic,
55  * ThreadBody, ThreadVoteCount, ThreadVoteTotalStars, ThreadCreationDate, ThreadLastPostDate,
56  * ThreadType, ThreadOption, ThreadStatus, ThreadHasPoll, ThreadViewCount,
57  * ThreadReplyCount, ThreadIcon, ThreadDuration
58  * Excluded columns:
59  */

60 public class ThreadBean {
61     /*************************************************************************
62      * NOTE: below constants MUST NOT be changed IN ALL CASES,
63      * or it will break the compatibility
64      *************************************************************************/

65     /**
66      * The default value mean thread is enable and normal
67      */

68     public final static int THREAD_STATUS_DEFAULT = 0;
69
70     /**
71      * The disable thread is invisible for normal user and visible to moderator
72      */

73     public final static int THREAD_STATUS_DISABLED = 1;
74
75     /**
76      * No changes (edit, attach, reply) could be maded, moderator
77      * have to change this status before making any changes is possible
78      */

79     public final static int THREAD_STATUS_LOCKED = 2;
80
81     /**
82      * Noone can reply, but moderator can change it.
83      */

84     public final static int THREAD_STATUS_CLOSED = 3;
85
86     /**
87      * Thread type is traditional
88      */

89     public final static int THREAD_TYPE_DEFAULT = 0;
90
91     public final static int THREAD_TYPE_STICKY = 1;
92
93     public final static int THREAD_TYPE_FORUM_ANNOUNCEMENT = 2;
94
95     public final static int THREAD_TYPE_GLOBAL_ANNOUNCEMENT = 3;
96
97     private int threadID;
98     private int forumID;
99     private String JavaDoc memberName;
100     private String JavaDoc lastPostMemberName;
101     private String JavaDoc threadTopic;
102     private String JavaDoc threadBody;
103     private int threadVoteCount;
104     private int threadVoteTotalStars;
105     private Timestamp JavaDoc threadCreationDate;
106     private Timestamp JavaDoc threadLastPostDate;
107     private int threadType;
108     private int threadOption;
109     private int threadStatus;
110     private int threadHasPoll;
111     private int threadViewCount;
112     private int threadReplyCount;
113     private String JavaDoc threadIcon;
114     private int threadDuration;
115     private int threadAttachCount;
116
117     public int getThreadID() {
118         return threadID;
119     }
120     public void setThreadID(int threadID) {
121         this.threadID = threadID;
122     }
123
124     public int getForumID() {
125         return forumID;
126     }
127     public void setForumID(int forumID) {
128         this.forumID = forumID;
129     }
130
131     public String JavaDoc getMemberName() {
132         return memberName;
133     }
134     public void setMemberName(String JavaDoc memberName) {
135         this.memberName = memberName;
136     }
137
138     public String JavaDoc getLastPostMemberName() {
139         return lastPostMemberName;
140     }
141     public void setLastPostMemberName(String JavaDoc lastPostMemberName) {
142         this.lastPostMemberName = lastPostMemberName;
143     }
144
145     public String JavaDoc getThreadTopic() {
146         return threadTopic;
147     }
148     public void setThreadTopic(String JavaDoc threadTopic) {
149         this.threadTopic = threadTopic;
150     }
151
152     public String JavaDoc getThreadBody() {
153         return threadBody;
154     }
155     public void setThreadBody(String JavaDoc threadBody) {
156         this.threadBody = threadBody;
157     }
158
159     public int getThreadVoteCount() {
160         return threadVoteCount;
161     }
162     public void setThreadVoteCount(int threadVoteCount) {
163         this.threadVoteCount = threadVoteCount;
164     }
165
166     public int getThreadVoteTotalStars() {
167         return threadVoteTotalStars;
168     }
169     public void setThreadVoteTotalStars(int threadVoteTotalStars) {
170         this.threadVoteTotalStars = threadVoteTotalStars;
171     }
172
173     public Timestamp JavaDoc getThreadCreationDate() {
174         return threadCreationDate;
175     }
176     public void setThreadCreationDate(Timestamp JavaDoc threadCreationDate) {
177         this.threadCreationDate = threadCreationDate;
178     }
179
180     public Timestamp JavaDoc getThreadLastPostDate() {
181         return threadLastPostDate;
182     }
183     public void setThreadLastPostDate(Timestamp JavaDoc threadLastPostDate) {
184         this.threadLastPostDate = threadLastPostDate;
185     }
186
187     public int getThreadType() {
188         return threadType;
189     }
190     public void setThreadType(int threadType) {
191         this.threadType = threadType;
192     }
193
194     public int getThreadOption() {
195         return threadOption;
196     }
197     public void setThreadOption(int threadOption) {
198         this.threadOption = threadOption;
199     }
200
201     public int getThreadStatus() {
202         return threadStatus;
203     }
204     public void setThreadStatus(int threadStatus) {
205         this.threadStatus = threadStatus;
206     }
207
208     public int getThreadHasPoll() {
209         return threadHasPoll;
210     }
211     public void setThreadHasPoll(int threadHasPoll) {
212         this.threadHasPoll = threadHasPoll;
213     }
214
215     public int getThreadViewCount() {
216         return threadViewCount;
217     }
218     public void setThreadViewCount(int threadViewCount) {
219         this.threadViewCount = threadViewCount;
220     }
221
222     public int getThreadReplyCount() {
223         return threadReplyCount;
224     }
225     public void setThreadReplyCount(int threadReplyCount) {
226         this.threadReplyCount = threadReplyCount;
227     }
228
229     public String JavaDoc getThreadIcon() {
230         return threadIcon;
231     }
232     public void setThreadIcon(String JavaDoc threadIcon) {
233         this.threadIcon = StringUtil.getEmptyStringIfNull(threadIcon);
234     }
235
236     public int getThreadDuration() {
237         return threadDuration;
238     }
239     public void setThreadDuration(int threadDuration) {
240         this.threadDuration = threadDuration;
241     }
242
243     public int getThreadAttachCount() {
244         return this.threadAttachCount;
245     }
246     public void setThreadAttachCount(int attachCount) {
247         this.threadAttachCount = attachCount;
248     }
249
250     public String JavaDoc getXMLTag() {
251         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
252         xml.append("<Thread");
253         xml.append(" threadID=\"").append(String.valueOf(threadID)).append("\"");
254         xml.append(" forumID=\"").append(String.valueOf(forumID)).append("\"");
255         xml.append(" memberName=\"").append(String.valueOf(memberName)).append("\"");
256         xml.append(" lastPostMemberName=\"").append(String.valueOf(lastPostMemberName)).append("\"");
257         xml.append(" threadTopic=\"").append(String.valueOf(threadTopic)).append("\"");
258         xml.append(" threadBody=\"").append(String.valueOf(threadBody)).append("\"");
259         xml.append(" threadVoteCount=\"").append(String.valueOf(threadVoteCount)).append("\"");
260         xml.append(" threadVoteTotalStars=\"").append(String.valueOf(threadVoteTotalStars)).append("\"");
261         xml.append(" threadCreationDate=\"").append(String.valueOf(threadCreationDate)).append("\"");
262         xml.append(" threadLastPostDate=\"").append(String.valueOf(threadLastPostDate)).append("\"");
263         xml.append(" threadType=\"").append(String.valueOf(threadType)).append("\"");
264         xml.append(" threadOption=\"").append(String.valueOf(threadOption)).append("\"");
265         xml.append(" threadStatus=\"").append(String.valueOf(threadStatus)).append("\"");
266         xml.append(" threadHasPoll=\"").append(String.valueOf(threadHasPoll)).append("\"");
267         xml.append(" threadViewCount=\"").append(String.valueOf(threadViewCount)).append("\"");
268         xml.append(" threadReplyCount=\"").append(String.valueOf(threadReplyCount)).append("\"");
269         xml.append(" threadIcon=\"").append(String.valueOf(threadIcon)).append("\"");
270         xml.append(" threadDuration=\"").append(String.valueOf(threadDuration)).append("\"");
271         xml.append(" threadAttachCount=\"").append(String.valueOf(threadAttachCount)).append("\"");
272         xml.append(">");
273         return xml.toString();
274     }
275     
276     public void getBeanDocument(Document JavaDoc doc, Element JavaDoc element) {
277         Element JavaDoc category = doc.createElement("Thread");
278         element.appendChild(category);
279         
280         category.appendChild(getNode(doc, "ThreadID", String.valueOf(threadID)));
281         category.appendChild(getNode(doc, "ForumID", String.valueOf(forumID)));
282         category.appendChild(getNode(doc, "MemberName", String.valueOf(memberName)));
283         category.appendChild(getNode(doc, "LastPostMemberName", String.valueOf(lastPostMemberName)));
284         category.appendChild(getNode(doc, "ThreadTopic", String.valueOf(threadTopic)));
285         category.appendChild(getNode(doc, "ThreadBody", String.valueOf(threadBody)));
286         category.appendChild(getNode(doc, "ThreadVoteCount", String.valueOf(threadVoteCount)));
287         category.appendChild(getNode(doc, "ThreadVoteTotalStars", String.valueOf(threadVoteTotalStars)));
288         category.appendChild(getNode(doc, "ThreadCreationDate", String.valueOf(threadCreationDate)));
289         category.appendChild(getNode(doc, "ThreadLastPostDate", String.valueOf(threadLastPostDate)));
290         category.appendChild(getNode(doc, "ThreadType", String.valueOf(threadType)));
291         category.appendChild(getNode(doc, "ThreadOption", String.valueOf(threadOption)));
292         category.appendChild(getNode(doc, "ThreadStatus", String.valueOf(threadStatus)));
293         category.appendChild(getNode(doc, "ThreadHasPoll", String.valueOf(threadHasPoll)));
294         category.appendChild(getNode(doc, "ThreadViewCount", String.valueOf(threadViewCount)));
295         category.appendChild(getNode(doc, "ThreadReplyCount", String.valueOf(threadReplyCount)));
296         category.appendChild(getNode(doc, "ThreadIcon", String.valueOf(threadIcon)));
297         category.appendChild(getNode(doc, "ThreadDuration", String.valueOf(threadDuration)));
298         category.appendChild(getNode(doc, "ThreadAttachCount", String.valueOf(threadAttachCount)));
299     }
300     
301     public static Node JavaDoc getNode (Document JavaDoc doc, String JavaDoc childName, String JavaDoc childValue ) {
302         Element JavaDoc child = doc.createElement(childName);
303         child.appendChild(doc.createTextNode(childValue));
304         return child;
305     }
306
307     public String JavaDoc getXML() {
308         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
309         xml.append("<ThreadSection>\n");
310         xml.append(" <Rows>\n");
311         xml.append(" <Row>\n");
312         xml.append(" <Column>\n");
313         xml.append(" <Name>ThreadID</Name>\n");
314         xml.append(" <Value>").append(String.valueOf(threadID)).append("</Value>\n");
315         xml.append(" </Column>\n");
316         xml.append(" <Column>\n");
317         xml.append(" <Name>ForumID</Name>\n");
318         xml.append(" <Value>").append(String.valueOf(forumID)).append("</Value>\n");
319         xml.append(" </Column>\n");
320         xml.append(" <Column>\n");
321         xml.append(" <Name>MemberName</Name>\n");
322         xml.append(" <Value>").append(String.valueOf(memberName)).append("</Value>\n");
323         xml.append(" </Column>\n");
324         xml.append(" <Column>\n");
325         xml.append(" <Name>LastPostMemberName</Name>\n");
326         xml.append(" <Value>").append(String.valueOf(lastPostMemberName)).append("</Value>\n");
327         xml.append(" </Column>\n");
328         xml.append(" <Column>\n");
329         xml.append(" <Name>ThreadTopic</Name>\n");
330         xml.append(" <Value>").append(String.valueOf(threadTopic)).append("</Value>\n");
331         xml.append(" </Column>\n");
332         xml.append(" <Column>\n");
333         xml.append(" <Name>ThreadBody</Name>\n");
334         xml.append(" <Value>").append(String.valueOf(threadBody)).append("</Value>\n");
335         xml.append(" </Column>\n");
336         xml.append(" <Column>\n");
337         xml.append(" <Name>ThreadVoteCount</Name>\n");
338         xml.append(" <Value>").append(String.valueOf(threadVoteCount)).append("</Value>\n");
339         xml.append(" </Column>\n");
340         xml.append(" <Column>\n");
341         xml.append(" <Name>ThreadVoteTotalStars</Name>\n");
342         xml.append(" <Value>").append(String.valueOf(threadVoteTotalStars)).append("</Value>\n");
343         xml.append(" </Column>\n");
344         xml.append(" <Column>\n");
345         xml.append(" <Name>ThreadCreationDate</Name>\n");
346         xml.append(" <Value>").append(String.valueOf(threadCreationDate)).append("</Value>\n");
347         xml.append(" </Column>\n");
348         xml.append(" <Column>\n");
349         xml.append(" <Name>ThreadLastPostDate</Name>\n");
350         xml.append(" <Value>").append(String.valueOf(threadLastPostDate)).append("</Value>\n");
351         xml.append(" </Column>\n");
352         xml.append(" <Column>\n");
353         xml.append(" <Name>ThreadType</Name>\n");
354         xml.append(" <Value>").append(String.valueOf(threadType)).append("</Value>\n");
355         xml.append(" </Column>\n");
356         xml.append(" <Column>\n");
357         xml.append(" <Name>ThreadOption</Name>\n");
358         xml.append(" <Value>").append(String.valueOf(threadOption)).append("</Value>\n");
359         xml.append(" </Column>\n");
360         xml.append(" <Column>\n");
361         xml.append(" <Name>ThreadStatus</Name>\n");
362         xml.append(" <Value>").append(String.valueOf(threadStatus)).append("</Value>\n");
363         xml.append(" </Column>\n");
364         xml.append(" <Column>\n");
365         xml.append(" <Name>ThreadHasPoll</Name>\n");
366         xml.append(" <Value>").append(String.valueOf(threadHasPoll)).append("</Value>\n");
367         xml.append(" </Column>\n");
368         xml.append(" <Column>\n");
369         xml.append(" <Name>ThreadViewCount</Name>\n");
370         xml.append(" <Value>").append(String.valueOf(threadViewCount)).append("</Value>\n");
371         xml.append(" </Column>\n");
372         xml.append(" <Column>\n");
373         xml.append(" <Name>ThreadReplyCount</Name>\n");
374         xml.append(" <Value>").append(String.valueOf(threadReplyCount)).append("</Value>\n");
375         xml.append(" </Column>\n");
376         xml.append(" <Column>\n");
377         xml.append(" <Name>ThreadIcon</Name>\n");
378         xml.append(" <Value>").append(String.valueOf(threadIcon)).append("</Value>\n");
379         xml.append(" </Column>\n");
380         xml.append(" <Column>\n");
381         xml.append(" <Name>ThreadDuration</Name>\n");
382         xml.append(" <Value>").append(String.valueOf(threadDuration)).append("</Value>\n");
383         xml.append(" </Column>\n");
384         xml.append(" <Column>\n");
385         xml.append(" <Name>ThreadAttachCount</Name>\n");
386         xml.append(" <Value>").append(String.valueOf(threadAttachCount)).append("</Value>\n");
387         xml.append(" </Column>\n");
388         xml.append(" </Row>\n");
389         xml.append(" </Rows>\n");
390         xml.append("</ThreadSection>\n");
391         return xml.toString();
392     }
393
394     public static String JavaDoc getXML(Collection JavaDoc objThreadBeans) {
395         StringBuffer JavaDoc xml = new StringBuffer JavaDoc(1024);
396         Iterator JavaDoc iterator = objThreadBeans.iterator();
397         xml.append("<ThreadSection>\n");
398         xml.append(" <Rows>\n");
399         while (iterator.hasNext()) {
400             ThreadBean objThreadBean = (ThreadBean)iterator.next();
401             xml.append(" <Row>\n");
402             xml.append(" <Column>\n");
403             xml.append(" <Name>ThreadID</Name>\n");
404             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadID)).append("</Value>\n");
405             xml.append(" </Column>\n");
406             xml.append(" <Column>\n");
407             xml.append(" <Name>ForumID</Name>\n");
408             xml.append(" <Value>").append(String.valueOf(objThreadBean.forumID)).append("</Value>\n");
409             xml.append(" </Column>\n");
410             xml.append(" <Column>\n");
411             xml.append(" <Name>MemberName</Name>\n");
412             xml.append(" <Value>").append(String.valueOf(objThreadBean.memberName)).append("</Value>\n");
413             xml.append(" </Column>\n");
414             xml.append(" <Column>\n");
415             xml.append(" <Name>LastPostMemberName</Name>\n");
416             xml.append(" <Value>").append(String.valueOf(objThreadBean.lastPostMemberName)).append("</Value>\n");
417             xml.append(" </Column>\n");
418             xml.append(" <Column>\n");
419             xml.append(" <Name>ThreadTopic</Name>\n");
420             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadTopic)).append("</Value>\n");
421             xml.append(" </Column>\n");
422             xml.append(" <Column>\n");
423             xml.append(" <Name>ThreadBody</Name>\n");
424             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadBody)).append("</Value>\n");
425             xml.append(" </Column>\n");
426             xml.append(" <Column>\n");
427             xml.append(" <Name>ThreadVoteCount</Name>\n");
428             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadVoteCount)).append("</Value>\n");
429             xml.append(" </Column>\n");
430             xml.append(" <Column>\n");
431             xml.append(" <Name>ThreadVoteTotalStars</Name>\n");
432             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadVoteTotalStars)).append("</Value>\n");
433             xml.append(" </Column>\n");
434             xml.append(" <Column>\n");
435             xml.append(" <Name>ThreadCreationDate</Name>\n");
436             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadCreationDate)).append("</Value>\n");
437             xml.append(" </Column>\n");
438             xml.append(" <Column>\n");
439             xml.append(" <Name>ThreadLastPostDate</Name>\n");
440             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadLastPostDate)).append("</Value>\n");
441             xml.append(" </Column>\n");
442             xml.append(" <Column>\n");
443             xml.append(" <Name>ThreadType</Name>\n");
444             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadType)).append("</Value>\n");
445             xml.append(" </Column>\n");
446             xml.append(" <Column>\n");
447             xml.append(" <Name>ThreadOption</Name>\n");
448             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadOption)).append("</Value>\n");
449             xml.append(" </Column>\n");
450             xml.append(" <Column>\n");
451             xml.append(" <Name>ThreadStatus</Name>\n");
452             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadStatus)).append("</Value>\n");
453             xml.append(" </Column>\n");
454             xml.append(" <Column>\n");
455             xml.append(" <Name>ThreadHasPoll</Name>\n");
456             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadHasPoll)).append("</Value>\n");
457             xml.append(" </Column>\n");
458             xml.append(" <Column>\n");
459             xml.append(" <Name>ThreadViewCount</Name>\n");
460             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadViewCount)).append("</Value>\n");
461             xml.append(" </Column>\n");
462             xml.append(" <Column>\n");
463             xml.append(" <Name>ThreadReplyCount</Name>\n");
464             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadReplyCount)).append("</Value>\n");
465             xml.append(" </Column>\n");
466             xml.append(" <Column>\n");
467             xml.append(" <Name>ThreadIcon</Name>\n");
468             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadIcon)).append("</Value>\n");
469             xml.append(" </Column>\n");
470             xml.append(" <Column>\n");
471             xml.append(" <Name>ThreadDuration</Name>\n");
472             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadDuration)).append("</Value>\n");
473             xml.append(" </Column>\n");
474             xml.append(" <Column>\n");
475             xml.append(" <Name>ThreadAttachCount</Name>\n");
476             xml.append(" <Value>").append(String.valueOf(objThreadBean.threadAttachCount)).append("</Value>\n");
477             xml.append(" </Column>\n");
478             xml.append(" </Row>\n");
479         }//while
480
xml.append(" </Rows>\n");
481         xml.append("</ThreadSection>\n");
482         return xml.toString();
483     }
484
485     /************************************************
486      * Customized methods come below
487      ************************************************/

488     private int threadPendingPostCount;
489
490     public int getThreadPendingPostCount() {
491         return threadPendingPostCount;
492     }
493     public void setThreadPendingPostCount(int threadPendingPostCount) {
494         this.threadPendingPostCount = threadPendingPostCount;
495     }
496
497     private Collection JavaDoc pendingPosts;
498
499     public Collection JavaDoc getPendingPosts() {
500         return pendingPosts;
501     }
502     public void setPendingPosts(Collection JavaDoc pendingPosts) {
503         this.pendingPosts = pendingPosts;
504     }
505
506     static public void validateThreadStatus(int status) throws IllegalArgumentException JavaDoc {
507         if ((status < 0) || (status > THREAD_STATUS_CLOSED)) {
508             throw new IllegalArgumentException JavaDoc("Invalid ThreadStatus = " + status);
509         }
510     }
511
512     static public void validateThreadType(int type) throws IllegalArgumentException JavaDoc {
513         if ((type < 0) || (type > THREAD_TYPE_GLOBAL_ANNOUNCEMENT)) {
514             throw new IllegalArgumentException JavaDoc("Invalid ThreadType = " + type);
515         }
516     }
517
518     public void ensureStatusCanReply() throws IllegalArgumentException JavaDoc {
519         if ( (getThreadStatus() == ThreadBean.THREAD_STATUS_LOCKED) ||
520             (getThreadStatus() == ThreadBean.THREAD_STATUS_CLOSED)) {
521             // or we can throw AssertionException. indicate that the gui MUST hide the option
522
//@todo : localize me
523
throw new IllegalStateException JavaDoc("Cannot reply when the thread is closed or locked.");
524         }
525     }
526
527     public void ensureStatusCanEdit() throws IllegalArgumentException JavaDoc {
528         if ( (getThreadStatus() == ThreadBean.THREAD_STATUS_LOCKED) ) {
529             // or we can throw AssertionException. indicate that the gui MUST hide the option
530
//@todo : localize me
531
throw new IllegalStateException JavaDoc("Cannot edit post when the thread is locked.");
532         }
533     }
534
535 } //end of class ThreadBean
536
Popular Tags