001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. The ASF licenses this file to You
004: * under the Apache License, Version 2.0 (the "License"); you may not
005: * use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License. For additional information regarding
015: * copyright in this work, please see the NOTICE file in the top level
016: * directory of this distribution.
017: */
018: /*
019: * Created on Feb 3, 2006
020: */
021: package org.apache.roller.ui.authoring.struts.formbeans;
022:
023: import java.text.DateFormat;
024: import java.util.Calendar;
025: import java.util.Date;
026:
027: import javax.servlet.ServletRequest;
028:
029: import org.apache.struts.action.ActionMapping;
030:
031: /**
032: * Form allows user to set Weblog Entry query and export parameters.
033: *
034: * @struts.form name="weblogEntryManagementForm"
035: * @author Dave Johnson
036: */
037: public class WeblogEntryManagementForm extends
038: org.apache.struts.action.ActionForm implements
039: java.io.Serializable {
040: private String mEndDateString;
041: private String mStartDateString;
042: private String mFileBy = "month";
043: private String mExportFormat = "rss";
044: private String mCategoryId = null;
045: private String mTags = "";
046: private String mStatus = "ALL";
047: private String mSortby = "updateTime";
048:
049: /** max entries displayed per page */
050: private int count = 30;
051:
052: /** offset into current query results */
053: private int offset = 0;
054:
055: // TODO : Implement option for RSS2 or Atom
056:
057: public void reset(ActionMapping mapping, ServletRequest request) {
058: // reset time fields to current time
059: Calendar cal = Calendar.getInstance(request.getLocale());
060: Date now = new Date();
061: cal.setTime(now);
062:
063: DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT,
064: request.getLocale());
065: mEndDateString = df.format(now);
066:
067: cal.set(Calendar.DAY_OF_MONTH, 1);
068: mStartDateString = df.format(cal.getTime());
069:
070: mTags = "";
071: }
072:
073: /**
074: * @return Returns the mStartDateString.
075: */
076: public String getStartDateString() {
077: return this .mStartDateString;
078: }
079:
080: /**
081: * @param startDateString The mStartDateString to set.
082: */
083: public void setStartDateString(String startDateString) {
084: this .mStartDateString = startDateString;
085: }
086:
087: /**
088: * @return Returns the mDateString.
089: */
090: public String getEndDateString() {
091: return this .mEndDateString;
092: }
093:
094: /**
095: * @param dateString The mDateString to set.
096: */
097: public void setEndDateString(String dateString) {
098: this .mEndDateString = dateString;
099: }
100:
101: /**
102: * @return Returns the mFileBy.
103: */
104: public String getFileBy() {
105: return this .mFileBy;
106: }
107:
108: /**
109: * @param fileBy The mFileBy to set.
110: */
111: public void setFileBy(String fileBy) {
112: this .mFileBy = fileBy;
113: }
114:
115: /**
116: * @return Returns the mExportFormat.
117: */
118: public String getExportFormat() {
119: return this .mExportFormat;
120: }
121:
122: /**
123: * @param exportFormat The mExportFormat to set.
124: */
125: public void setExportFormat(String exportFormat) {
126: this .mExportFormat = exportFormat;
127: }
128:
129: /**
130: * @return Returns the category.
131: */
132: public String getCategoryId() {
133: return mCategoryId;
134: }
135:
136: /**
137: * @param category The category to set.
138: */
139: public void setCategoryId(String category) {
140: mCategoryId = category;
141: }
142:
143: /**
144: * @return Returns the status.
145: */
146: public String getStatus() {
147: return mStatus;
148: }
149:
150: /**
151: * @param status The status to set.
152: */
153: public void setStatus(String status) {
154: mStatus = status;
155: }
156:
157: public int getCount() {
158: return count;
159: }
160:
161: public void setCount(int count) {
162: this .count = count;
163: }
164:
165: public int getOffset() {
166: return offset;
167: }
168:
169: public void setOffset(int offset) {
170: this .offset = offset;
171: }
172:
173: public String getSortby() {
174: return mSortby;
175: }
176:
177: public void setSortby(String sortby) {
178: mSortby = sortby;
179: }
180:
181: public String getTags() {
182: return mTags;
183: }
184:
185: public void setTags(String tags) {
186: mTags = tags;
187: }
188:
189: }
|