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 ; 11 import java.util.Map ; 12 import java.util.Set ; 13 import java.util.Vector ; 14 import java.util.Collection ; 15 16 24 25 public class ReportManagerSLBean implements javax.ejb.SessionBean { 26 27 private SessionContext ctx; 28 29 32 public void setSessionContext(SessionContext ctx) { 33 this.ctx = ctx; 34 } 35 36 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 e){ 49 throw new InfoException(e); 50 } 51 } 52 53 56 public void ejbCreate() { 57 } 58 59 62 public void ejbRemove() { 63 } 64 65 68 public void ejbActivate() { 69 } 70 71 74 public void ejbPassivate() { 75 } 76 77 78 public int PrepareReport(ReportGeneratorConfiguration configuration, String reportDefID) throws InfoException{ 79 return getReportManager(configuration).PrepareReport(reportDefID); 80 } 81 82 public int PrepareReport(ReportGeneratorConfiguration configuration, String reportDefId, Map 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 reportSourceDefinitionId) throws InfoException { 91 getReportManager(configuration).prepareReportSource(reportSourceDefinitionId); 92 } 93 94 public Map getReportDefinitions(ReportGeneratorConfiguration configuration) throws InfoException { 95 return getReportManager(configuration).getReportDefinitions(); 96 } 97 98 public Map getReportSourceDefinitions(ReportGeneratorConfiguration configuration) throws InfoException { 99 return getReportManager(configuration).getReportSourceDefinitions(); 100 } 101 102 public Map getReportsForEntity(ReportGeneratorConfiguration configuration, String entityID) throws InfoException { 103 return getReportManager(configuration).getReportsForEntity(entityID); 104 } 105 106 public void ExecuteAction(ReportGeneratorConfiguration configuration, int handle, String actionName, Object params) throws InfoException { 107 getReportManager(configuration).ExecuteAction(handle, actionName, params); 108 } 109 110 public void invalidateReportSource(ReportGeneratorConfiguration configuration, String 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 reportDefinitionId) throws InfoException { 123 return getReportManager(configuration).getReportQuery(reportDefinitionId); 124 } 125 126 public ReportQuery getDefaultReportQuery(ReportGeneratorConfiguration configuration, String reportDefinitionId) throws InfoException { 127 return getReportManager(configuration).getDefaultReportQuery(reportDefinitionId); 128 } 129 130 public ReportResult ExecReportQuery(ReportGeneratorConfiguration configuration, int handle, Map 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 reportDefinitionID, Map paramValues) throws InfoException { 139 return getReportManager(configuration).ExecReportQuery(reportDefinitionID, paramValues); 140 } 141 142 public ReportResult ExecReportQuery(ReportGeneratorConfiguration configuration, String reportDefinitionID, ReportQuery query) throws InfoException { 143 return getReportManager(configuration).ExecReportQuery(reportDefinitionID, query); 144 } 145 146 public ReportQuery getDefaultReportQuery(ReportGeneratorConfiguration configuration, int handle,String userID) throws InfoException { 147 return getReportManager(configuration).getDefaultReportQuery(handle,userID); 148 } 149 150 public Map getReportViews(ReportGeneratorConfiguration configuration, String reportDefinitionID, String userID) throws InfoException{ 151 return getReportManager(configuration).getReportViews(reportDefinitionID); 152 } 153 154 public Map getReportViews(ReportGeneratorConfiguration configuration, String reportDefinitionID) throws InfoException{ 155 return getReportManager(configuration).getReportViews(reportDefinitionID); 156 } 157 158 public ReportResult ExecReportQuery(ReportGeneratorConfiguration configuration, int handle, String reportViewId) throws InfoException{ 159 return getReportManager(configuration).ExecReportQuery(handle,reportViewId); 160 } 161 162 public ReportSpec getReportSpec(ReportGeneratorConfiguration configuration, String reportDefinitionId, String 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 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 id, String reportDefinitionId, String userId) throws InfoException { 202 getReportManager(configuration).deleteReportView(id,reportDefinitionId,userId); 203 } 204 205 public void deleteReportSource(ReportGeneratorConfiguration configuration, String reportSourceDefinitionId) throws InfoException { 206 getReportManager(configuration).deleteReportSource(reportSourceDefinitionId); 207 } 208 209 public void deleteReportSourceDefinition(ReportGeneratorConfiguration configuration, String reportSourceDefinitionID) throws InfoException { 210 getReportManager(configuration).deleteReportSourceDefinition(reportSourceDefinitionID); 211 } 212 213 public void deleteReportDefinition(ReportGeneratorConfiguration configuration, String reportDefinitionID) throws InfoException { 214 getReportManager(configuration).deleteReportDefinition(reportDefinitionID); 215 } 216 217 public void assingDefaultView(ReportGeneratorConfiguration configuration, String id, String reportDefinitionId, String userId) throws InfoException { 218 getReportManager(configuration).assingDefaultView(id,reportDefinitionId,userId); 219 } 220 221 public Vector registerReportSourceDefinitions(ReportGeneratorConfiguration configuration, Vector vector) throws InfoException{ 222 return getReportManager(configuration).registerReportSourceDefinitions(vector); 223 } 224 225 public Vector registerReportDefinitions(ReportGeneratorConfiguration configuration, Vector vector) throws InfoException{ 226 return getReportManager(configuration).registerReportDefinitions(vector); 227 } 228 229 public Vector registerReportViews(ReportGeneratorConfiguration configuration, Vector vector) throws InfoException{ 230 return getReportManager(configuration).registerReportViews(vector); 231 } 232 233 public String getDefaultReportViewId(ReportGeneratorConfiguration configuration, String reportDefinitionId, String 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 getXML(ReportGeneratorConfiguration configuration, int handle) throws InfoException{ 246 return getReportManager(configuration).getXML(handle); 247 }; 248 249 public String getXML(ReportGeneratorConfiguration configuration, String reportDefinitionID, Map paramValues) throws InfoException{ 250 return getReportManager(configuration).getXML(reportDefinitionID,paramValues); 251 }; 252 253 public Set getDimensionValues(ReportGeneratorConfiguration configuration, int handle, String name) throws InfoException{ 254 return getReportManager(configuration).getDimensionValues(handle,name); 255 }; 256 257 public Set getDimensionValues(ReportGeneratorConfiguration configuration, String reportDefinitionID, Map paramValues, String name) throws InfoException{ 258 return getReportManager(configuration).getDimensionValues(reportDefinitionID,paramValues,name); 259 }; 260 261 public Vector 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 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 id, String reportDefinitionId, String 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 reportDefinitionId) throws InfoException{ 295 return getReportManager(configuration).getReportDefinitionFromID(reportDefinitionId); 296 }; 297 298 public ReportSourceDefinition getReportSourceDefinitionFromID(ReportGeneratorConfiguration configuration, String reportSourceDefinitionId) throws InfoException{ 299 return getReportManager(configuration).getReportSourceDefinitionFromID(reportSourceDefinitionId); 300 }; 301 302 public boolean validateUser(ReportGeneratorConfiguration configuration, String userName, String password, String userRepositoryPath) throws InfoException { 303 return getReportManager(configuration).validateUser(userName, password, userRepositoryPath); 304 }; 305 306 public void exportReport(ReportGeneratorConfiguration configuration, String userName, String password,String userRepositoryPath, String reportDefinitionId, Map paramValues, boolean isLandscape, int type, String destinationPath, String 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 params) throws InfoException{ 311 return getReportManager(configuration).exportReport(params); 312 }; 313 314 public boolean addNewUser(ReportGeneratorConfiguration configuration, String rootPasswd, String userName, String password, String userRepositoryPath) throws InfoException{ 315 return getReportManager(configuration).addNewUser(rootPasswd, userName, password, userRepositoryPath); 316 } 317 318 public boolean validateRol(ReportGeneratorConfiguration configuration, String [] roles, String userName, String rolRepositoryPath) throws InfoException { 319 return getReportManager(configuration).validateRol(roles, userName, rolRepositoryPath); 320 } 321 322 public void addUserData(ReportGeneratorConfiguration configuration, String userName, String name, String company, String userDataRepositoryPath) throws InfoException { 323 getReportManager(configuration).addUserData(userName, name, company, userDataRepositoryPath); 324 } 325 326 public void addUserRol(ReportGeneratorConfiguration configuration, String userName, String rol, String rolsRepositoryPath) throws InfoException { 327 getReportManager(configuration).addUserRol(userName, rol, rolsRepositoryPath); 328 } 329 330 public MicroReport getMicroReport(ReportGeneratorConfiguration configuration, String fileName) throws InfoException { 331 return getReportManager(configuration).getMicroReport(fileName); 332 } 333 334 public MicroReport getMicroReport(ReportGeneratorConfiguration configuration, String id, Map params) throws InfoException { 335 return getReportManager(configuration).getMicroReport(id, params); 336 } 337 338 public Collection getUserData(ReportGeneratorConfiguration configuration, String userId, String userDataRepositoryPath) throws InfoException { 339 return getReportManager(configuration).getUserData(userId, userDataRepositoryPath); 340 } 341 342 public void logClientData(ReportGeneratorConfiguration configuration, String 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 |