001: /**********************************************************************************
002: * $URL:https://source.sakaiproject.org/svn/osp/trunk/reports/api/src/java/org/theospi/portfolio/reports/model/ReportXsl.java $
003: * $Id:ReportXsl.java 9134 2006-05-08 20:28:42Z chmaurer@iupui.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.theospi.portfolio.reports.model;
021:
022: import org.sakaiproject.metaobj.shared.model.Id;
023: import org.springframework.context.ResourceLoaderAware;
024: import org.springframework.core.io.Resource;
025: import org.springframework.core.io.ResourceLoader;
026:
027: import java.util.List;
028: import java.util.Iterator;
029:
030: public class ReportXsl implements ResourceLoaderAware {
031:
032: /** The primary key */
033: private Id reportXslId = null;
034:
035: /** the link to the report definition */
036: private ReportDefinition reportDefinition = null;
037:
038: /** whether or not this xsl is for export or view */
039: private boolean isExport = false;
040:
041: /** the xsl location */
042: private String xslLink;
043:
044: /** the title */
045: private String title;
046:
047: /** the contentType */
048: private String contentType;
049:
050: /** the extension */
051: private String extension;
052:
053: private ResultsPostProcessor resultsPostProcessor;
054:
055: private String target = "_blank";
056:
057: private Resource resource;
058:
059: /**
060: * the getter for the reportId property
061: */
062: public ReportXsl() {
063:
064: }
065:
066: public Id getReportXslId() {
067: return reportXslId;
068: }
069:
070: public void setReportXslId(Id reportXslId) {
071: this .reportXslId = reportXslId;
072: }
073:
074: /**
075: * the getter for the reportDefinition property
076: * @return ReportDefinition the unique identifier
077: */
078: public ReportDefinition getReportDefinition() {
079: return reportDefinition;
080: }
081:
082: /**
083: * the setter for the reportDefinition property. This is set by the bean
084: * and by hibernate.
085: * @param reportDefinition String
086: */
087: public void setReportDefinition(ReportDefinition reportDefinition) {
088: this .reportDefinition = reportDefinition;
089: }
090:
091: /**
092: * the getter for the isExport property
093: * @return boolean the isExport
094: */
095: public boolean getIsExport() {
096: return isExport;
097: }
098:
099: /**
100: * the setter for the isExport property. This is set by the bean
101: * and by hibernate.
102: * @param isExport boolean
103: */
104: public void setIsExport(boolean isExport) {
105: this .isExport = isExport;
106: }
107:
108: /**
109: * the getter for the xslLink property
110: * @return String the xslLink
111: */
112: public String getXslLink() {
113: return xslLink;
114: }
115:
116: /**
117: * the setter for the xslLink property. This is set by the bean
118: * and by hibernate.
119: * @param xslLink String
120: */
121: public void setXslLink(String xslLink) {
122: this .xslLink = xslLink;
123: }
124:
125: /**
126: * the getter for the title property
127: * @return String the title
128: */
129: public String getTitle() {
130: return title;
131: }
132:
133: /**
134: * the setter for the title property. This is set by the bean
135: * and by hibernate.
136: * @param title String
137: */
138: public void setTitle(String title) {
139: this .title = title;
140: }
141:
142: /**
143: * the getter for the contentType property
144: * @return String the contentType
145: */
146: public String getContentType() {
147: return contentType;
148: }
149:
150: /**
151: * the setter for the contentType property. This is set by the bean
152: * and by hibernate.
153: * @param contentType String
154: */
155: public void setContentType(String contentType) {
156: this .contentType = contentType;
157: }
158:
159: /**
160: * the getter for the extension property
161: * @return String the extension
162: */
163: public String getExtension() {
164: return extension;
165: }
166:
167: /**
168: * the setter for the extension property. This is set by the bean
169: * and by hibernate.
170: * @param extension String
171: */
172: public void setExtension(String extension) {
173: this .extension = extension;
174: }
175:
176: public ResultsPostProcessor getResultsPostProcessor() {
177: return resultsPostProcessor;
178: }
179:
180: public void setResultsPostProcessor(
181: ResultsPostProcessor resultsPostProcessor) {
182: this .resultsPostProcessor = resultsPostProcessor;
183: }
184:
185: /** return the singleton's object id, this will be unique and permanent until the next restart **/
186: public String getRuntimeId() {
187: return this .toString().hashCode() + "";
188: }
189:
190: public String getTarget() {
191: return target;
192: }
193:
194: public void setTarget(String target) {
195: this .target = target;
196: }
197:
198: public Resource getResource() {
199: return resource;
200: }
201:
202: public void setResource(Resource resource) {
203: this .resource = resource;
204: }
205:
206: public void setResourceLoader(ResourceLoader resourceLoader) {
207: setResource(resourceLoader.getResource(getXslLink()));
208: }
209:
210: }
|