KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > dotmarketing > portlets > banners > struts > BannerForm


1 package com.dotmarketing.portlets.banners.struts;
2
3
4 import java.text.ParseException JavaDoc;
5 import java.text.SimpleDateFormat JavaDoc;
6
7 import javax.servlet.http.HttpServletRequest JavaDoc;
8
9 import org.apache.struts.action.ActionErrors;
10 import org.apache.struts.action.ActionMapping;
11 import org.apache.struts.validator.ValidatorForm;
12
13 import com.dotmarketing.util.Logger;
14 import com.liferay.portal.util.Constants;
15
16 public class BannerForm extends ValidatorForm {
17
18     private String JavaDoc[] categories;
19
20     /** identifier field */
21     private long inode;
22
23     /** identifier field */
24     private long parent;
25
26     /** nullable persistent field */
27     private String JavaDoc title;
28
29     /** nullable persistent field */
30     private String JavaDoc caption;
31     
32     /** nullable persistent field */
33     private String JavaDoc imageFile;
34
35     /** nullable persistent field */
36     private int imageWidth;
37
38     /** nullable persistent field */
39     private int imageHeight;
40
41     /** nullable persistent field */
42     private String JavaDoc altText;
43
44     /** nullable persistent field */
45     private boolean newWindow;
46
47     /** nullable persistent field */
48     private String JavaDoc link;
49
50     /** nullable persistent field */
51     private java.util.Date JavaDoc startDate;
52
53     /** nullable persistent field */
54     private java.util.Date JavaDoc endDate;
55
56     /** nullable persistent field */
57     private String JavaDoc webStartDate;
58
59     /** nullable persistent field */
60     private String JavaDoc webEndDate;
61     
62     /** nullable persistent field */
63     private String JavaDoc body;
64
65     /** nullable persistent field */
66     private boolean active;
67
68     /** nullable persistent field */
69     private String JavaDoc selectedimage;
70
71     /** nullable persistent field */
72     private String JavaDoc imageExtension;
73
74     /** nullable persistent field */
75     private long image;
76
77     /** nullable persistent field */
78     private String JavaDoc selectedparent;
79
80     /** nullable persistent field */
81     private String JavaDoc selectedparentPath;
82
83     /** nullable persistent field */
84     private long htmlpage;
85
86     /** nullable persistent field */
87     private String JavaDoc selectedhtmlpage;
88     
89     /** default constructor */
90     public BannerForm() {
91     }
92
93     public long getInode() {
94         return this.inode;
95     }
96
97     public void setInode(long inode) {
98         this.inode = inode;
99     }
100     public java.lang.String JavaDoc getTitle() {
101         return this.title;
102     }
103
104     public void setTitle(java.lang.String JavaDoc title) {
105         this.title = title;
106     }
107     public java.lang.String JavaDoc getImageFile() {
108         return this.imageFile;
109     }
110
111     public void setImageFile(java.lang.String JavaDoc imageFile) {
112         this.imageFile = imageFile;
113     }
114     public int getImageWidth() {
115         return this.imageWidth;
116     }
117
118     public void setImageWidth(int imageWidth) {
119         this.imageWidth = imageWidth;
120     }
121     public int getImageHeight() {
122         return this.imageHeight;
123     }
124
125     public void setImageHeight(int imageHeight) {
126         this.imageHeight = imageHeight;
127     }
128     public java.lang.String JavaDoc getAltText() {
129         return this.altText;
130     }
131
132     public void setAltText(java.lang.String JavaDoc altText) {
133         this.altText = altText;
134     }
135     public java.lang.String JavaDoc getLink() {
136         return this.link;
137     }
138
139     public void setLink(java.lang.String JavaDoc link) {
140         this.link = link;
141     }
142     public java.util.Date JavaDoc getStartDate() {
143         return this.startDate;
144     }
145
146     public void setStartDate(java.util.Date JavaDoc startDate) {
147         this.startDate = startDate;
148     }
149     public java.util.Date JavaDoc getEndDate() {
150         return this.endDate;
151     }
152
153     public void setEndDate(java.util.Date JavaDoc endDate) {
154         this.endDate = endDate;
155     }
156     public java.lang.String JavaDoc getBody() {
157         return this.body;
158     }
159
160     public void setBody(java.lang.String JavaDoc body) {
161         this.body = body;
162     }
163     /*public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
164         if ("save".equals(dispatch)) {
165             return super.validate(mapping, request);
166         }
167
168         return null;
169     }*/

170     /**
171      * Returns the webEndDate.
172      * @return String
173      */

174     public String JavaDoc getWebEndDate() {
175         return webEndDate;
176     }
177
178     /**
179      * Returns the webStartDate.
180      * @return String
181      */

182     public String JavaDoc getWebStartDate() {
183         return webStartDate;
184     }
185
186     /**
187      * Sets the webEndDate.
188      * @param webEndDate The webEndDate to set
189      */

190     public void setWebEndDate(String JavaDoc webEndDate) {
191         this.webEndDate = webEndDate;
192         try {
193             this.endDate = new SimpleDateFormat JavaDoc("MM/dd/yyyy").parse(webEndDate);
194         } catch(ParseException JavaDoc ex) {
195         }
196     }
197
198     /**
199      * Sets the webStartDate.
200      * @param webStartDate The webStartDate to set
201      */

202     public void setWebStartDate(String JavaDoc webStartDate) {
203         this.webStartDate = webStartDate;
204         try {
205             this.startDate = new SimpleDateFormat JavaDoc("MM/dd/yyyy").parse(webStartDate);
206         } catch(ParseException JavaDoc ex) {
207         }
208     }
209
210     /**
211      * Returns the active.
212      * @return boolean
213      */

214     public boolean isActive() {
215         return active;
216     }
217
218     /**
219      * Returns the newWindow.
220      * @return boolean
221      */

222     public boolean isNewWindow() {
223         return newWindow;
224     }
225
226     /**
227      * Sets the active.
228      * @param active The active to set
229      */

230     public void setActive(boolean active) {
231         this.active = active;
232     }
233
234     /**
235      * Sets the newWindow.
236      * @param newWindow The newWindow to set
237      */

238     public void setNewWindow(boolean newWindow) {
239         this.newWindow = newWindow;
240     }
241
242     /**
243      * Returns the categories.
244      * @return String[]
245      */

246     public String JavaDoc[] getCategories() {
247         return categories;
248     }
249
250     /**
251      * Sets the categories.
252      * @param categories The categories to set
253      */

254     public void setCategories(String JavaDoc[] categories) {
255         this.categories = categories;
256     }
257     public ActionErrors validate(ActionMapping mapping, HttpServletRequest JavaDoc request) {
258         if(request.getParameter("cmd")!=null && request.getParameter("cmd").equals(Constants.ADD)) {
259             Logger.debug(this, "Banner validation!!!!!!" + mapping.getForward());
260             return super.validate(mapping, request);
261         }
262         return null;
263     }
264     /**
265      * Returns the caption.
266      * @return String
267      */

268     public String JavaDoc getCaption() {
269         return caption;
270     }
271
272     /**
273      * Sets the caption.
274      * @param caption The caption to set
275      */

276     public void setCaption(String JavaDoc caption) {
277         this.caption = caption;
278     }
279     
280     
281     
282     
283     /**
284      * @return Returns the image.
285      */

286     public long getImage() {
287         return image;
288     }
289     /**
290      * @param image The image to set.
291      */

292     public void setImage(long image) {
293         this.image = image;
294     }
295     /**
296      * @return Returns the selectedimage.
297      */

298     public String JavaDoc getSelectedimage() {
299         return selectedimage;
300     }
301     /**
302      * @param selectedimage The selectedimage to set.
303      */

304     public void setSelectedimage(String JavaDoc selectedimage) {
305         this.selectedimage = selectedimage;
306     }
307     
308     
309     /**
310      * @return Returns the imageExtension.
311      */

312     public String JavaDoc getImageExtension() {
313         return imageExtension;
314     }
315     /**
316      * @param imageExtension The imageExtension to set.
317      */

318     public void setImageExtension(String JavaDoc imageExtension) {
319         this.imageExtension = imageExtension;
320     }
321     
322     /**
323      * @return Returns the parent.
324      */

325     public long getParent() {
326         return parent;
327     }
328     /**
329      * @param parent The parent to set.
330      */

331     public void setParent(long parent) {
332         this.parent = parent;
333     }
334     /**
335      * @return Returns the selectedparent.
336      */

337     public String JavaDoc getSelectedparent() {
338         return selectedparent;
339     }
340     /**
341      * @param selectedparent The selectedparent to set.
342      */

343     public void setSelectedparent(String JavaDoc selectedparent) {
344         this.selectedparent = selectedparent;
345     }
346     /**
347      * @return Returns the selectedparentPath.
348      */

349     public String JavaDoc getSelectedparentPath() {
350         return selectedparentPath;
351     }
352     /**
353      * @param selectedparentPath The selectedparentPath to set.
354      */

355     public void setSelectedparentPath(String JavaDoc selectedparentPath) {
356         this.selectedparentPath = selectedparentPath;
357     }
358     
359     /**
360      * @return Returns the htmlpage.
361      */

362     public long getHtmlpage() {
363         return htmlpage;
364     }
365     /**
366      * @param htmlpage The htmlpage to set.
367      */

368     public void setHtmlpage(long htmlpage) {
369         this.htmlpage = htmlpage;
370     }
371     /**
372      * @return Returns the selectedhtmlpage.
373      */

374     public String JavaDoc getSelectedhtmlpage() {
375         return selectedhtmlpage;
376     }
377     /**
378      * @param selectedhtmlpage The selectedhtmlpage to set.
379      */

380     public void setSelectedhtmlpage(String JavaDoc selectedhtmlpage) {
381         this.selectedhtmlpage = selectedhtmlpage;
382     }
383 }
384
Popular Tags