Search in sources :

Example 1 with ObjectCollectionType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectCollectionType in project midpoint by Evolveum.

the class PageObjectCollections method initLayout.

private void initLayout() {
    Form mainForm = new MidpointForm(ID_MAIN_FORM);
    add(mainForm);
    MainObjectListPanel<ObjectCollectionType> table = new MainObjectListPanel<ObjectCollectionType>(ID_TABLE, ObjectCollectionType.class) {

        @Override
        protected UserProfileStorage.TableId getTableId() {
            return UserProfileStorage.TableId.TABLE_OBJECTS_COLLECTION;
        }

        @Override
        protected List<InlineMenuItem> createInlineMenu() {
            List<InlineMenuItem> menu = new ArrayList<>();
            menu.add(createDeleteInlineMenu());
            return menu;
        }

        @Override
        protected List<IColumn<SelectableBean<ObjectCollectionType>, String>> createDefaultColumns() {
            return ColumnUtils.getDefaultObjectColumns();
        }

        @Override
        protected String getNothingSelectedMessage() {
            return getString("pageObjectCollections.message.nothingSelected");
        }

        @Override
        protected String getConfirmMessageKeyForSingleObject() {
            return "pageObjectCollections.message.confirmationMessageForMultipleObject";
        }

        @Override
        protected String getConfirmMessageKeyForMultiObject() {
            return "pageObjectCollections.message.confirmationMessageForSingleObject";
        }
    };
    table.setOutputMarkupId(true);
    mainForm.add(table);
}
Also used : UserProfileStorage(com.evolveum.midpoint.web.session.UserProfileStorage) MainObjectListPanel(com.evolveum.midpoint.gui.api.component.MainObjectListPanel) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) ArrayList(java.util.ArrayList) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) ObjectCollectionType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectCollectionType)

Example 2 with ObjectCollectionType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectCollectionType in project midpoint by Evolveum.

the class DashboardServiceImpl method combineAuditFilter.

private ObjectFilter combineAuditFilter(CollectionRefSpecificationType collectionRef, SearchFilterType baseFilter, Task task, OperationResult result) throws CommunicationException, ObjectNotFoundException, SchemaException, SecurityViolationException, ConfigurationException, ExpressionEvaluationException {
    SearchFilterType filter = baseFilter;
    if (filter == null) {
        if (collectionRef.getCollectionRef() != null) {
            @NotNull PrismObject<ObjectCollectionType> collection = modelService.getObject(ObjectCollectionType.class, collectionRef.getCollectionRef().getOid(), null, task, result);
            filter = collection.asObjectable().getFilter();
        } else {
            filter = collectionRef.getFilter();
        }
    }
    if (collectionRef.getBaseCollectionRef() != null && collectionRef.getBaseCollectionRef().getCollectionRef() != null && collectionRef.getBaseCollectionRef().getCollectionRef().getOid() != null) {
        @NotNull PrismObject<ObjectCollectionType> baseCollection = modelService.getObject(ObjectCollectionType.class, collectionRef.getCollectionRef().getOid(), null, task, result);
        if (filter == null && baseCollection.asObjectable().getFilter() == null) {
            return null;
        } else if (filter == null) {
            return prismContext.getQueryConverter().parseFilter(baseCollection.asObjectable().getFilter(), AuditEventRecordType.class);
        } else if (baseCollection.asObjectable().getFilter() == null) {
            return prismContext.getQueryConverter().parseFilter(filter, AuditEventRecordType.class);
        } else {
            ObjectFilter baseFilterFromCollection = prismContext.getQueryConverter().parseFilter(baseCollection.asObjectable().getFilter(), AuditEventRecordType.class);
            ObjectFilter baseObjectFilter = prismContext.getQueryConverter().parseFilter(filter, AuditEventRecordType.class);
            ObjectQueryUtil.filterAnd(baseFilterFromCollection, baseObjectFilter, prismContext);
            return prismContext.getQueryConverter().parseFilter(filter, AuditEventRecordType.class);
        }
    }
    if (filter == null) {
        return null;
    }
    return prismContext.getQueryConverter().parseFilter(filter, AuditEventRecordType.class);
}
Also used : SearchFilterType(com.evolveum.prism.xml.ns._public.query_3.SearchFilterType) AuditEventRecordType(com.evolveum.midpoint.xml.ns._public.common.audit_3.AuditEventRecordType) ObjectFilter(com.evolveum.midpoint.prism.query.ObjectFilter) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

MainObjectListPanel (com.evolveum.midpoint.gui.api.component.MainObjectListPanel)1 ObjectFilter (com.evolveum.midpoint.prism.query.ObjectFilter)1 MidpointForm (com.evolveum.midpoint.web.component.form.MidpointForm)1 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)1 UserProfileStorage (com.evolveum.midpoint.web.session.UserProfileStorage)1 AuditEventRecordType (com.evolveum.midpoint.xml.ns._public.common.audit_3.AuditEventRecordType)1 ObjectCollectionType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectCollectionType)1 SearchFilterType (com.evolveum.prism.xml.ns._public.query_3.SearchFilterType)1 ArrayList (java.util.ArrayList)1 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)1 Form (org.apache.wicket.markup.html.form.Form)1 NotNull (org.jetbrains.annotations.NotNull)1