KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jaspersoft > jasperserver > api > metadata > xml > domain > impl > ResourceDescriptor


1 /*
2  * Copyright (C) 2006 JasperSoft http://www.jaspersoft.com
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed WITHOUT ANY WARRANTY; and without the
10  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
15  * or write to:
16  *
17  * Free Software Foundation, Inc.,
18  * 59 Temple Place - Suite 330,
19  * Boston, MA USA 02111-1307
20  */

21 package com.jaspersoft.jasperserver.api.metadata.xml.domain.impl;
22
23 /**
24  * @author tkavanagh
25  * @version $Id: ResourceDescriptor.java 4307 2006-08-24 08:13:55Z giulio $
26  */

27
28 import java.util.Date JavaDoc;
29 import java.util.List JavaDoc;
30 import java.util.ArrayList JavaDoc;
31
32 public class ResourceDescriptor {
33
34     public static final String JavaDoc TYPE_FOLDER = "folder";
35     public static final String JavaDoc TYPE_REPORTUNIT = "reportUnit";
36     public static final String JavaDoc TYPE_DATASOURCE = "datasource";
37     public static final String JavaDoc TYPE_DATASOURCE_JDBC = "jdbc";
38     public static final String JavaDoc TYPE_DATASOURCE_JNDI = "jndi";
39     public static final String JavaDoc TYPE_DATASOURCE_BEAN = "bean";
40     public static final String JavaDoc TYPE_IMAGE = "img";
41     public static final String JavaDoc TYPE_FONT = "font";
42     public static final String JavaDoc TYPE_JRXML = "jrxml";
43     public static final String JavaDoc TYPE_CLASS_JAR = "jar";
44     public static final String JavaDoc TYPE_RESOURCE_BUNDLE = "prop";
45     public static final String JavaDoc TYPE_REFERENCE = "reference";
46     public static final String JavaDoc TYPE_INPUT_CONTROL = "inputControl";
47     public static final String JavaDoc TYPE_DATA_TYPE = "dataType";
48     public static final String JavaDoc TYPE_OLAP_MONDRIAN_CONNECTION = "olapMondrianCon";
49     public static final String JavaDoc TYPE_OLAP_XMLA_CONNECTION = "olapXmlaCon";
50     public static final String JavaDoc TYPE_MONDRIAN_SCHEMA = "olapMondrianSchema";
51     public static final String JavaDoc TYPE_XMLA_CONNTCTION = "xmlaConntction";
52     public static final String JavaDoc TYPE_UNKNOW = "unknow";
53     public static final String JavaDoc TYPE_LOV = "lov"; // List of values...
54
public static final String JavaDoc TYPE_QUERY = "query"; // List of values...
55

56     
57     /**
58      * These constants are copied here from DataType for facility
59      */

60     public static final byte DT_TYPE_TEXT = 1;
61     public static final byte DT_TYPE_NUMBER = 2;
62     public static final byte DT_TYPE_DATE = 3;
63     public static final byte DT_TYPE_DATE_TIME = 4;
64     
65     /**
66      * These constants are copied here from InputControl for facility
67      */

68     public static final byte IC_TYPE_BOOLEAN = 1;
69     public static final byte IC_TYPE_SINGLE_VALUE = 2;
70     public static final byte IC_TYPE_SINGLE_SELECT_LIST_OF_VALUES = 3;
71     public static final byte IC_TYPE_SINGLE_SELECT_QUERY = 4;
72     public static final byte IC_TYPE_MULTI_VALUE = 5;
73     public static final byte IC_TYPE_MULTI_SELECT_LIST_OF_VALUES = 6;
74     public static final byte IC_TYPE_MULTI_SELECT_QUERY = 7;
75     
76     // the following come
77
// from Resource interface
78
private String JavaDoc wsType; // this it object/xml type
79
private String JavaDoc uriString;
80     private String JavaDoc name;
81     private String JavaDoc label;
82     private String JavaDoc description;
83     private int version;
84     private String JavaDoc parentFolder;
85     private String JavaDoc resourceType; // this is package and classname
86
private boolean isNew;
87     private Date JavaDoc creationDate;
88     
89     // The following come from
90
// the FileResource interface
91
//private String fileType; // Already have this from wsType - use wsType instead
92
private boolean hasData;
93     private boolean isReference;
94     private String JavaDoc referenceUri;
95     
96     // The following from from the
97
// JdbcReportDataSource interface
98
private String JavaDoc driverClass;
99     private String JavaDoc connectionUrl;
100     private String JavaDoc username;
101     private String JavaDoc password;
102     
103     // The following come from the
104
// JndiJdbcReportDataSource interface
105
private String JavaDoc jndiName;
106         
107         // The following come from the
108
// BeanReportDataSource interface
109
private String JavaDoc beanName;
110     private String JavaDoc beanMethod;
111
112     // The following come from the
113
// ReportUnit interface
114
private String JavaDoc dataSourceType; // this is a cheat to tell us the datasource type (ws only)
115
private boolean isMainReport;
116     
117         
118         // The following come from
119
// the DataTypeResource interface
120
private boolean strictMax;
121         private boolean strictMin;
122     private String JavaDoc minValue;
123     private String JavaDoc maxValue;
124         private String JavaDoc pattern;
125         private byte dataType;
126         
127         // The following come from
128
// the ListOfValuesResource interface
129
// the array contains a set Items
130
private List JavaDoc listOfValues = new ArrayList JavaDoc(); // list of values
131

132         
133         // The following come from
134
// the InputControl interface
135
// As children, an InputControl descriptor can have
136
// the descriptor for a DataType, for a ListOfValues or a Query....
137
private byte controlType;
138     private boolean mandatory = false;
139     private boolean readOnly = false;
140         
141     private List JavaDoc children = new ArrayList JavaDoc(); // list of ResourceDescriptors
142

143
144         // The following come from
145
// the InputControl interface
146
// As children, an InputControl descriptor can have
147
// the descriptor for a DataType, for a ListOfValues or a Query....
148
private String JavaDoc sql;
149         private String JavaDoc[] queryVisibleColumns;
150         private String JavaDoc queryValueColumn;
151         
152         // queryRows is used to store data get using a special get...
153
private java.util.List JavaDoc queryData;
154         
155     // This bean class currently has all data completely
156
// flattened out. This means that when this object is
157
// "filled in", only the fields that are relevent to
158
// the "wsType" it represents should be filled in.
159

160     public String JavaDoc getWsType() {
161         return wsType;
162     }
163     
164     public void setWsType(String JavaDoc wsType) {
165         this.wsType = wsType;
166     }
167     
168     public String JavaDoc getUriString() {
169         return uriString;
170     }
171     
172     public void setUriString(String JavaDoc uriString) {
173         this.uriString = uriString;
174     }
175     
176     public String JavaDoc getName() {
177         return name;
178     }
179
180     public void setName(String JavaDoc name) {
181         this.name = name;
182     }
183
184     public String JavaDoc getLabel() {
185         return label;
186     }
187
188     public void setLabel(String JavaDoc label) {
189         this.label = label;
190     }
191
192     public String JavaDoc getDescription() {
193         return description;
194     }
195
196     public void setDescription(String JavaDoc description) {
197         this.description = description;
198     }
199
200     public int getVersion() {
201         return version;
202     }
203     
204     public void setVersion(int version) {
205         this.version = version;
206     }
207
208     // this is a uri string (like uriString member)
209
public String JavaDoc getParentFolder() {
210         return parentFolder;
211     }
212
213     public void setParentFolder(String JavaDoc parentFolder) {
214         this.parentFolder = parentFolder;
215     }
216
217     public String JavaDoc getResourceType() {
218         return resourceType;
219     }
220     
221     public void setResourceType(String JavaDoc resourceType) {
222         this.resourceType = resourceType;
223     }
224     
225     public boolean getIsNew() {
226         return isNew;
227     }
228     
229     public void setIsNew(boolean isNew) {
230         this.isNew = isNew;
231     }
232     
233     public Date JavaDoc getCreationDate() {
234         return creationDate;
235     }
236     
237     public void setCreationDate(Date JavaDoc creationDate) {
238         this.creationDate = creationDate;
239     }
240
241     /*
242     // Already have this from wsType - so don't use
243     public String getFileType() {
244         return fileType;
245     }
246     
247     public void setFileType(String fileType) {
248         this.fileType = fileType;
249     }
250     */

251     
252     public boolean getHasData() {
253         return hasData;
254     }
255     
256     public void setHasData(boolean hasData) {
257         this.hasData = hasData;
258     }
259     
260     public boolean getIsReference() {
261         return isReference;
262     }
263     
264     public void setIsReference(boolean isReference) {
265         this.isReference = isReference;
266     }
267     
268     public String JavaDoc getReferenceUri() {
269         return referenceUri;
270     }
271     
272     public void setReferenceUri(String JavaDoc referenceUri) {
273         this.referenceUri = referenceUri;
274     }
275     
276     public String JavaDoc getDriverClass() {
277         return driverClass;
278     }
279
280     public void setDriverClass(String JavaDoc driverClass) {
281         this.driverClass = driverClass;
282     }
283     
284     public String JavaDoc getConnectionUrl() {
285         return connectionUrl;
286     }
287
288     public void setConnectionUrl(String JavaDoc connectionUrl) {
289         this.connectionUrl = connectionUrl;
290     }
291
292     public String JavaDoc getPassword() {
293         return password;
294     }
295
296     public void setPassword(String JavaDoc password) {
297         this.password = password;
298     }
299
300     public String JavaDoc getUsername() {
301         return username;
302     }
303
304     public void setUsername(String JavaDoc username) {
305         this.username = username;
306     }
307     
308     public String JavaDoc getJndiName() {
309         return jndiName;
310     }
311
312     public void setJndiName(String JavaDoc jndiName) {
313         this.jndiName = jndiName;
314     }
315
316     public String JavaDoc getDataSourceType() {
317         return dataSourceType;
318     }
319
320     public void setDataSourceType(String JavaDoc dataSourceType) {
321         this.dataSourceType = dataSourceType;
322     }
323     
324     public boolean isMainReport() {
325         return isMainReport;
326     }
327
328     public void setMainReport(boolean isMainReport) {
329         this.isMainReport = isMainReport;
330     }
331
332     public List JavaDoc getChildren() {
333         return children;
334     }
335
336     public void setChildren(List JavaDoc children) {
337         this.children = children;
338     }
339
340     public boolean isStrictMax() {
341         return strictMax;
342     }
343
344     public void setStrictMax(boolean strictMax) {
345         this.strictMax = strictMax;
346     }
347
348     public boolean isStrictMin() {
349         return strictMin;
350     }
351
352     public void setStrictMin(boolean strictMin) {
353         this.strictMin = strictMin;
354     }
355
356     public String JavaDoc getMinValue() {
357         return minValue;
358     }
359
360     public void setMinValue(String JavaDoc minValue) {
361         this.minValue = minValue;
362     }
363
364     public String JavaDoc getMaxValue() {
365         return maxValue;
366     }
367
368     public void setMaxValue(String JavaDoc maxValue) {
369         this.maxValue = maxValue;
370     }
371
372     public String JavaDoc getPattern() {
373         return pattern;
374     }
375
376     public void setPattern(String JavaDoc pattern) {
377         this.pattern = pattern;
378     }
379
380     public byte getDataType() {
381         return dataType;
382     }
383
384     public void setDataType(byte dataType) {
385         this.dataType = dataType;
386     }
387
388     public List JavaDoc getListOfValues() {
389         return listOfValues;
390     }
391
392     public void setListOfValues(List JavaDoc listOfValues) {
393         this.listOfValues = listOfValues;
394     }
395
396     public byte getControlType() {
397         return controlType;
398     }
399
400     public void setControlType(byte controlType) {
401         this.controlType = controlType;
402     }
403
404     public boolean isMandatory() {
405         return mandatory;
406     }
407
408     public void setMandatory(boolean mandatory) {
409         this.mandatory = mandatory;
410     }
411
412     public boolean isReadOnly() {
413         return readOnly;
414     }
415
416     public void setReadOnly(boolean readOnly) {
417         this.readOnly = readOnly;
418     }
419
420     public String JavaDoc getBeanName() {
421         return beanName;
422     }
423
424     public void setBeanName(String JavaDoc beanName) {
425         this.beanName = beanName;
426     }
427
428     public String JavaDoc getBeanMethod() {
429         return beanMethod;
430     }
431
432     public void setBeanMethod(String JavaDoc beanMethod) {
433         this.beanMethod = beanMethod;
434     }
435
436     public String JavaDoc getSql() {
437         return sql;
438     }
439
440     public void setSql(String JavaDoc sql) {
441         this.sql = sql;
442     }
443
444     public String JavaDoc[] getQueryVisibleColumns() {
445         return queryVisibleColumns;
446     }
447
448     public void setQueryVisibleColumns(String JavaDoc[] queryVisibleColumns) {
449         this.queryVisibleColumns = queryVisibleColumns;
450     }
451
452     public String JavaDoc getQueryValueColumn() {
453         return queryValueColumn;
454     }
455
456     public void setQueryValueColumn(String JavaDoc queryValueColumn) {
457         this.queryValueColumn = queryValueColumn;
458     }
459
460     /**
461      * Return a set of InputControlQueryDataRow
462      */

463     public java.util.List JavaDoc getQueryData() {
464         return queryData;
465     }
466
467     public void setQueryData(java.util.List JavaDoc queryData) {
468         this.queryData = queryData;
469     }
470     
471 }
472
Popular Tags