/** * listSystemReports */ @SuppressWarnings("rawtypes") public ims.admin.vo.SystemReportVoCollection listSystemReports() { DomainFactory factory = getDomainFactory(); String hqlString = "from ReportBo as rep where rep.imsId is not null order by rep.reportName"; List reports = factory.find(hqlString); return SystemReportVoAssembler.createSystemReportVoCollectionFromReportBo(reports); }
public ims.admin.vo.SystemReportVoCollection listReports(Boolean systemReportsOnly, String reportName) { DomainFactory factory = getDomainFactory(); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); StringBuffer hql = new StringBuffer(); hql.append(" FROM ReportBo AS rep "); if (Boolean.TRUE.equals(systemReportsOnly) || reportName != null) { hql.append(" WHERE "); } if (Boolean.TRUE.equals(systemReportsOnly)) { hql.append("rep.imsId IS NOT NULL "); } if (reportName != null) { hql.append(" AND UPPER(rep.reportName) like :reportName "); markers.add("reportName"); values.add("%" + reportName.toUpperCase() + "%"); } hql.append(" order by UPPER(rep.reportName) asc"); return SystemReportVoAssembler.createSystemReportVoCollectionFromReportBo(factory.find(hql.toString(), markers, values)); }
public ims.admin.vo.SystemReportVo saveReport(SystemReportVo report) throws ims.domain.exceptions.StaleObjectException { if (report == null) throw new CodingRuntimeException("Cannot save null Report"); if (!report.isValidated()) throw new DomainRuntimeException("SystemReportVo Not Validated."); DomainFactory factory = getDomainFactory(); ReportBo doReport = SystemReportVoAssembler.extractReportBo(factory, report); factory.save(doReport); return SystemReportVoAssembler.create(doReport); }
public SystemReportVo getReport(ReportBoRefVo reportRef) { if (reportRef == null) throw new CodingRuntimeException("Cannot get Report on null Id."); return SystemReportVoAssembler.create((ReportBo) getDomainFactory().getDomainObject(ReportBo.class, reportRef.getID_ReportBo())); }