KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > calipso > reportgenerator > enterprise > server > ReportManagerSFBean


1 package com.calipso.reportgenerator.enterprise.server;
2
3 import com.calipso.reportgenerator.reportdefinitions.*;
4 import com.calipso.reportgenerator.common.*;
5 import com.calipso.reportgenerator.reportcalculator.Matrix;
6 import com.calipso.reportgenerator.reportmanager.ReportManager;
7 import com.calipso.reportgenerator.common.InfoException;
8 import javax.ejb.SessionContext JavaDoc;
9 import java.util.Map JavaDoc;
10 import java.util.Set JavaDoc;
11 import java.util.Vector JavaDoc;
12 import java.util.Collection JavaDoc;
13
14 /**
15  * Enterprise Java Bean que crea y guarda una instancia de ReportManager.
16  * Implementa SessionBean, es decir, debe definir todos los métodos
17  * de la interface que serán los que harán posible la comunicaciones entre
18  * el Bean y el Container debido a la ocurrencia de eventos determinados.
19  */

20
21
22 /**
23  * Esta clase corresponde a las ejecución de un ReportManager como un StateFul.
24  * Publica los métodos del ReportManager a los cuales le reenvía la ejecución agregando throws InfoException por el contexto que se ejecuta.
25  * @see com.calipso.reportgenerator.reportmanager.ReportManager
26  */

27 public class ReportManagerSFBean implements javax.ejb.SessionBean JavaDoc {
28
29   private SessionContext JavaDoc ctx;
30   private IReportManager reportManager;
31
32   /**
33    * Metodo responsable de asociar al bean con un ambiente.
34    */

35   public void setSessionContext(SessionContext JavaDoc ctx) {
36     this.ctx = ctx;
37   }
38
39   /**
40    * Metodo requerido por el EJB Container
41    * @param reportGeneratorConfiguration características de configuración como path del repositorio, host, port.
42    * @throws com.calipso.reportgenerator.common.InfoException
43    */

44   public void ejbCreate(ReportGeneratorConfiguration reportGeneratorConfiguration) throws InfoException {
45     LanguageTraslator.newLocaleFrom(reportGeneratorConfiguration.getLocaleLanguage(),reportGeneratorConfiguration.getCountry(),reportGeneratorConfiguration.getLanguagesPath());
46     try{
47       IReportManager reportManager = new ReportManager();
48       reportManager.init(reportGeneratorConfiguration);
49       this.reportManager = reportManager;
50     }catch(Exception JavaDoc e){
51       throw new InfoException(e);
52     }
53   }
54
55   /**
56    * Método requerido por el EJB Container
57    */

58   public void ejbRemove() {
59   }
60
61   /**
62    * Método requerido por el EJB Container
63    */

64   public void ejbActivate() {
65   }
66
67   /**
68    * Método requerido por el EJB Container
69    */

70   public void ejbPassivate() {
71   }
72
73   public int PrepareReport(String JavaDoc reportDefID) throws InfoException{
74     return reportManager.PrepareReport(reportDefID);
75   }
76
77
78   public int PrepareReport(String JavaDoc reportDefId, Map JavaDoc paramValues) throws InfoException {
79     return reportManager.PrepareReport(reportDefId, paramValues);
80   }
81
82   public void ReleaseReport(int handle) throws InfoException {
83     reportManager.ReleaseReport(handle);
84   }
85
86
87   public void prepareReportSource(String JavaDoc reportSourceDefinitionId) throws InfoException {
88     reportManager.prepareReportSource(reportSourceDefinitionId);
89   }
90
91   public Map JavaDoc getReportDefinitions() throws InfoException {
92     return reportManager.getReportDefinitions();
93   }
94
95   public Map JavaDoc getReportSourceDefinitions() throws InfoException {
96     return reportManager.getReportSourceDefinitions();
97   }
98
99   public Map JavaDoc getReportsForEntity(String JavaDoc entityID) throws InfoException {
100     return reportManager.getReportsForEntity(entityID);
101   }
102
103   public void ExecuteAction(int handle, String JavaDoc actionName, Object JavaDoc params) throws InfoException {
104     reportManager.ExecuteAction(handle, actionName, params);
105   }
106
107
108   public void invalidateReportSource(String JavaDoc reportSourceDefinitionId) throws InfoException{
109     reportManager.invalidateReportSource(reportSourceDefinitionId);
110   }
111
112
113   public ReportQuery getReportQuery(int handle) throws InfoException {
114     return reportManager.getReportQuery(handle);
115   }
116
117   public ReportQuery getDefaultReportQuery(int handle) throws InfoException {
118     return reportManager.getDefaultReportQuery(handle);
119   }
120
121   public ReportQuery getReportQuery(String JavaDoc reportDefinitionId) throws InfoException {
122     return reportManager.getReportQuery(reportDefinitionId);
123   }
124
125   public ReportQuery getDefaultReportQuery(String JavaDoc reportDefinitionId) throws InfoException{
126     return reportManager.getDefaultReportQuery(reportDefinitionId);
127   }
128
129   public ReportResult ExecReportQuery(int handle, Map JavaDoc paramValues) throws InfoException {
130     return reportManager.ExecReportQuery(handle, paramValues);
131   }
132
133   public ReportResult ExecReportQuery(int handle, ReportQuery query) throws InfoException{
134     return reportManager.ExecReportQuery(handle, query);
135   }
136
137   public ReportResult ExecReportQuery(String JavaDoc reportDefinitionID, Map JavaDoc paramValues) throws InfoException {
138     return ExecReportQuery(reportDefinitionID, paramValues);
139   }
140
141   public ReportResult ExecReportQuery(String JavaDoc reportDefinitionID, ReportQuery query) throws InfoException{
142     return reportManager.ExecReportQuery(reportDefinitionID, query);
143   }
144
145   public ReportQuery getDefaultReportQuery(int handle,String JavaDoc userID) throws InfoException{
146     return reportManager.getDefaultReportQuery(handle,userID);
147   }
148
149   public ReportResult ExecReportQuery(int handle, ReportView reportView) throws InfoException{
150     return reportManager.ExecReportQuery(handle,reportView);
151   }
152
153   public ReportView getReportViewFromID(String JavaDoc id,String JavaDoc reportDefinitionId,String JavaDoc userId) throws InfoException{
154     return reportManager.getReportViewFromID(id,reportDefinitionId,userId);
155   }
156
157   public void saveReportView(ReportView reportView) throws InfoException{
158     reportManager.saveReportView(reportView);
159   }
160
161   public ReportSpec getReportSpec(String JavaDoc reportDefinitionId, String JavaDoc reportSourceDefId) throws InfoException{
162     return reportManager.getReportSpec(reportDefinitionId, reportSourceDefId);
163   }
164
165   public ReportSpec getReportSpec(ReportDefinition reportDefinition, ReportSourceDefinition reportSourceDef) throws InfoException{
166     return reportManager.getReportSpec(reportDefinition, reportSourceDef);
167   }
168   public ReportSpec getReportSpec(String JavaDoc reportDefinitionId) throws InfoException{
169     return reportManager.getReportSpec(reportDefinitionId);
170   }
171
172   public Map JavaDoc getReportViews(String JavaDoc reportDefinitionID, String JavaDoc userID) throws InfoException{
173     return reportManager.getReportViews(reportDefinitionID,userID);
174   }
175
176   public Map JavaDoc getReportViews(String JavaDoc reportDefinitionID) throws InfoException{
177     return reportManager.getReportViews(reportDefinitionID);
178   }
179
180   public void registerDefinitions() throws InfoException {
181     reportManager.registerDefinitions();
182   }
183
184   public void deleteAllRepositories() throws InfoException {
185     reportManager.deleteAllRepositories();
186   }
187
188   public void deleteAllDefinitions() throws InfoException {
189     reportManager.deleteAllDefinitions();
190   }
191
192   public void deleteReportSourceRepository() throws InfoException {
193     reportManager.deleteReportSourceRepository();
194   }
195
196   public void deleteReportSourceDefinitionRepository() throws InfoException {
197     reportManager.deleteReportSourceDefinitionRepository();
198   }
199
200   public void deleteReportDefinitionRepository() throws InfoException {
201     reportManager.deleteReportDefinitionRepository();
202   }
203
204   public void deleteReportViewRepository() throws InfoException {
205     reportManager.deleteReportViewRepository();
206   }
207
208   public void deleteReportView(String JavaDoc id, String JavaDoc reportDefinitionId, String JavaDoc userId) throws InfoException {
209     reportManager.deleteReportView(id,reportDefinitionId,userId);
210   }
211
212   public void deleteReportSource(String JavaDoc reportSourceDefinitionId) throws InfoException {
213     reportManager.deleteReportSource(reportSourceDefinitionId);
214   }
215
216   public void deleteReportSourceDefinition(String JavaDoc reportSourceDefinitionID) throws InfoException {
217     reportManager.deleteReportSourceDefinition(reportSourceDefinitionID);
218   }
219
220   public void deleteReportDefinition(String JavaDoc reportDefinitionID) throws InfoException {
221     reportManager.deleteReportDefinition(reportDefinitionID);
222   }
223
224   public void assingDefaultView(String JavaDoc id, String JavaDoc reportDefinitionId, String JavaDoc userId) throws InfoException {
225     reportManager.assingDefaultView(id,reportDefinitionId,userId);
226   }
227
228   public Vector JavaDoc registerReportSourceDefinitions(Vector JavaDoc vector) throws InfoException{
229     return reportManager.registerReportSourceDefinitions(vector);
230   }
231
232   public Vector JavaDoc registerReportDefinitions(Vector JavaDoc vector) throws InfoException{
233     return reportManager.registerReportDefinitions(vector);
234   }
235
236   public Vector JavaDoc registerReportViews(Vector JavaDoc vector) throws InfoException{
237     return reportManager.registerReportViews(vector);
238   }
239
240   public String JavaDoc getDefaultReportViewId(String JavaDoc reportDefinitionId, String JavaDoc userId) throws InfoException{
241     return reportManager.getDefaultReportViewId(reportDefinitionId,userId);
242   }
243
244   public ReportResult ExecReportQuery(MicroReport microReport) throws InfoException {
245     return reportManager.ExecReportQuery(microReport);
246   };
247
248   public int PrepareReport(MicroReport microReport) throws InfoException {
249     return reportManager.PrepareReport(microReport);
250   };
251
252   public Matrix getMatrix(int handle) throws InfoException{
253     return reportManager.getMatrix(handle);
254   }
255
256   public String JavaDoc getXML(int handle) throws InfoException{
257     return reportManager.getXML(handle);
258   };
259
260   public String JavaDoc getXML(String JavaDoc reportDefinitionID, Map JavaDoc paramValues) throws InfoException{
261     return reportManager.getXML(reportDefinitionID,paramValues);
262   };
263
264   public Set JavaDoc getDimensionValues(int handle, String JavaDoc name) throws InfoException{
265     return reportManager.getDimensionValues(handle,name);
266   };
267
268   public Set JavaDoc getDimensionValues(String JavaDoc reportDefinitionID, Map JavaDoc paramValues, String JavaDoc name) throws InfoException{
269     return reportManager.getDimensionValues(reportDefinitionID,paramValues,name);
270   };
271
272   public Vector JavaDoc getUpdatedDataModel(int handle, int mode, int row, int col, boolean isDistributed) throws InfoException{
273     return reportManager.getUpdatedDataModel(handle, mode, row, col, isDistributed);
274   };
275
276   public ReportView getReportView(String JavaDoc reportViewId) throws InfoException{
277     return reportManager.getReportView(reportViewId);
278   };
279
280   public ReportResult ExecReportQuery(int handle, String JavaDoc reportViewId) throws InfoException{
281     return reportManager.ExecReportQuery(handle, reportViewId);
282   }
283
284   public void saveReportDefinition(ReportDefinition reportDefinition) throws InfoException{
285     reportManager.saveReportDefinition(reportDefinition);
286   };
287
288   public void saveReportSourceDefinition(ReportSourceDefinition reportSourceDefinition) throws InfoException{
289     reportManager.saveReportSourceDefinition(reportSourceDefinition);
290   };
291
292   public ReportDefinition getReportDefinitionFromID(String JavaDoc reportDefinitionId) throws InfoException{
293     return reportManager.getReportDefinitionFromID(reportDefinitionId);
294   };
295
296   public ReportSourceDefinition getReportSourceDefinitionFromID(String JavaDoc reportSourceDefinitionId) throws InfoException{
297    return reportManager.getReportSourceDefinitionFromID(reportSourceDefinitionId);
298   };
299
300   public boolean validateUser(String JavaDoc userName, String JavaDoc password, String JavaDoc userRepositoryPath) throws InfoException {
301     return reportManager.validateUser(userName, password, userRepositoryPath);
302   }
303
304   public void exportReport(String JavaDoc userName, String JavaDoc password,String JavaDoc userRepositoryPath, String JavaDoc reportDefinitionId, Map JavaDoc paramValues, boolean isLandscape, int type, String JavaDoc destinationPath, String JavaDoc name) throws InfoException{
305     reportManager.exportReport(userName, password,userRepositoryPath, reportDefinitionId, paramValues, isLandscape, type, destinationPath, name);
306   };
307
308   public byte[] exportReport(Map JavaDoc params) throws InfoException{
309     return reportManager.exportReport(params);
310   }
311
312   public boolean addNewUser(String JavaDoc rootPasswd, String JavaDoc userName, String JavaDoc password, String JavaDoc userRepositoryPath) throws InfoException{
313     return reportManager.addNewUser(rootPasswd, userName, password, userRepositoryPath);
314   }
315
316   public boolean validateRol(String JavaDoc[] roles, String JavaDoc userName, String JavaDoc rolRepositoryPath) throws InfoException{
317     return reportManager.validateRol(roles, userName, rolRepositoryPath);
318   }
319
320   public void addUserData(String JavaDoc userName, String JavaDoc name, String JavaDoc company, String JavaDoc userDataRepositoryPath) throws InfoException {
321     reportManager.addUserData(userName, name, company, userDataRepositoryPath);
322   }
323
324   public void addUserRol(String JavaDoc userName, String JavaDoc rol, String JavaDoc rolsRepositoryPath) throws InfoException {
325     reportManager.addUserRol(userName, rol, rolsRepositoryPath);
326   }
327
328   public MicroReport getMicroReport(String JavaDoc fileName) throws InfoException {
329     return reportManager.getMicroReport(fileName);
330   }
331
332   public MicroReport getMicroReport(String JavaDoc id, Map JavaDoc params) throws InfoException {
333     return reportManager.getMicroReport(id, params);
334   }
335
336   public Collection JavaDoc getUserData(String JavaDoc userId, String JavaDoc userDataRepositoryPath) throws InfoException {
337     return reportManager.getUserData(userId, userDataRepositoryPath);
338   }
339
340   public void logClientData(String JavaDoc clientData) throws InfoException {
341     reportManager.logClientData(clientData);
342   }
343   
344   public boolean isAcceptedLicence() throws InfoException{
345     return reportManager.isAcceptedLicence();
346   }
347
348   public void acceptedLicence(boolean value) throws InfoException{
349     reportManager.acceptedLicence(value);
350   }
351
352
353 }
354
355
356
357
Popular Tags