KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > roller > presentation > website > formbeans > WebsiteFormEx


1 /*
2  * Created on Feb 14, 2004
3  */

4 package org.roller.presentation.website.formbeans;
5
6 import org.apache.commons.lang.StringUtils;
7 import org.roller.RollerException;
8 import org.roller.pojos.WebsiteData;
9 import org.roller.presentation.forms.WebsiteForm;
10
11 /**
12  * @struts.form name="websiteFormEx"
13  */

14 public class WebsiteFormEx extends WebsiteForm
15 {
16     private String JavaDoc bloggerCategoryId;
17     private String JavaDoc defaultCategoryId;
18     private String JavaDoc[] defaultPluginsArray;
19     
20     /**
21      * @return Returns the bloggerCategoryId.
22      */

23     public String JavaDoc getBloggerCategoryId()
24     {
25         return bloggerCategoryId;
26     }
27
28     /**
29      * @param bloggerCategoryId The bloggerCategoryId to set.
30      */

31     public void setBloggerCategoryId(String JavaDoc bloggerCategoryId)
32     {
33         this.bloggerCategoryId = bloggerCategoryId;
34     }
35
36     /**
37      * @return Returns the defeaultCategoryId.
38      */

39     public String JavaDoc getDefaultCategoryId()
40     {
41         return defaultCategoryId;
42     }
43
44     /**
45      * @param defeaultCategoryId The defeaultCategoryId to set.
46      */

47     public void setDefaultCategoryId(String JavaDoc defeaultCategoryId)
48     {
49         this.defaultCategoryId = defeaultCategoryId;
50     }
51
52     /**
53      * @return
54      */

55     public String JavaDoc[] getDefaultPluginsArray()
56     {
57         return defaultPluginsArray;
58     }
59
60     /**
61      * @param strings
62      */

63     public void setDefaultPluginsArray(String JavaDoc[] strings)
64     {
65         defaultPluginsArray = strings;
66     }
67
68
69     /**
70      * @see org.roller.presentation.forms.WebsiteForm#copyFrom(org.roller.pojos.WebsiteData)
71      */

72     public void copyFrom(WebsiteData dataHolder, java.util.Locale JavaDoc locale) throws RollerException
73     {
74         super.copyFrom(dataHolder, locale);
75         if (dataHolder.getDefaultCategory() != null)
76         {
77             defaultCategoryId = dataHolder.getDefaultCategory().getId();
78         }
79         if (dataHolder.getBloggerCategory() != null)
80         {
81             bloggerCategoryId = dataHolder.getBloggerCategory().getId();
82         }
83         if (dataHolder.getDefaultPlugins() != null)
84         {
85             defaultPluginsArray = StringUtils.split(dataHolder.getDefaultPlugins(), ",");
86         }
87     }
88
89     /**
90      * @see org.roller.presentation.forms.WebsiteForm#copyTo(org.roller.pojos.WebsiteData)
91      */

92     public void copyTo(WebsiteData dataHolder, java.util.Locale JavaDoc locale) throws RollerException
93     {
94         super.copyTo(dataHolder, locale);
95         dataHolder.setDefaultPlugins( StringUtils.join(this.defaultPluginsArray,",") );
96     }
97     
98     public void reset(
99         org.apache.struts.action.ActionMapping mapping,
100         javax.servlet.ServletRequest JavaDoc request)
101     {
102         doReset(mapping, request);
103         defaultPluginsArray = new String JavaDoc[0];
104     }
105     
106     public void reset(
107         org.apache.struts.action.ActionMapping mapping,
108         javax.servlet.http.HttpServletRequest JavaDoc request)
109     {
110         doReset(mapping, request);
111         defaultPluginsArray = new String JavaDoc[0];
112     }
113 }
114
Popular Tags