1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.kernel.bi.reporting;
24  
25  import java.io.Serializable;
26  
27  import java.util.HashMap;
28  import java.util.Map;
29  
30  /**
31   * <a href="ReportRequest.java.html"><b><i>View Source</i></b></a>
32   *
33   * @author Michael C. Han
34   *
35   */
36  public class ReportRequest implements Serializable {
37  
38      public ReportRequest(
39          ReportDesignRetriever reportDesignRetriever, String reportFormat,
40          String imageStorageLocation, String imagePath) {
41  
42          _reportDesignRetriever = reportDesignRetriever;
43          _reportFormat = ReportFormat.parse(reportFormat);
44          _imageStorageLocation = imageStorageLocation;
45          _imagePath = imagePath;
46          _reportParameters = new HashMap<String, String>();
47      }
48  
49      public String getAlternateDataSource() {
50          return _alternateDataSource;
51      }
52  
53      public ReportFormat getFormat() {
54          return _reportFormat;
55      }
56  
57      public String getImagePath() {
58          return _imagePath;
59      }
60  
61      public String getImageStorageLocation() {
62          return _imageStorageLocation;
63      }
64  
65      public String getReportName() {
66          return _reportDesignRetriever.getReportName();
67      }
68  
69      public Map<String, String> getReportParameters() {
70          return _reportParameters;
71      }
72  
73      public ReportDesignRetriever getRetriever() {
74          return _reportDesignRetriever;
75      }
76  
77      public void setAlternateDataSource(String alternateDataSourceName) {
78          _alternateDataSource = alternateDataSourceName;
79      }
80  
81      public void setReportParameters(Map<String, String> reportParameters) {
82          _reportParameters.putAll(reportParameters);
83      }
84  
85      public String toString() {
86          StringBuilder sb = new StringBuilder();
87  
88          sb.append("{imageStorageLocation=");
89          sb.append(_imageStorageLocation);
90          sb.append(", imagePath=");
91          sb.append(_imagePath);
92          sb.append(", reportName=");
93          sb.append(getReportName());
94          sb.append(", reportFormat=");
95          sb.append(_reportFormat);
96          sb.append("}");
97  
98          return sb.toString();
99      }
100 
101     private String _alternateDataSource;
102     private String _imagePath;
103     private String _imageStorageLocation;
104     private ReportDesignRetriever _reportDesignRetriever;
105     private ReportFormat _reportFormat;
106     private Map<String, String> _reportParameters;
107 
108 }