KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > roller > ui > authoring > struts > formbeans > WeblogEntryManagementForm


1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. The ASF licenses this file to You
4 * under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License. For additional information regarding
15 * copyright in this work, please see the NOTICE file in the top level
16 * directory of this distribution.
17 */

18 /*
19  * Created on Feb 3, 2006
20  */

21 package org.apache.roller.ui.authoring.struts.formbeans;
22
23 import java.text.DateFormat JavaDoc;
24 import java.util.Calendar JavaDoc;
25 import java.util.Date JavaDoc;
26
27 import javax.servlet.ServletRequest JavaDoc;
28
29 import org.apache.struts.action.ActionMapping;
30
31 /**
32  * Form allows user to set Weblog Entry query and export parameters.
33  *
34  * @struts.form name="weblogEntryManagementForm"
35  * @author Dave Johnson
36  */

37 public class WeblogEntryManagementForm
38     extends org.apache.struts.action.ActionForm
39     implements java.io.Serializable JavaDoc
40 {
41     private String JavaDoc mEndDateString;
42     private String JavaDoc mStartDateString;
43     private String JavaDoc mFileBy = "month";
44     private String JavaDoc mExportFormat = "rss";
45     private String JavaDoc mCategoryId = null;
46     private String JavaDoc mStatus = "ALL";
47     private String JavaDoc mSortby = "updateTime";
48     
49     /** max entries displayed per page */
50     private int count = 30;
51     
52      /** offset into current query results */
53     private int offset = 0;
54     
55     // TODO : Implement option for RSS2 or Atom
56

57     public void reset( ActionMapping mapping, ServletRequest JavaDoc request)
58     {
59         // reset time fields to current time
60
Calendar JavaDoc cal = Calendar.getInstance(request.getLocale());
61         Date JavaDoc now = new Date JavaDoc();
62         cal.setTime(now);
63     
64         DateFormat JavaDoc df = DateFormat.getDateInstance(DateFormat.SHORT, request.getLocale());
65         mEndDateString = df.format( now );
66         
67         cal.set(Calendar.DAY_OF_MONTH, 1);
68         mStartDateString = df.format( cal.getTime() );
69     }
70     
71     /**
72      * @return Returns the mStartDateString.
73      */

74     public String JavaDoc getStartDateString()
75     {
76         return this.mStartDateString;
77     }
78     /**
79      * @param startDateString The mStartDateString to set.
80      */

81     public void setStartDateString(String JavaDoc startDateString)
82     {
83         this.mStartDateString = startDateString;
84     }
85     
86     /**
87      * @return Returns the mDateString.
88      */

89     public String JavaDoc getEndDateString()
90     {
91         return this.mEndDateString;
92     }
93     
94     /**
95      * @param dateString The mDateString to set.
96      */

97     public void setEndDateString(String JavaDoc dateString)
98     {
99         this.mEndDateString = dateString;
100     }
101     
102     /**
103      * @return Returns the mFileBy.
104      */

105     public String JavaDoc getFileBy()
106     {
107         return this.mFileBy;
108     }
109     
110     /**
111      * @param fileBy The mFileBy to set.
112      */

113     public void setFileBy(String JavaDoc fileBy)
114     {
115         this.mFileBy = fileBy;
116     }
117     
118     /**
119      * @return Returns the mExportFormat.
120      */

121     public String JavaDoc getExportFormat()
122     {
123         return this.mExportFormat;
124     }
125     
126     /**
127      * @param exportFormat The mExportFormat to set.
128      */

129     public void setExportFormat(String JavaDoc exportFormat)
130     {
131         this.mExportFormat = exportFormat;
132     }
133     /**
134      * @return Returns the category.
135      */

136     public String JavaDoc getCategoryId()
137     {
138         return mCategoryId;
139     }
140     /**
141      * @param category The category to set.
142      */

143     public void setCategoryId(String JavaDoc category)
144     {
145         mCategoryId = category;
146     }
147     /**
148      * @return Returns the status.
149      */

150     public String JavaDoc getStatus()
151     {
152         return mStatus;
153     }
154     /**
155      * @param status The status to set.
156      */

157     public void setStatus(String JavaDoc status)
158     {
159         mStatus = status;
160     }
161
162     public int getCount() {
163         return count;
164     }
165
166     public void setCount(int count) {
167         this.count = count;
168     }
169
170     public int getOffset() {
171         return offset;
172     }
173
174     public void setOffset(int offset) {
175         this.offset = offset;
176     }
177     
178     public String JavaDoc getSortby() {
179         return mSortby;
180     }
181     
182     public void setSortby(String JavaDoc sortby) {
183         mSortby = sortby;
184     }
185 }
186
Popular Tags