Search in sources :

Example 1 with ReportSearchDto

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

the class PageReports method clearSearchPerformed.

private void clearSearchPerformed(AjaxRequestTarget target) {
    searchModel.setObject(new ReportSearchDto());
    Table panel = getReportTable();
    DataTable table = panel.getDataTable();
    ObjectDataProvider provider = (ObjectDataProvider) table.getDataProvider();
    provider.setQuery(createQuery());
    ReportsStorage storage = getSessionStorage().getReports();
    storage.setReportSearch(searchModel.getObject());
    storage.setPaging(null);
    panel.setCurrentPage(null);
    target.add((Component) panel);
}
Also used : DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) ReportSearchDto(com.evolveum.midpoint.web.page.admin.reports.dto.ReportSearchDto) Table(com.evolveum.midpoint.web.component.data.Table) DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) ReportsStorage(com.evolveum.midpoint.web.session.ReportsStorage) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider)

Example 2 with ReportSearchDto

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

the class PageReports method createQuery.

private ObjectQuery createQuery() {
    ReportSearchDto dto = searchModel.getObject();
    String text = dto.getText();
    Boolean parent = !dto.isParent();
    S_AtomicFilterEntry q = QueryBuilder.queryFor(ReportType.class, getPrismContext());
    if (StringUtils.isNotEmpty(text)) {
        PolyStringNormalizer normalizer = getPrismContext().getDefaultPolyStringNormalizer();
        String normalizedText = normalizer.normalize(text);
        q = q.item(ReportType.F_NAME).eqPoly(normalizedText).matchingNorm().and();
    }
    if (parent) {
        q = q.item(ReportType.F_PARENT).eq(true).and();
    }
    return q.all().build();
}
Also used : ReportSearchDto(com.evolveum.midpoint.web.page.admin.reports.dto.ReportSearchDto) S_AtomicFilterEntry(com.evolveum.midpoint.prism.query.builder.S_AtomicFilterEntry) PolyStringNormalizer(com.evolveum.midpoint.prism.polystring.PolyStringNormalizer)

Aggregations

ReportSearchDto (com.evolveum.midpoint.web.page.admin.reports.dto.ReportSearchDto)2 PolyStringNormalizer (com.evolveum.midpoint.prism.polystring.PolyStringNormalizer)1 S_AtomicFilterEntry (com.evolveum.midpoint.prism.query.builder.S_AtomicFilterEntry)1 ObjectDataProvider (com.evolveum.midpoint.web.component.data.ObjectDataProvider)1 Table (com.evolveum.midpoint.web.component.data.Table)1 ReportsStorage (com.evolveum.midpoint.web.session.ReportsStorage)1 DataTable (org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable)1