Search in sources :

Example 1 with ReportOutputSearchDto

use of com.evolveum.midpoint.web.page.admin.reports.dto.ReportOutputSearchDto in project midpoint by Evolveum.

the class PageCreatedReports method createQuery.

private ObjectQuery createQuery() {
    ReportOutputSearchDto dto = searchModel.getObject();
    S_AtomicFilterEntry q = QueryBuilder.queryFor(ReportOutputType.class, getPrismContext());
    if (StringUtils.isNotEmpty(dto.getText())) {
        PolyStringNormalizer normalizer = getPrismContext().getDefaultPolyStringNormalizer();
        String normalizedString = normalizer.normalize(dto.getText());
        q = q.item(ReportOutputType.F_NAME).containsPoly(normalizedString).matchingNorm().and();
    }
    String oid = dto.getReportTypeMap().get(dto.getReportType());
    if (StringUtils.isNotEmpty(oid)) {
        q = q.item(ReportOutputType.F_REPORT_REF).ref(oid).and();
    }
    return q.all().build();
}
Also used : ReportOutputSearchDto(com.evolveum.midpoint.web.page.admin.reports.dto.ReportOutputSearchDto) S_AtomicFilterEntry(com.evolveum.midpoint.prism.query.builder.S_AtomicFilterEntry) PolyStringNormalizer(com.evolveum.midpoint.prism.polystring.PolyStringNormalizer)

Example 2 with ReportOutputSearchDto

use of com.evolveum.midpoint.web.page.admin.reports.dto.ReportOutputSearchDto in project midpoint by Evolveum.

the class PageCreatedReports method createSearchDto.

private ReportOutputSearchDto createSearchDto() {
    ReportOutputSearchDto dto = new ReportOutputSearchDto();
    Map<String, String> reportTypeMap = dto.getReportTypeMap();
    List<PrismObject<ReportType>> reportTypes = WebModelServiceUtils.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 = WebComponentUtil.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;
}
Also used : PrismObject(com.evolveum.midpoint.prism.PrismObject) ReportOutputSearchDto(com.evolveum.midpoint.web.page.admin.reports.dto.ReportOutputSearchDto) StringValue(org.apache.wicket.util.string.StringValue) ReportType(com.evolveum.midpoint.xml.ns._public.common.common_3.ReportType)

Example 3 with ReportOutputSearchDto

use of com.evolveum.midpoint.web.page.admin.reports.dto.ReportOutputSearchDto in project midpoint by Evolveum.

the class PageCreatedReports method clearSearchPerformed.

private void clearSearchPerformed(AjaxRequestTarget target) {
    ReportOutputSearchDto dto = searchModel.getObject();
    dto.setReportType(null);
    dto.setText(null);
    refreshTable(target);
}
Also used : ReportOutputSearchDto(com.evolveum.midpoint.web.page.admin.reports.dto.ReportOutputSearchDto)

Aggregations

ReportOutputSearchDto (com.evolveum.midpoint.web.page.admin.reports.dto.ReportOutputSearchDto)3 PrismObject (com.evolveum.midpoint.prism.PrismObject)1 PolyStringNormalizer (com.evolveum.midpoint.prism.polystring.PolyStringNormalizer)1 S_AtomicFilterEntry (com.evolveum.midpoint.prism.query.builder.S_AtomicFilterEntry)1 ReportType (com.evolveum.midpoint.xml.ns._public.common.common_3.ReportType)1 StringValue (org.apache.wicket.util.string.StringValue)1