KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Created on Mar 25, 2004
3  */

4 package org.roller.presentation.weblog.formbeans;
5
6 import org.apache.struts.action.ActionMapping;
7
8 import java.text.DateFormat JavaDoc;
9 import java.util.Calendar JavaDoc;
10 import java.util.Date JavaDoc;
11
12 import javax.servlet.ServletRequest JavaDoc;
13
14 /**
15  * Form allows user to set Weblog Entry query and export parameters.
16  *
17  * @struts.form name="weblogQueryForm"
18  * @author lance.lavandowska
19  */

20 public class WeblogQueryForm
21     extends org.apache.struts.action.ActionForm
22     implements java.io.Serializable JavaDoc
23 {
24     private String JavaDoc mEndDateString;
25     private String JavaDoc mStartDateString;
26     private String JavaDoc mFileBy = "month";
27     private String JavaDoc mExportFormat = "rss";
28     private String JavaDoc mCategoryId = null;
29     private Integer JavaDoc mMaxEntries = new Integer JavaDoc(20);
30     private String JavaDoc mStatus = "ALL";
31     
32     // TODO : Implement option for RSS2 or Atom
33

34     public void reset( ActionMapping mapping, ServletRequest JavaDoc request)
35     {
36         // reset time fields to current time
37
Calendar JavaDoc cal = Calendar.getInstance(request.getLocale());
38         Date JavaDoc now = new Date JavaDoc();
39         cal.setTime(now);
40     
41         DateFormat JavaDoc df = DateFormat.getDateInstance(DateFormat.SHORT, request.getLocale());
42         mEndDateString = df.format( now );
43         
44         cal.set(Calendar.DAY_OF_MONTH, 1);
45         mStartDateString = df.format( cal.getTime() );
46     }
47     
48     /**
49      * @return Returns the mStartDateString.
50      */

51     public String JavaDoc getStartDateString()
52     {
53         return this.mStartDateString;
54     }
55     /**
56      * @param startDateString The mStartDateString to set.
57      */

58     public void setStartDateString(String JavaDoc startDateString)
59     {
60         this.mStartDateString = startDateString;
61     }
62     
63     /**
64      * @return Returns the mDateString.
65      */

66     public String JavaDoc getEndDateString()
67     {
68         return this.mEndDateString;
69     }
70     
71     /**
72      * @param dateString The mDateString to set.
73      */

74     public void setEndDateString(String JavaDoc dateString)
75     {
76         this.mEndDateString = dateString;
77     }
78     
79     /**
80      * @return Returns the mFileBy.
81      */

82     public String JavaDoc getFileBy()
83     {
84         return this.mFileBy;
85     }
86     
87     /**
88      * @param fileBy The mFileBy to set.
89      */

90     public void setFileBy(String JavaDoc fileBy)
91     {
92         this.mFileBy = fileBy;
93     }
94     
95     /**
96      * @return Returns the mExportFormat.
97      */

98     public String JavaDoc getExportFormat()
99     {
100         return this.mExportFormat;
101     }
102     
103     /**
104      * @param exportFormat The mExportFormat to set.
105      */

106     public void setExportFormat(String JavaDoc exportFormat)
107     {
108         this.mExportFormat = exportFormat;
109     }
110     /**
111      * @return Returns the category.
112      */

113     public String JavaDoc getCategoryId()
114     {
115         return mCategoryId;
116     }
117     /**
118      * @param category The category to set.
119      */

120     public void setCategoryId(String JavaDoc category)
121     {
122         mCategoryId = category;
123     }
124     /**
125      * @return Returns the maxEntries.
126      */

127     public Integer JavaDoc getMaxEntries()
128     {
129         return mMaxEntries;
130     }
131     /**
132      * @param maxEntries The maxEntries to set.
133      */

134     public void setMaxEntries(Integer JavaDoc maxEntries)
135     {
136         mMaxEntries = maxEntries;
137     }
138     /**
139      * @return Returns the status.
140      */

141     public String JavaDoc getStatus()
142     {
143         return mStatus;
144     }
145     /**
146      * @param status The status to set.
147      */

148     public void setStatus(String JavaDoc status)
149     {
150         mStatus = status;
151     }
152 }
153
Popular Tags