Search in sources :

Example 11 with CompiledObjectCollectionView

use of com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView in project midpoint by Evolveum.

the class ContainerableListPanel method getAutoRefreshInterval.

protected int getAutoRefreshInterval() {
    if (isCollectionViewPanel()) {
        CompiledObjectCollectionView view = getObjectCollectionView();
        if (view == null) {
            return 0;
        }
        Integer autoRefreshInterval = view.getRefreshInterval();
        return Objects.requireNonNullElse(autoRefreshInterval, 0);
    }
    return 0;
}
Also used : CompiledObjectCollectionView(com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView)

Example 12 with CompiledObjectCollectionView

use of com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView in project midpoint by Evolveum.

the class ContainerableListPanel method getCompiledCollectionViewFromPanelConfiguration.

private CompiledObjectCollectionView getCompiledCollectionViewFromPanelConfiguration() {
    if (compiledCollectionViewFromPanelConfiguration != null) {
        return compiledCollectionViewFromPanelConfiguration;
    }
    if (config == null) {
        return null;
    }
    GuiObjectListViewType listViewType = config.getListView();
    if (listViewType == null) {
        return null;
    }
    Task task = getPageBase().createSimpleTask("Compile collection");
    OperationResult result = task.getResult();
    try {
        compiledCollectionViewFromPanelConfiguration = new CompiledObjectCollectionView();
        getPageBase().getModelInteractionService().compileView(compiledCollectionViewFromPanelConfiguration, listViewType, task, result);
    } catch (Throwable e) {
        LOGGER.error("Cannot compile object collection view for panel configuration {}. Reason: {}", config, e.getMessage(), e);
        result.recordFatalError("Cannot compile object collection view for panel configuration " + config + ". Reason: " + e.getMessage(), e);
        getPageBase().showResult(result);
    }
    return compiledCollectionViewFromPanelConfiguration;
}
Also used : Task(com.evolveum.midpoint.task.api.Task) CompiledObjectCollectionView(com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView) OperationResult(com.evolveum.midpoint.schema.result.OperationResult)

Example 13 with CompiledObjectCollectionView

use of com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView in project midpoint by Evolveum.

the class Search method getArchetypeQuery.

private ObjectQuery getArchetypeQuery(PageBase pageBase) {
    if (getCollectionSearchItem() == null || getCollectionSearchItem().getObjectCollectionView() == null) {
        return null;
    }
    CompiledObjectCollectionView view = getCollectionSearchItem().getObjectCollectionView();
    if (view.getFilter() == null) {
        return null;
    }
    ObjectQuery query = pageBase.getPrismContext().queryFor(getTypeClass()).build();
    OperationResult result = new OperationResult("evaluate filter");
    query.addFilter(WebComponentUtil.evaluateExpressionsInFilter(view.getFilter(), result, pageBase));
    return query;
}
Also used : CompiledObjectCollectionView(com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery)

Example 14 with CompiledObjectCollectionView

use of com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView in project midpoint by Evolveum.

the class AssignmentPopup method onInitialize.

@Override
protected void onInitialize() {
    super.onInitialize();
    Form form = new Form(ID_FORM);
    form.setOutputMarkupId(true);
    add(form);
    MultiCompositedButtonPanel newObjectIcon = new MultiCompositedButtonPanel(ID_COMPOSITED_BUTTONS, createNewButtonDescriptionModel()) {

        @Override
        protected void buttonClickPerformed(AjaxRequestTarget target, AssignmentObjectRelation relationSpec, CompiledObjectCollectionView collectionViews, Class<? extends WebPage> page) {
            Form form = (Form) AssignmentPopup.this.get(ID_FORM);
            AssignmentPopup.this.getModelObject().setSelectionVisible(false);
            addOrReplaceTabPanels(form, relationSpec);
            target.add(form);
        }
    };
    form.add(newObjectIcon);
    newObjectIcon.add(new VisibleBehaviour(() -> getModelObject() != null && getModelObject().isSelectionVisible()));
    addOrReplaceTabPanels(form, null);
    MessagePanel warningMessage = new MessagePanel(ID_WARNING_MESSAGE, MessagePanel.MessagePanelType.WARN, getWarningMessageModel());
    warningMessage.setOutputMarkupId(true);
    warningMessage.add(new VisibleBehaviour(() -> getWarningMessageModel() != null));
    add(warningMessage);
    form.add(createCancelButton());
    form.add(createAddButton());
    form.add(createBackButton());
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) WebPage(org.apache.wicket.markup.html.WebPage) Form(org.apache.wicket.markup.html.form.Form) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) CompiledObjectCollectionView(com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView) MessagePanel(com.evolveum.midpoint.gui.api.component.result.MessagePanel) MultiCompositedButtonPanel(com.evolveum.midpoint.web.component.MultiCompositedButtonPanel) AssignmentObjectRelation(com.evolveum.midpoint.model.api.AssignmentObjectRelation)

Example 15 with CompiledObjectCollectionView

use of com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView in project midpoint by Evolveum.

the class NewObjectCreationPopup method initLayout.

private void initLayout() {
    MultiCompositedButtonPanel buttonPanel = new MultiCompositedButtonPanel(ID_NEW_OBJECT_SELECTION_BUTTON_PANEL, getModel()) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void buttonClickPerformed(AjaxRequestTarget target, AssignmentObjectRelation relationSpec, CompiledObjectCollectionView collectionViews, Class<? extends WebPage> page) {
            NewObjectCreationPopup.this.buttonClickPerformed(target, relationSpec, collectionViews, page);
        }
    };
    buttonPanel.setOutputMarkupId(true);
    add(buttonPanel);
    AjaxButton cancel = new AjaxButton(ID_BUTTON_CANCEL, createStringResource("PageBase.button.cancel")) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            cancelPerformed(target);
        }
    };
    add(cancel);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) WebPage(org.apache.wicket.markup.html.WebPage) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) CompiledObjectCollectionView(com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView) MultiCompositedButtonPanel(com.evolveum.midpoint.web.component.MultiCompositedButtonPanel) AssignmentObjectRelation(com.evolveum.midpoint.model.api.AssignmentObjectRelation)

Aggregations

CompiledObjectCollectionView (com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView)41 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)14 AssignmentObjectRelation (com.evolveum.midpoint.model.api.AssignmentObjectRelation)13 WebPage (org.apache.wicket.markup.html.WebPage)8 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)7 MainObjectListPanel (com.evolveum.midpoint.gui.api.component.MainObjectListPanel)6 ArrayList (java.util.ArrayList)6 MultiCompositedButtonPanel (com.evolveum.midpoint.web.component.MultiCompositedButtonPanel)5 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)5 UserProfileStorage (com.evolveum.midpoint.web.session.UserProfileStorage)5 MultiFunctinalButtonDto (com.evolveum.midpoint.web.component.MultiFunctinalButtonDto)4 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)4 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)4 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)3 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)3 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)3 ButtonInlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem)3 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)3 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)3 Form (org.apache.wicket.markup.html.form.Form)3