KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > roller > presentation > weblog > formbeans > CommentFormEx


1 package org.roller.presentation.weblog.formbeans;
2
3 import org.apache.struts.action.ActionMapping;
4 import org.roller.RollerException;
5 import org.roller.pojos.CommentData;
6 import org.roller.presentation.forms.CommentForm;
7
8 import javax.servlet.ServletRequest JavaDoc;
9 import javax.servlet.http.HttpServletRequest JavaDoc;
10 import java.util.Locale JavaDoc;
11
12 /**
13  * Extends the WeblogEntryForm so that additional properties may be added.
14  * These properties are not persistent and are only needed for the UI.
15  *
16  * @struts.form name="commentFormEx"
17  * @author Lance Lavandowska
18  */

19 public class CommentFormEx extends CommentForm
20 {
21     private String JavaDoc[] deleteComments = null;
22     private String JavaDoc[] spamComments = null;
23     private String JavaDoc mEntryId = null;
24
25     public CommentFormEx()
26     {
27         super();
28     }
29
30     public CommentFormEx(CommentData entryData, java.util.Locale JavaDoc locale ) throws RollerException
31     {
32         super(entryData, locale);
33     }
34
35     public String JavaDoc[] getDeleteComments()
36     {
37         return deleteComments;
38     }
39
40     public void setDeleteComments(String JavaDoc[] deleteIds)
41     {
42         deleteComments = deleteIds;
43     }
44
45     /**
46      * @return
47      */

48     public String JavaDoc[] getSpamComments()
49     {
50         return spamComments;
51     }
52
53     public void setSpamComments(String JavaDoc[] spamIds)
54     {
55         spamComments = spamIds;
56     }
57
58     /**
59      * @return
60      */

61     public String JavaDoc getWeblogEntryId()
62     {
63         return mEntryId;
64     }
65
66     /**
67      * @param string
68      */

69     public void setWeblogEntryId(String JavaDoc string)
70     {
71         mEntryId = string;
72     }
73
74     /**
75      * @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
76      */

77     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request)
78     {
79         super.reset(mapping, request);
80         deleteComments = null;
81         spamComments = null;
82     }
83
84     /**
85      * @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.ServletRequest)
86      */

87     public void reset(ActionMapping mapping, ServletRequest JavaDoc request)
88     {
89         super.reset(mapping, request);
90         deleteComments = null;
91         spamComments = null;
92     }
93     
94     public void copyTo(org.roller.pojos.CommentData dataHolder, Locale JavaDoc locale)
95         throws RollerException
96     {
97         super.copyTo(dataHolder, locale);
98         if (getSpam() == null) dataHolder.setSpam(Boolean.FALSE);
99         if (getNotify() == null) dataHolder.setNotify(Boolean.FALSE);
100     }
101 }
102
103
Popular Tags