KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.calipso.reportgenerator.enterprise.server;
2
3 import com.calipso.reportgenerator.common.*;
4 import com.calipso.reportgenerator.reportdefinitions.ReportView;
5 import com.calipso.reportgenerator.reportdefinitions.ReportDefinition;
6 import com.calipso.reportgenerator.reportdefinitions.ReportSourceDefinition;
7 import com.calipso.reportgenerator.reportcalculator.Matrix;
8 import com.calipso.reportgenerator.reportmanager.ReportManager;
9 import com.calipso.reportgenerator.common.InfoException;
10 import javax.ejb.SessionContext JavaDoc;
11 import java.util.Map JavaDoc;
12 import java.util.Set JavaDoc;
13 import java.util.Vector JavaDoc;
14 import java.util.Collection JavaDoc;
15
16 /**
17  * Enterprise Java Bean que crea y guarda una instancia de ReportManager.
18  * Implementa SessionBean, es decir, debe definir todos los métodos
19  * de la interface que serán los que harán posible la comunicaciones entre
20  * el Bean y el Container debido a la ocurrencia de eventos determinados.
21  * Publica los métodos del ReportManager a los cuales le reenvía la ejecución agregando throws InfoException por el contexto que se ejecuta.
22  * @see com.calipso.reportgenerator.reportmanager.ReportManager
23  */

24
25 public class ReportManagerSLBean implements javax.ejb.SessionBean JavaDoc {
26
27   private SessionContext JavaDoc ctx;
28
29   /**
30    * Metodo responsable de asociar al bean con un ambiente.
31    */

32   public void setSessionContext(SessionContext JavaDoc ctx) {
33     this.ctx = ctx;
34   }
35
36   /**
37    * Obtiene un ReportManagera partir de la configuración especificada en ReportManagerConfiguration
38    * @param reportGeneratorConfiguration la configuracion que especifica path de los repositorios
39    * , si es distribuida, host, port.
40    * @return interface que publica los métodos a invocar por parte del usuario
41    */

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

56   public void ejbCreate() {
57   }
58
59   /**
60    * Método requerido por el EJB Container
61    */

62   public void ejbRemove() {
63   }
64
65   /**
66    * Método requerido por el EJB Container
67    */

68   public void ejbActivate() {
69   }
70
71   /**
72    * Método requerido por el EJB Container
73    */

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