private ReportOutputSearchDto createSearchDto() { ReportOutputSearchDto dto = new ReportOutputSearchDto(); Map<String, String> reportTypeMap = dto.getReportTypeMap(); List<PrismObject<ReportType>> reportTypes = WebModelUtils.searchObjects(ReportType.class, null, null, getPageBase()); LOGGER.debug("Found {} report types.", reportTypes.size()); for (PrismObject o : reportTypes) { ReportType reportType = (ReportType) o.asObjectable(); if (reportType.isParent()) { String name = WebMiscUtil.getName(o); reportTypeMap.put(name, reportType.getOid()); } } StringValue param = getPage().getPageParameters().get(OnePageParameterEncoder.PARAMETER); if (param != null) { for (String key : dto.getReportTypeMap().keySet()) { if (reportTypeMap.get(key).equals(param.toString())) { dto.setReportType(key); } } } return dto; }
static { reportExportTypeMap.put(ExportType.CSV, "text/csv; charset=UTF-8"); reportExportTypeMap.put( ExportType.DOCX, "application/vnd.openxmlformats-officedocument.wordprocessingml.document; charset=UTF-8"); reportExportTypeMap.put(ExportType.HTML, "text/html; charset=UTF-8"); reportExportTypeMap.put( ExportType.ODS, "application/vnd.oasis.opendocument.spreadsheet; charset=UTF-8"); reportExportTypeMap.put( ExportType.ODT, "application/vnd.oasis.opendocument.text; charset=UTF-8"); reportExportTypeMap.put(ExportType.PDF, "application/pdf; charset=UTF-8"); reportExportTypeMap.put( ExportType.PPTX, "application/vnd.openxmlformats-officedocument.presentationml.presentation; charset=UTF-8"); reportExportTypeMap.put(ExportType.RTF, "application/rtf; charset=UTF-8"); reportExportTypeMap.put(ExportType.XHTML, "application/xhtml+xml; charset=UTF-8"); reportExportTypeMap.put(ExportType.XLS, "application/vnd.ms-excel; charset=UTF-8"); reportExportTypeMap.put( ExportType.XLSX, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=UTF-8"); reportExportTypeMap.put(ExportType.XML, "application/xml; charset=UTF-8"); reportExportTypeMap.put(ExportType.XML_EMBED, "text/xml; charset=UTF-8"); }