001: /*
002: * Copyright (C) 2006 Erik Swenson - erik@oreports.com
003: *
004: * This program is free software; you can redistribute it and/or modify it
005: * under the terms of the GNU General Public License as published by the Free
006: * Software Foundation; either version 2 of the License, or (at your option)
007: * any later version.
008: *
009: * This program is distributed in the hope that it will be useful, but WITHOUT
010: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
011: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
012: * more details.
013: *
014: * You should have received a copy of the GNU General Public License along with
015: * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
016: * Place - Suite 330, Boston, MA 02111-1307, USA.
017: *
018: */
019:
020: package org.efs.openreports.services.input;
021:
022: import java.io.Serializable;
023: import java.util.Date;
024:
025: import org.efs.openreports.ReportConstants;
026: import org.efs.openreports.ReportConstants.DeliveryMethod;
027: import org.efs.openreports.ReportConstants.ExportType;
028: import org.efs.openreports.ReportConstants.ScheduleAmPm;
029: import org.efs.openreports.ReportConstants.ScheduleType;
030:
031: /**
032: * ReportService input object contains information used to identify the user, report,
033: * delivery method, and export type of the request along with optional xml input,
034: * parameter and scheduling information.
035: *
036: * @author Erik Swenson
037: * @see ReportConstants
038: */
039:
040: public class ReportServiceInput implements Serializable {
041: private static final long serialVersionUID = -3094443722330870862L;
042:
043: /** unique id of request */
044: private String requestId;
045:
046: /** identifies the user making the request */
047: private UserInput user;
048:
049: /** name of report */
050: private String reportName;
051:
052: /** exportType for the report. defaults to PDF */
053: private ExportType exportType = ExportType.PDF;
054:
055: /** list of delivery methods for the report */
056: private DeliveryMethod[] deliveryMethods;
057:
058: /** delivery address for report */
059: private String deliveryAddress;
060:
061: /** return or bounce address for the report */
062: private String deliveryReturnAddress;
063:
064: /** parameters passed to the report */
065: private ParameterInput[] parameters;
066:
067: /** xml data for report generation */
068: private String xmlInput;
069:
070: /** start date for scheduled report */
071: private Date startDate;
072:
073: /** start hour for scheduled report */
074: private String startHour;
075:
076: /** start minute for scheduled report */
077: private String startMinute;
078:
079: /** am/pm indicator for scheduled report */
080: private ScheduleAmPm startAmPm;
081:
082: /** schedule type (once, daily, weekly, etc.). defaulted to once */
083: private ScheduleType scheduleType = ScheduleType.ONCE;
084:
085: /** sets priority of scheduled report. defaulted to five */
086: private int schedulePriority = 5;
087:
088: /** description of scheduled report */
089: private String scheduleDescription;
090:
091: /** number of hours to run hourly schedule report */
092: private int hours;
093:
094: /** cron expression for cron schedule report */
095: private String cronExpression;
096:
097: /** locale for the report in standard format, for example: "en_US" */
098: private String locale;
099:
100: public String getRequestId() {
101: return requestId;
102: }
103:
104: public void setRequestId(String requestId) {
105: this .requestId = requestId;
106: }
107:
108: public UserInput getUser() {
109: return user;
110: }
111:
112: public void setUser(UserInput user) {
113: this .user = user;
114: }
115:
116: public DeliveryMethod[] getDeliveryMethods() {
117: return deliveryMethods;
118: }
119:
120: public void setDeliveryMethods(DeliveryMethod... deliveryMethods) {
121: this .deliveryMethods = deliveryMethods;
122: }
123:
124: public boolean isDeliveryMethodSelected(String deliveryMethod) {
125: if (deliveryMethods == null)
126: return false;
127:
128: for (int i = 0; i < deliveryMethods.length; i++) {
129: if (deliveryMethods[i].equals(deliveryMethod))
130: return true;
131: }
132:
133: return false;
134: }
135:
136: public ExportType getExportType() {
137: return exportType;
138: }
139:
140: public void setExportType(ExportType exportType) {
141: this .exportType = exportType;
142: }
143:
144: public ParameterInput[] getParameters() {
145: return parameters;
146: }
147:
148: public void setParameters(ParameterInput... parameters) {
149: this .parameters = parameters;
150: }
151:
152: public String getReportName() {
153: return reportName;
154: }
155:
156: public void setReportName(String reportName) {
157: this .reportName = reportName;
158: }
159:
160: public ScheduleType getScheduleType() {
161: return scheduleType;
162: }
163:
164: public void setScheduleType(ScheduleType scheduleType) {
165: this .scheduleType = scheduleType;
166: }
167:
168: public ScheduleAmPm getStartAmPm() {
169: return startAmPm;
170: }
171:
172: public void setStartAmPm(ScheduleAmPm startAmPm) {
173: this .startAmPm = startAmPm;
174: }
175:
176: public Date getStartDate() {
177: return startDate;
178: }
179:
180: public void setStartDate(Date startDate) {
181: this .startDate = startDate;
182: }
183:
184: public String getStartHour() {
185: return startHour;
186: }
187:
188: public void setStartHour(String startHour) {
189: this .startHour = startHour;
190: }
191:
192: public String getStartMinute() {
193: return startMinute;
194: }
195:
196: public void setStartMinute(String startMinute) {
197: this .startMinute = startMinute;
198: }
199:
200: public String getScheduleDescription() {
201: return scheduleDescription;
202: }
203:
204: public void setScheduleDescription(String scheduleDescription) {
205: this .scheduleDescription = scheduleDescription;
206: }
207:
208: public String getCronExpression() {
209: return cronExpression;
210: }
211:
212: public void setCronExpression(String cronExpression) {
213: this .cronExpression = cronExpression;
214: }
215:
216: public int getHours() {
217: return hours;
218: }
219:
220: public void setHours(int hours) {
221: this .hours = hours;
222: }
223:
224: public String getXmlInput() {
225: return xmlInput;
226: }
227:
228: public void setXmlInput(String xmlInput) {
229: this .xmlInput = xmlInput;
230: }
231:
232: public String getDeliveryAddress() {
233: return deliveryAddress;
234: }
235:
236: public void setDeliveryAddress(String deliveryAddress) {
237: this .deliveryAddress = deliveryAddress;
238: }
239:
240: public String getDeliveryReturnAddress() {
241: return deliveryReturnAddress;
242: }
243:
244: public void setDeliveryReturnAddress(String deliveryReturnAddress) {
245: this .deliveryReturnAddress = deliveryReturnAddress;
246: }
247:
248: public int getSchedulePriority() {
249: return schedulePriority;
250: }
251:
252: public void setSchedulePriority(int schedulePriority) {
253: this .schedulePriority = schedulePriority;
254: }
255:
256: public String getLocale() {
257: return locale;
258: }
259:
260: public void setLocale(String locale) {
261: this.locale = locale;
262: }
263: }
|