001: /*
002: * This program is free software; you can redistribute it and/or modify
003: * it under the terms of the GNU General Public License as published by
004: * the Free Software Foundation; either version 2 of the License, or
005: * (at your option) any later version.
006: *
007: * This program is distributed in the hope that it will be useful,
008: * but WITHOUT ANY WARRANTY; without even the implied warranty of
009: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
010: * GNU Library General Public License for more details.
011: *
012: * You should have received a copy of the GNU General Public License
013: * along with this program; if not, write to the Free Software
014: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
015: */
016: package dlog4j.formbean;
017:
018: import java.util.Date;
019:
020: import javax.servlet.http.HttpServletRequest;
021:
022: import org.apache.struts.action.ActionErrors;
023: import org.apache.struts.action.ActionMapping;
024:
025: import dlog4j.util.HtmlUtil;
026:
027: /**
028: * ReplayForm.java created by EasyStruts - XsltGen.
029: * http://easystruts.sf.net
030: * created on 02-03-2004
031: *
032: * XDoclet definition:
033: * @struts:form name="replyForm"
034: */
035: public class ReplyForm extends ContentPreviewForm {
036:
037: // --------------------------------------------------------- Instance Variables
038:
039: /** faceUrl property */
040: private String faceUrl;
041:
042: /** writeTime property */
043: private Date writeTime;
044:
045: /** id property */
046: private int id;
047:
048: /** parant log property */
049: private LogForm log;
050:
051: /** author property */
052: private UserForm author;
053:
054: private SiteForm site;
055:
056: int useFace = 1;
057: int useUbb = 1;
058: int showFormerly = 0;
059:
060: // --------------------------------------------------------- Methods
061:
062: /**
063: * Method validate
064: * @param ActionMapping mapping
065: * @param HttpServletRequest request
066: * @return ActionErrors
067: */
068: public ActionErrors validate(ActionMapping mapping,
069: HttpServletRequest request) {
070: ActionErrors errors = new ActionErrors();
071: return errors;
072: }
073:
074: public void reset(ActionMapping mapping, HttpServletRequest req) {
075: writeTime = null;
076: faceUrl = null;
077: useFace = 1;
078: useUbb = 1;
079: showFormerly = 0;
080: content = null;
081: }
082:
083: /**
084: * Returns the faceUrl.
085: * @return String
086: */
087: public String getFaceUrl() {
088: return faceUrl;
089: }
090:
091: /**
092: * Set the faceUrl.
093: * @param faceUrl The faceUrl to set
094: */
095: public void setFaceUrl(String faceUrl) {
096: this .faceUrl = faceUrl;
097: }
098:
099: public static void main(String[] args) {
100: ReplyForm r = new ReplyForm();
101: r
102: .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> ");
103: System.out.print(r.getBrief());
104: }
105:
106: public String getHtmlContent() {
107: return HtmlUtil.makeHtml(content, useFace == 1, useUbb == 1);
108: }
109:
110: /**
111: * Returns the writeTime.
112: * @return Date
113: */
114: public Date getWriteTime() {
115: return writeTime;
116: }
117:
118: /**
119: * Set the writeTime.
120: * @param writeTime The writeTime to set
121: */
122: public void setWriteTime(Date writeTime) {
123: this .writeTime = writeTime;
124: }
125:
126: /**
127: * Returns the id.
128: * @return int
129: */
130: public int getId() {
131: return id;
132: }
133:
134: /**
135: * Set the id.
136: * @param id The id to set
137: */
138: public void setId(int id) {
139: this .id = id;
140: }
141:
142: public int getAuthorId() {
143: return author.getId();
144: }
145:
146: public void setAuthorId(int aid) {
147: if (author == null)
148: author = new UserForm();
149: author.setId(aid);
150: }
151:
152: public String getAuthorName() {
153: return author.getDisplayName();
154: }
155:
156: /**
157: * @return
158: */
159: public UserForm getAuthor() {
160: return author;
161: }
162:
163: /**
164: * @param form
165: */
166: public void setAuthor(UserForm form) {
167: author = form;
168: }
169:
170: /**
171: * @return
172: */
173: public LogForm getLog() {
174: return log;
175: }
176:
177: /**
178: * @param form
179: */
180: public void setLog(LogForm form) {
181: log = form;
182: }
183:
184: /**
185: * @return
186: */
187: public int getLogId() {
188: return log.getId();
189: }
190:
191: /**
192: * @param form
193: */
194: public void setLogId(int logid) {
195: if (log == null)
196: log = new LogForm();
197: log.setId(logid);
198: }
199:
200: /**
201: * @return
202: */
203: public int getUseFace() {
204: return useFace;
205: }
206:
207: /**
208: * @return
209: */
210: public int getUseUbb() {
211: return useUbb;
212: }
213:
214: /**
215: * @param i
216: */
217: public void setUseFace(int i) {
218: useFace = i;
219: }
220:
221: /**
222: * @param i
223: */
224: public void setUseUbb(int i) {
225: useUbb = i;
226: }
227:
228: /**
229: * @return
230: */
231: public int getShowFormerly() {
232: return showFormerly;
233: }
234:
235: /**
236: * @param i
237: */
238: public void setShowFormerly(int i) {
239: showFormerly = i;
240: }
241:
242: /**
243: * @return
244: */
245: public SiteForm getSite() {
246: return site;
247: }
248:
249: /**
250: * @param form
251: */
252: public void setSite(SiteForm form) {
253: site = form;
254: }
255:
256: }
|