KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > dlog4j > formbean > ReplyForm


1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU Library General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15  */

16 package dlog4j.formbean;
17
18 import java.util.Date JavaDoc;
19
20 import javax.servlet.http.HttpServletRequest JavaDoc;
21
22
23 import org.apache.struts.action.ActionErrors;
24 import org.apache.struts.action.ActionMapping;
25
26 import dlog4j.util.HtmlUtil;
27
28 /**
29  * ReplayForm.java created by EasyStruts - XsltGen.
30  * http://easystruts.sf.net
31  * created on 02-03-2004
32  *
33  * XDoclet definition:
34  * @struts:form name="replyForm"
35  */

36 public class ReplyForm extends ContentPreviewForm {
37
38     // --------------------------------------------------------- Instance Variables
39

40     /** faceUrl property */
41     private String JavaDoc faceUrl;
42
43     /** writeTime property */
44     private Date JavaDoc writeTime;
45
46     /** id property */
47     private int id;
48
49     /** parant log property */
50     private LogForm log;
51
52     /** author property */
53     private UserForm author;
54     
55     private SiteForm site;
56
57     int useFace = 1;
58     int useUbb = 1;
59     int showFormerly = 0;
60     // --------------------------------------------------------- Methods
61

62     /**
63      * Method validate
64      * @param ActionMapping mapping
65      * @param HttpServletRequest request
66      * @return ActionErrors
67      */

68     public ActionErrors validate(
69         ActionMapping mapping,
70         HttpServletRequest JavaDoc request) {
71         ActionErrors errors = new ActionErrors();
72         return errors;
73     }
74
75     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc req) {
76         writeTime = null;
77         faceUrl = null;
78         useFace = 1;
79         useUbb = 1;
80         showFormerly = 0;
81         content = null;
82     }
83     /**
84      * Returns the faceUrl.
85      * @return String
86      */

87     public String JavaDoc getFaceUrl() {
88         return faceUrl;
89     }
90
91     /**
92      * Set the faceUrl.
93      * @param faceUrl The faceUrl to set
94      */

95     public void setFaceUrl(String JavaDoc faceUrl) {
96         this.faceUrl = faceUrl;
97     }
98
99     public static void main(String JavaDoc[] args) {
100         ReplyForm r = new ReplyForm();
101         r.setContent("<FONT style=\"BACKGROUND-COLOR: #ffccff\" color=#660033><TABLE cellSpacing=1 cellPadding=2 width=\"100%\" border=1><TBODY><TR><TD></TD><TD></TD><TD></TD></TR><TR><TD></TD><TD></TD><TD></TD></TR><TR><TD></TD><TD></TD><TD></TD></TR><TR><TD></TD><TD></TD><TD></TD></TR></TBODY></TABLE><BR>现在要搞评论的修改了!</FONT> ");
102         System.out.print(r.getBrief());
103     }
104
105     public String JavaDoc getHtmlContent(){
106         return HtmlUtil.makeHtml(content, useFace==1, useUbb==1);
107     }
108
109     /**
110      * Returns the writeTime.
111      * @return Date
112      */

113     public Date JavaDoc getWriteTime() {
114         return writeTime;
115     }
116     /**
117      * Set the writeTime.
118      * @param writeTime The writeTime to set
119      */

120     public void setWriteTime(Date JavaDoc writeTime) {
121         this.writeTime = writeTime;
122     }
123
124     /**
125      * Returns the id.
126      * @return int
127      */

128     public int getId() {
129         return id;
130     }
131
132     /**
133      * Set the id.
134      * @param id The id to set
135      */

136     public void setId(int id) {
137         this.id = id;
138     }
139     public int getAuthorId() {
140         return author.getId();
141     }
142     public void setAuthorId(int aid) {
143         if (author == null)
144             author = new UserForm();
145         author.setId(aid);
146     }
147     public String JavaDoc getAuthorName() {
148         return author.getDisplayName();
149     }
150     /**
151      * @return
152      */

153     public UserForm getAuthor() {
154         return author;
155     }
156
157     /**
158      * @param form
159      */

160     public void setAuthor(UserForm form) {
161         author = form;
162     }
163
164     /**
165      * @return
166      */

167     public LogForm getLog() {
168         return log;
169     }
170
171     /**
172      * @param form
173      */

174     public void setLog(LogForm form) {
175         log = form;
176     }
177
178     /**
179      * @return
180      */

181     public int getLogId() {
182         return log.getId();
183     }
184
185     /**
186      * @param form
187      */

188     public void setLogId(int logid) {
189         if (log == null)
190             log = new LogForm();
191         log.setId(logid);
192     }
193
194     /**
195      * @return
196      */

197     public int getUseFace() {
198         return useFace;
199     }
200
201     /**
202      * @return
203      */

204     public int getUseUbb() {
205         return useUbb;
206     }
207
208     /**
209      * @param i
210      */

211     public void setUseFace(int i) {
212         useFace = i;
213     }
214
215     /**
216      * @param i
217      */

218     public void setUseUbb(int i) {
219         useUbb = i;
220     }
221
222     /**
223      * @return
224      */

225     public int getShowFormerly() {
226         return showFormerly;
227     }
228
229     /**
230      * @param i
231      */

232     public void setShowFormerly(int i) {
233         showFormerly = i;
234     }
235
236     /**
237      * @return
238      */

239     public SiteForm getSite() {
240         return site;
241     }
242
243     /**
244      * @param form
245      */

246     public void setSite(SiteForm form) {
247         site = form;
248     }
249
250 }
251
Popular Tags