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 ; 9 import java.util.Map ; 10 import java.util.Set ; 11 import java.util.Vector ; 12 import java.util.Collection ; 13 14 20 21 22 27 public class ReportManagerSFBean implements javax.ejb.SessionBean { 28 29 private SessionContext ctx; 30 private IReportManager reportManager; 31 32 35 public void setSessionContext(SessionContext ctx) { 36 this.ctx = ctx; 37 } 38 39 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 e){ 51 throw new InfoException(e); 52 } 53 } 54 55 58 public void ejbRemove() { 59 } 60 61 64 public void ejbActivate() { 65 } 66 67 70 public void ejbPassivate() { 71 } 72 73 public int PrepareReport(String reportDefID) throws InfoException{ 74 return reportManager.PrepareReport(reportDefID); 75 } 76 77 78 public int PrepareReport(String reportDefId, Map 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 reportSourceDefinitionId) throws InfoException { 88 reportManager.prepareReportSource(reportSourceDefinitionId); 89 } 90 91 public Map getReportDefinitions() throws InfoException { 92 return reportManager.getReportDefinitions(); 93 } 94 95 public Map getReportSourceDefinitions() throws InfoException { 96 return reportManager.getReportSourceDefinitions(); 97 } 98 99 public Map getReportsForEntity(String entityID) throws InfoException { 100 return reportManager.getReportsForEntity(entityID); 101 } 102 103 public void ExecuteAction(int handle, String actionName, Object params) throws InfoException { 104 reportManager.ExecuteAction(handle, actionName, params); 105 } 106 107 108 public void invalidateReportSource(String 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 reportDefinitionId) throws InfoException { 122 return reportManager.getReportQuery(reportDefinitionId); 123 } 124 125 public ReportQuery getDefaultReportQuery(String reportDefinitionId) throws InfoException{ 126 return reportManager.getDefaultReportQuery(reportDefinitionId); 127 } 128 129 public ReportResult ExecReportQuery(int handle, Map 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 reportDefinitionID, Map paramValues) throws InfoException { 138 return ExecReportQuery(reportDefinitionID, paramValues); 139 } 140 141 public ReportResult ExecReportQuery(String reportDefinitionID, ReportQuery query) throws InfoException{ 142 return reportManager.ExecReportQuery(reportDefinitionID, query); 143 } 144 145 public ReportQuery getDefaultReportQuery(int handle,String 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 id,String reportDefinitionId,String 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 reportDefinitionId, String 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 reportDefinitionId) throws InfoException{ 169 return reportManager.getReportSpec(reportDefinitionId); 170 } 171 172 public Map getReportViews(String reportDefinitionID, String userID) throws InfoException{ 173 return reportManager.getReportViews(reportDefinitionID,userID); 174 } 175 176 public Map getReportViews(String 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 id, String reportDefinitionId, String userId) throws InfoException { 209 reportManager.deleteReportView(id,reportDefinitionId,userId); 210 } 211 212 public void deleteReportSource(String reportSourceDefinitionId) throws InfoException { 213 reportManager.deleteReportSource(reportSourceDefinitionId); 214 } 215 216 public void deleteReportSourceDefinition(String reportSourceDefinitionID) throws InfoException { 217 reportManager.deleteReportSourceDefinition(reportSourceDefinitionID); 218 } 219 220 public void deleteReportDefinition(String reportDefinitionID) throws InfoException { 221 reportManager.deleteReportDefinition(reportDefinitionID); 222 } 223 224 public void assingDefaultView(String id, String reportDefinitionId, String userId) throws InfoException { 225 reportManager.assingDefaultView(id,reportDefinitionId,userId); 226 } 227 228 public Vector registerReportSourceDefinitions(Vector vector) throws InfoException{ 229 return reportManager.registerReportSourceDefinitions(vector); 230 } 231 232 public Vector registerReportDefinitions(Vector vector) throws InfoException{ 233 return reportManager.registerReportDefinitions(vector); 234 } 235 236 public Vector registerReportViews(Vector vector) throws InfoException{ 237 return reportManager.registerReportViews(vector); 238 } 239 240 public String getDefaultReportViewId(String reportDefinitionId, String 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 getXML(int handle) throws InfoException{ 257 return reportManager.getXML(handle); 258 }; 259 260 public String getXML(String reportDefinitionID, Map paramValues) throws InfoException{ 261 return reportManager.getXML(reportDefinitionID,paramValues); 262 }; 263 264 public Set getDimensionValues(int handle, String name) throws InfoException{ 265 return reportManager.getDimensionValues(handle,name); 266 }; 267 268 public Set getDimensionValues(String reportDefinitionID, Map paramValues, String name) throws InfoException{ 269 return reportManager.getDimensionValues(reportDefinitionID,paramValues,name); 270 }; 271 272 public Vector 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 reportViewId) throws InfoException{ 277 return reportManager.getReportView(reportViewId); 278 }; 279 280 public ReportResult ExecReportQuery(int handle, String 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 reportDefinitionId) throws InfoException{ 293 return reportManager.getReportDefinitionFromID(reportDefinitionId); 294 }; 295 296 public ReportSourceDefinition getReportSourceDefinitionFromID(String reportSourceDefinitionId) throws InfoException{ 297 return reportManager.getReportSourceDefinitionFromID(reportSourceDefinitionId); 298 }; 299 300 public boolean validateUser(String userName, String password, String userRepositoryPath) throws InfoException { 301 return reportManager.validateUser(userName, password, userRepositoryPath); 302 } 303 304 public void exportReport(String userName, String password,String userRepositoryPath, String reportDefinitionId, Map paramValues, boolean isLandscape, int type, String destinationPath, String name) throws InfoException{ 305 reportManager.exportReport(userName, password,userRepositoryPath, reportDefinitionId, paramValues, isLandscape, type, destinationPath, name); 306 }; 307 308 public byte[] exportReport(Map params) throws InfoException{ 309 return reportManager.exportReport(params); 310 } 311 312 public boolean addNewUser(String rootPasswd, String userName, String password, String userRepositoryPath) throws InfoException{ 313 return reportManager.addNewUser(rootPasswd, userName, password, userRepositoryPath); 314 } 315 316 public boolean validateRol(String [] roles, String userName, String rolRepositoryPath) throws InfoException{ 317 return reportManager.validateRol(roles, userName, rolRepositoryPath); 318 } 319 320 public void addUserData(String userName, String name, String company, String userDataRepositoryPath) throws InfoException { 321 reportManager.addUserData(userName, name, company, userDataRepositoryPath); 322 } 323 324 public void addUserRol(String userName, String rol, String rolsRepositoryPath) throws InfoException { 325 reportManager.addUserRol(userName, rol, rolsRepositoryPath); 326 } 327 328 public MicroReport getMicroReport(String fileName) throws InfoException { 329 return reportManager.getMicroReport(fileName); 330 } 331 332 public MicroReport getMicroReport(String id, Map params) throws InfoException { 333 return reportManager.getMicroReport(id, params); 334 } 335 336 public Collection getUserData(String userId, String userDataRepositoryPath) throws InfoException { 337 return reportManager.getUserData(userId, userDataRepositoryPath); 338 } 339 340 public void logClientData(String 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 |