Search in sources :

Example 1 with DebugSearchDto

use of com.evolveum.midpoint.web.page.admin.configuration.dto.DebugSearchDto in project midpoint by Evolveum.

the class PageDebugList method exportSelected.

private void exportSelected(AjaxRequestTarget target, DebugObjectItem item) {
    List<DebugObjectItem> selected = getSelectedData(target, item);
    if (selected.isEmpty()) {
        return;
    }
    List<String> oids = new ArrayList<>();
    for (DebugObjectItem dItem : selected) {
        oids.add(dItem.getOid());
    }
    ObjectFilter filter = InOidFilter.createInOid(oids);
    DebugSearchDto searchDto = searchModel.getObject();
    initDownload(target, searchDto.getType().getClassDefinition(), ObjectQuery.createObjectQuery(filter));
}
Also used : ArrayList(java.util.ArrayList) DebugSearchDto(com.evolveum.midpoint.web.page.admin.configuration.dto.DebugSearchDto) ObjectFilter(com.evolveum.midpoint.prism.query.ObjectFilter) DebugObjectItem(com.evolveum.midpoint.web.page.admin.configuration.dto.DebugObjectItem)

Example 2 with DebugSearchDto

use of com.evolveum.midpoint.web.page.admin.configuration.dto.DebugSearchDto in project midpoint by Evolveum.

the class PageDebugList method listObjectsPerformed.

private void listObjectsPerformed(ObjectQuery query, AjaxRequestTarget target) {
    DebugSearchDto dto = searchModel.getObject();
    ObjectTypes selected = dto.getType();
    RepositoryObjectDataProvider provider = getTableDataProvider();
    provider.setQuery(createQuery(query));
    if (selected != null) {
        provider.setType(selected.getClassDefinition());
        addOrReplaceTable(provider);
    }
    // save object type category to session storage, used by back button
    ConfigurationStorage storage = getSessionStorage().getConfiguration();
    storage.setDebugSearchDto(dto);
    Table table = getListTable();
    target.add((Component) table);
}
Also used : RepositoryObjectDataProvider(com.evolveum.midpoint.web.component.data.RepositoryObjectDataProvider) DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) Table(com.evolveum.midpoint.web.component.data.Table) ConfigurationStorage(com.evolveum.midpoint.web.session.ConfigurationStorage) DebugSearchDto(com.evolveum.midpoint.web.page.admin.configuration.dto.DebugSearchDto) ObjectTypes(com.evolveum.midpoint.schema.constants.ObjectTypes)

Example 3 with DebugSearchDto

use of com.evolveum.midpoint.web.page.admin.configuration.dto.DebugSearchDto in project midpoint by Evolveum.

the class PageDebugList method deleteSelected.

private void deleteSelected(AjaxRequestTarget target, DebugObjectItem item) {
    List<DebugObjectItem> selected = getSelectedData(target, item);
    if (selected.isEmpty()) {
        return;
    }
    DebugSearchDto searchDto = searchModel.getObject();
    DebugConfDialogDto dto = new DebugConfDialogDto(DebugConfDialogDto.Operation.DELETE_SELECTED, selected, searchDto.getType().getClassDefinition());
    confDialogModel.setObject(dto);
    showMainPopup(getDeleteConfirmationPanel(), target);
}
Also used : DebugConfDialogDto(com.evolveum.midpoint.web.page.admin.configuration.dto.DebugConfDialogDto) DebugSearchDto(com.evolveum.midpoint.web.page.admin.configuration.dto.DebugSearchDto) DebugObjectItem(com.evolveum.midpoint.web.page.admin.configuration.dto.DebugObjectItem)

Example 4 with DebugSearchDto

use of com.evolveum.midpoint.web.page.admin.configuration.dto.DebugSearchDto in project midpoint by Evolveum.

the class PageDebugList method exportAllType.

private void exportAllType(AjaxRequestTarget target) {
    DebugSearchDto searchDto = searchModel.getObject();
    initDownload(target, searchDto.getType().getClassDefinition(), null);
}
Also used : DebugSearchDto(com.evolveum.midpoint.web.page.admin.configuration.dto.DebugSearchDto)

Example 5 with DebugSearchDto

use of com.evolveum.midpoint.web.page.admin.configuration.dto.DebugSearchDto in project midpoint by Evolveum.

the class PageDebugList method createQuery.

private ObjectQuery createQuery(ObjectQuery searchQuery) {
    DebugSearchDto dto = searchModel.getObject();
    List<ObjectFilter> filters = new ArrayList<>();
    if (ObjectTypes.SHADOW.equals(dto.getType()) && dto.getResource() != null) {
        String oid = dto.getResource().getOid();
        ObjectFilter objectFilter = QueryBuilder.queryFor(ShadowType.class, getPrismContext()).item(ShadowType.F_RESOURCE_REF).ref(oid).buildFilter();
        filters.add(objectFilter);
    }
    if (searchQuery != null && searchQuery.getFilter() != null) {
        filters.add(searchQuery.getFilter());
    }
    if (filters.isEmpty()) {
        return null;
    }
    ObjectFilter filter = filters.size() > 1 ? AndFilter.createAnd(filters) : filters.get(0);
    ObjectQuery query = new ObjectQuery();
    query.setFilter(filter);
    return query;
}
Also used : ArrayList(java.util.ArrayList) DebugSearchDto(com.evolveum.midpoint.web.page.admin.configuration.dto.DebugSearchDto) ObjectFilter(com.evolveum.midpoint.prism.query.ObjectFilter) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery)

Aggregations

DebugSearchDto (com.evolveum.midpoint.web.page.admin.configuration.dto.DebugSearchDto)14 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)6 DebugConfDialogDto (com.evolveum.midpoint.web.page.admin.configuration.dto.DebugConfDialogDto)4 DebugObjectItem (com.evolveum.midpoint.web.page.admin.configuration.dto.DebugObjectItem)3 ArrayList (java.util.ArrayList)3 ObjectFilter (com.evolveum.midpoint.prism.query.ObjectFilter)2 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)2 ObjectAlreadyExistsException (com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException)2 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)2 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)2 RepositoryObjectDataProvider (com.evolveum.midpoint.web.component.data.RepositoryObjectDataProvider)2 ConfigurationStorage (com.evolveum.midpoint.web.session.ConfigurationStorage)2 QName (javax.xml.namespace.QName)2 Form (org.apache.wicket.markup.html.form.Form)2 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)2 PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)2 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 ObjectPaging (com.evolveum.midpoint.prism.query.ObjectPaging)1 ObjectTypes (com.evolveum.midpoint.schema.constants.ObjectTypes)1 Table (com.evolveum.midpoint.web.component.data.Table)1