1 4 package org.roller.presentation.weblog.formbeans; 5 6 import org.apache.struts.action.ActionMapping; 7 8 import java.text.DateFormat ; 9 import java.util.Calendar ; 10 import java.util.Date ; 11 12 import javax.servlet.ServletRequest ; 13 14 20 public class WeblogQueryForm 21 extends org.apache.struts.action.ActionForm 22 implements java.io.Serializable 23 { 24 private String mEndDateString; 25 private String mStartDateString; 26 private String mFileBy = "month"; 27 private String mExportFormat = "rss"; 28 private String mCategoryId = null; 29 private Integer mMaxEntries = new Integer (20); 30 private String mStatus = "ALL"; 31 32 34 public void reset( ActionMapping mapping, ServletRequest request) 35 { 36 Calendar cal = Calendar.getInstance(request.getLocale()); 38 Date now = new Date (); 39 cal.setTime(now); 40 41 DateFormat 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 51 public String getStartDateString() 52 { 53 return this.mStartDateString; 54 } 55 58 public void setStartDateString(String startDateString) 59 { 60 this.mStartDateString = startDateString; 61 } 62 63 66 public String getEndDateString() 67 { 68 return this.mEndDateString; 69 } 70 71 74 public void setEndDateString(String dateString) 75 { 76 this.mEndDateString = dateString; 77 } 78 79 82 public String getFileBy() 83 { 84 return this.mFileBy; 85 } 86 87 90 public void setFileBy(String fileBy) 91 { 92 this.mFileBy = fileBy; 93 } 94 95 98 public String getExportFormat() 99 { 100 return this.mExportFormat; 101 } 102 103 106 public void setExportFormat(String exportFormat) 107 { 108 this.mExportFormat = exportFormat; 109 } 110 113 public String getCategoryId() 114 { 115 return mCategoryId; 116 } 117 120 public void setCategoryId(String category) 121 { 122 mCategoryId = category; 123 } 124 127 public Integer getMaxEntries() 128 { 129 return mMaxEntries; 130 } 131 134 public void setMaxEntries(Integer maxEntries) 135 { 136 mMaxEntries = maxEntries; 137 } 138 141 public String getStatus() 142 { 143 return mStatus; 144 } 145 148 public void setStatus(String status) 149 { 150 mStatus = status; 151 } 152 } 153 | Popular Tags |