Search in sources :

Example 91 with ObjectType

use of org.mitre.cybox.cybox_2.ObjectType in project midpoint by Evolveum.

the class OrgUnitAddDeletePopup method initLayout.

public void initLayout(WebMarkupContainer content) {
    List<IColumn<SelectableBeanImpl<ObjectType>, String>> columns = initColumns();
    ObjectQuery query = getDataProviderQuery();
    ObjectDataProvider provider = new ObjectDataProvider(getPageBase(), null) {

        @Override
        public ObjectQuery getQuery() {
            return query;
        }

        @Override
        public Class getType() {
            return OrgType.class;
        }
    };
    TablePanel table = new TablePanel<>(ID_TABLE, provider, columns);
    table.setOutputMarkupId(true);
    content.add(table);
    AjaxButton cancelButton = new AjaxButton(ID_BUTTON_CANCEL, createStringResource("orgUnitAddDeletePopup.button.cancel")) {

        @Override
        public void onClick(AjaxRequestTarget ajaxRequestTarget) {
            cancelPerformed(ajaxRequestTarget);
        }
    };
    content.add(cancelButton);
    AjaxButton actionButton = new AjaxButton(ID_BUTTON_ACTION, createActionButtonStringResource()) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            actionPerformed(target);
        }
    };
    actionButton.add(new AttributeAppender("class", getActionButtonClass()));
    content.add(actionButton);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) OrgType(com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery) AttributeAppender(org.apache.wicket.behavior.AttributeAppender) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Example 92 with ObjectType

use of org.mitre.cybox.cybox_2.ObjectType in project midpoint by Evolveum.

the class MidpointAbstractProvider method writeTo.

@Override
public void writeTo(T object, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException {
    // TODO implement in the standard serializer; also change root name
    QName fakeQName = new QName(PrismConstants.NS_TYPES, "object");
    String serializedForm;
    PrismSerializer<String> serializer = getSerializer().options(SerializationOptions.createSerializeReferenceNames());
    try {
        if (object instanceof ObjectType) {
            ObjectType ot = (ObjectType) object;
            serializedForm = serializer.serialize(ot.asPrismObject());
        } else if (object instanceof PrismObject) {
            serializedForm = serializer.serialize((PrismObject<?>) object);
        } else if (object instanceof OperationResult) {
            Function<LocalizableMessage, String> resolveKeys = msg -> localizationService.translate(msg, Locale.US);
            OperationResultType operationResultType = ((OperationResult) object).createOperationResultType(resolveKeys);
            serializedForm = serializer.serializeAnyData(operationResultType, fakeQName);
        } else {
            serializedForm = serializer.serializeAnyData(object, fakeQName);
        }
        entityStream.write(serializedForm.getBytes(StandardCharsets.UTF_8));
    } catch (SchemaException | RuntimeException e) {
        LoggingUtils.logException(LOGGER, "Couldn't marshal element to string: {}", e, object);
    }
}
Also used : Arrays(java.util.Arrays) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Autowired(org.springframework.beans.factory.annotation.Autowired) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) MessageBodyWriter(javax.ws.rs.ext.MessageBodyWriter) Trace(com.evolveum.midpoint.util.logging.Trace) LocalizationService(com.evolveum.midpoint.common.LocalizationService) Function(java.util.function.Function) AbstractConfigurableProvider(org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) MediaType(javax.ws.rs.core.MediaType) Locale(java.util.Locale) LocalizableMessage(com.evolveum.midpoint.util.LocalizableMessage) com.evolveum.midpoint.prism(com.evolveum.midpoint.prism) OutputStream(java.io.OutputStream) IOException(java.io.IOException) StandardCharsets(java.nio.charset.StandardCharsets) LoggingUtils(com.evolveum.midpoint.util.logging.LoggingUtils) MultivaluedMap(javax.ws.rs.core.MultivaluedMap) List(java.util.List) Type(java.lang.reflect.Type) SystemException(com.evolveum.midpoint.util.exception.SystemException) Annotation(java.lang.annotation.Annotation) Optional(java.util.Optional) WebApplicationException(javax.ws.rs.WebApplicationException) ClassResourceInfo(org.apache.cxf.jaxrs.model.ClassResourceInfo) QName(javax.xml.namespace.QName) TraceManager(com.evolveum.midpoint.util.logging.TraceManager) InputStream(java.io.InputStream) MessageBodyReader(javax.ws.rs.ext.MessageBodyReader) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) QName(javax.xml.namespace.QName) LocalizableMessage(com.evolveum.midpoint.util.LocalizableMessage) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType)

Example 93 with ObjectType

use of org.mitre.cybox.cybox_2.ObjectType in project midpoint by Evolveum.

the class MultiValueObjectChoosePanel method initEmptyModelInputPanel.

private void initEmptyModelInputPanel() {
    WebMarkupContainer emptyModelContainer = new WebMarkupContainer(ID_EMPTY_MODEL_CONTAINER);
    emptyModelContainer.setOutputMarkupId(true);
    emptyModelContainer.add(new VisibleBehaviour(() -> isEmptyModel() || emptyObjectPanelDisplay));
    add(emptyModelContainer);
    ValueChoosePanel<R> emptyModelPanel = new ValueChoosePanel<R>(ID_EMPTY_MODEL_INPUT, new IModel<R>() {

        @Override
        public R getObject() {
            return null;
        }
    }) {

        private static final long serialVersionUID = 1L;

        @Override
        protected ObjectFilter createCustomFilter() {
            return MultiValueObjectChoosePanel.this.createCustomFilter();
        }

        @Override
        public List<QName> getSupportedTypes() {
            return MultiValueObjectChoosePanel.this.getSupportedTypes();
        }

        @Override
        protected <O extends ObjectType> void choosePerformed(AjaxRequestTarget target, O object) {
            emptyObjectPanelDisplay = false;
            chooseObjectPerformed(target, object);
            target.add(MultiValueObjectChoosePanel.this);
        }
    };
    emptyModelPanel.setOutputMarkupId(true);
    emptyModelContainer.add(emptyModelPanel);
    WebMarkupContainer buttonsWhenEmptyContainer = new WebMarkupContainer(ID_BUTTONS_WHEN_EMPTY_CONTAINER);
    buttonsWhenEmptyContainer.setOutputMarkupId(true);
    emptyModelContainer.add(buttonsWhenEmptyContainer);
    AjaxButton addWhenEmptyButton = new AjaxButton(ID_ADD_WHEN_EMPTY_BUTTON) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
        // will be disabled all the time, nothing to do here
        }
    };
    addWhenEmptyButton.setOutputMarkupId(true);
    addWhenEmptyButton.add(new EnableBehaviour(() -> false));
    buttonsWhenEmptyContainer.add(addWhenEmptyButton);
    AjaxButton removeWhenEmptyButton = new AjaxButton(ID_REMOVE_WHEN_EMPTY_BUTTON) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
        // will be disabled all the time, nothing to do here
        }
    };
    removeWhenEmptyButton.setOutputMarkupId(true);
    removeWhenEmptyButton.add(new EnableBehaviour(() -> false));
    buttonsWhenEmptyContainer.add(removeWhenEmptyButton);
}
Also used : VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) QName(javax.xml.namespace.QName) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) ValueChoosePanel(com.evolveum.midpoint.web.component.form.ValueChoosePanel) EnableBehaviour(com.evolveum.midpoint.web.component.util.EnableBehaviour)

Example 94 with ObjectType

use of org.mitre.cybox.cybox_2.ObjectType in project midpoint by Evolveum.

the class PreviewChangesTabPanel method initModels.

private void initModels() {
    final List<ObjectDelta<? extends ObjectType>> primaryDeltas = new ArrayList<>();
    final List<ObjectDelta<? extends ObjectType>> secondaryDeltas = new ArrayList<>();
    final List<? extends Scene> primaryScenes;
    final List<? extends Scene> secondaryScenes;
    ModelContext<O> modelContext = getModelObject();
    try {
        if (modelContext != null) {
            if (modelContext.getFocusContext() != null) {
                addIgnoreNull(primaryDeltas, CloneUtil.clone(modelContext.getFocusContext().getPrimaryDelta()));
                ObjectDelta<O> summarySecondaryDelta = CloneUtil.clone(modelContext.getFocusContext().getSummarySecondaryDelta());
                if (summarySecondaryDelta != null && !summarySecondaryDelta.getModifications().isEmpty()) {
                    secondaryDeltas.add(summarySecondaryDelta);
                }
            }
            for (ModelProjectionContext projCtx : modelContext.getProjectionContexts()) {
                ObjectDelta<ShadowType> primaryDelta = CloneUtil.clone(projCtx.getPrimaryDelta());
                addIgnoreNull(primaryDeltas, primaryDelta);
                if (!isEquivalentWithoutOperationAttr(primaryDelta, CloneUtil.clone(projCtx.getExecutableDelta()))) {
                    addIgnoreNull(secondaryDeltas, CloneUtil.clone(projCtx.getExecutableDelta()));
                }
            }
        }
        if (LOGGER.isTraceEnabled()) {
            LOGGER.trace("Primary deltas:\n{}", DebugUtil.debugDump(primaryDeltas));
            LOGGER.trace("Secondary deltas:\n{}", DebugUtil.debugDump(secondaryDeltas));
        }
        Task task = getPageBase().createSimpleTask("visualize");
        primaryScenes = getPageBase().getModelInteractionService().visualizeDeltas(primaryDeltas, task, task.getResult());
        secondaryScenes = getPageBase().getModelInteractionService().visualizeDeltas(secondaryDeltas, task, task.getResult());
    } catch (SchemaException | ExpressionEvaluationException e) {
        // TODO
        throw new SystemException(e);
    }
    if (LOGGER.isTraceEnabled()) {
        LOGGER.trace("Creating context DTO for primary deltas:\n{}", DebugUtil.debugDump(primaryScenes));
        LOGGER.trace("Creating context DTO for secondary deltas:\n{}", DebugUtil.debugDump(secondaryScenes));
    }
    final WrapperScene primaryScene = new WrapperScene(primaryScenes, primaryScenes.size() != 1 ? "PagePreviewChanges.primaryChangesMore" : "PagePreviewChanges.primaryChangesOne", primaryScenes.size());
    final WrapperScene secondaryScene = new WrapperScene(secondaryScenes, secondaryScenes.size() != 1 ? "PagePreviewChanges.secondaryChangesMore" : "PagePreviewChanges.secondaryChangesOne", secondaryScenes.size());
    final SceneDto primarySceneDto = new SceneDto(primaryScene);
    final SceneDto secondarySceneDto = new SceneDto(secondaryScene);
    primaryDeltasModel = (IModel<SceneDto>) () -> primarySceneDto;
    secondaryDeltasModel = (IModel<SceneDto>) () -> secondarySceneDto;
    PolicyRuleEnforcerPreviewOutputType enforcements = modelContext != null ? modelContext.getPolicyRuleEnforcerPreviewOutput() : null;
    List<EvaluatedTriggerGroupDto> triggerGroups = enforcements != null ? Collections.singletonList(EvaluatedTriggerGroupDto.initializeFromRules(enforcements.getRule(), false, null)) : Collections.emptyList();
    policyViolationsModel = Model.ofList(triggerGroups);
    List<ApprovalSchemaExecutionInformationType> approvalsExecutionList = modelContext != null ? modelContext.getHookPreviewResults(ApprovalSchemaExecutionInformationType.class) : Collections.emptyList();
    List<ApprovalProcessExecutionInformationDto> approvals = new ArrayList<>();
    if (!approvalsExecutionList.isEmpty()) {
        // TODO
        Task opTask = getPageBase().createSimpleTask(PagePreviewChanges.class + ".createApprovals");
        OperationResult result = opTask.getResult();
        ObjectResolver modelObjectResolver = getPageBase().getModelObjectResolver();
        try {
            for (ApprovalSchemaExecutionInformationType execution : approvalsExecutionList) {
                approvals.add(ApprovalProcessExecutionInformationDto.createFrom(execution, modelObjectResolver, true, opTask, // TODO reuse session
                result));
            }
            result.computeStatus();
        } catch (Throwable t) {
            LoggingUtils.logUnexpectedException(LOGGER, "Couldn't prepare approval information", t);
            result.recordFatalError(createStringResource("PreviewChangesTabPanel.message.prepareApproval.fatalError", t.getMessage()).getString(), t);
        }
        if (WebComponentUtil.showResultInPage(result)) {
            getPageBase().showResult(result);
        }
    }
    approvalsModel = Model.ofList(approvals);
}
Also used : Task(com.evolveum.midpoint.task.api.Task) ExpressionEvaluationException(com.evolveum.midpoint.util.exception.ExpressionEvaluationException) ArrayList(java.util.ArrayList) ObjectResolver(com.evolveum.midpoint.repo.common.ObjectResolver) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) ApprovalProcessExecutionInformationDto(com.evolveum.midpoint.web.page.admin.workflow.dto.ApprovalProcessExecutionInformationDto) SystemException(com.evolveum.midpoint.util.exception.SystemException) ApprovalSchemaExecutionInformationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ApprovalSchemaExecutionInformationType) ModelProjectionContext(com.evolveum.midpoint.model.api.context.ModelProjectionContext) ObjectDelta(com.evolveum.midpoint.prism.delta.ObjectDelta) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) PolicyRuleEnforcerPreviewOutputType(com.evolveum.midpoint.xml.ns._public.common.common_3.PolicyRuleEnforcerPreviewOutputType) EvaluatedTriggerGroupDto(com.evolveum.midpoint.web.page.admin.workflow.dto.EvaluatedTriggerGroupDto)

Example 95 with ObjectType

use of org.mitre.cybox.cybox_2.ObjectType in project midpoint by Evolveum.

the class ScenePanel method initLayout.

private void initLayout() {
    final IModel<SceneDto> model = getModel();
    WebMarkupContainer box = new WebMarkupContainer(ID_BOX);
    box.add(AttributeModifier.append("class", new IModel<String>() {

        @Override
        public String getObject() {
            SceneDto dto = model.getObject();
            if (dto.getBoxClassOverride() != null) {
                return dto.getBoxClassOverride();
            }
            if (dto.getChangeType() == null) {
                return null;
            }
            switch(dto.getChangeType()) {
                case ADD:
                    return "box-success";
                case DELETE:
                    return "box-danger";
                case MODIFY:
                    return "box-info";
                default:
                    return null;
            }
        }
    }));
    add(box);
    WebMarkupContainer headerPanel = new WebMarkupContainer(ID_HEADER_PANEL);
    box.add(headerPanel);
    headerPanel.add(new SceneButtonPanel(ID_OPTION_BUTTONS, model) {

        @Override
        public void minimizeOnClick(AjaxRequestTarget target) {
            headerOnClickPerformed(target, model);
        }
    });
    Label headerChangeType = new Label(ID_HEADER_CHANGE_TYPE, new ChangeTypeModel());
    // headerChangeType.setRenderBodyOnly(true);
    Label headerObjectType = new Label(ID_HEADER_OBJECT_TYPE, new ObjectTypeModel());
    // headerObjectType.setRenderBodyOnly(true);
    IModel<String> nameModel = new IModel<String>() {

        @Override
        public String getObject() {
            return model.getObject().getName(ScenePanel.this);
        }
    };
    Label headerNameLabel = new Label(ID_HEADER_NAME_LABEL, nameModel);
    AjaxLinkPanel headerNameLink = new AjaxLinkPanel(ID_HEADER_NAME_LINK, nameModel) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            PrismContainerValue<?> value = getModelObject().getScene().getSourceValue();
            if (value != null && value.getParent() instanceof PrismObject) {
                PrismObject<? extends ObjectType> object = (PrismObject<? extends ObjectType>) value.getParent();
                WebComponentUtil.dispatchToObjectDetailsPage(ObjectTypeUtil.createObjectRef(object, getPageBase().getPrismContext()), getPageBase(), false);
            }
        }
    };
    Label headerDescription = new Label(ID_HEADER_DESCRIPTION, new IModel<String>() {

        @Override
        public String getObject() {
            return model.getObject().getDescription(ScenePanel.this);
        }
    });
    Label headerWrapperDisplayName = new Label(ID_HEADER_WRAPPER_DISPLAY_NAME, new IModel<String>() {

        @Override
        public String getObject() {
            String key = ((WrapperScene) getModelObject().getScene()).getDisplayNameKey();
            Object[] parameters = ((WrapperScene) getModelObject().getScene()).getDisplayNameParameters();
            return new StringResourceModel(key, this).setModel(null).setDefaultValue(key).setParameters(parameters).getObject();
        }
    });
    headerPanel.add(headerChangeType);
    headerPanel.add(headerObjectType);
    headerPanel.add(headerNameLabel);
    headerPanel.add(headerNameLink);
    headerPanel.add(headerDescription);
    headerPanel.add(headerWrapperDisplayName);
    headerChangeType.add(createHeaderOnClickBehaviour(model));
    headerObjectType.add(createHeaderOnClickBehaviour(model));
    headerNameLabel.add(createHeaderOnClickBehaviour(model));
    headerDescription.add(createHeaderOnClickBehaviour(model));
    headerWrapperDisplayName.add(createHeaderOnClickBehaviour(model));
    VisibleEnableBehaviour visibleIfNotWrapper = new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return !getModelObject().isWrapper();
        }
    };
    VisibleEnableBehaviour visibleIfWrapper = new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return getModelObject().isWrapper();
        }
    };
    VisibleEnableBehaviour visibleIfExistingObjectAndAuthorized = new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            if (getModelObject().isWrapper()) {
                return false;
            }
            return isExistingViewableObject() && isAutorized();
        }
    };
    VisibleEnableBehaviour visibleIfNotWrapperAndNotExistingObjectAndNotAuthorized = new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            if (getModelObject().isWrapper()) {
                return false;
            }
            return !isExistingViewableObject() || !isAutorized();
        }
    };
    headerChangeType.add(visibleIfNotWrapper);
    headerObjectType.add(visibleIfNotWrapper);
    headerNameLabel.add(visibleIfNotWrapperAndNotExistingObjectAndNotAuthorized);
    headerNameLink.add(visibleIfExistingObjectAndAuthorized);
    headerDescription.add(visibleIfNotWrapper);
    headerWrapperDisplayName.add(visibleIfWrapper);
    WebMarkupContainer body = new WebMarkupContainer(ID_BODY);
    body.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            SceneDto wrapper = model.getObject();
            return !wrapper.isMinimized();
        }
    });
    box.add(body);
    WebMarkupContainer itemsTable = new WebMarkupContainer(ID_ITEMS_TABLE);
    itemsTable.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return !model.getObject().getItems().isEmpty();
        }
    });
    itemsTable.setOutputMarkupId(true);
    ToggleIconButton<String> sortPropertiesButton = new ToggleIconButton<String>(ID_SORT_PROPERTIES, GuiStyleConstants.CLASS_ICON_SORT_ALPHA_ASC, GuiStyleConstants.CLASS_ICON_SORT_AMOUNT_ASC) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            onSortClicked(model, target);
        }

        @Override
        public boolean isOn() {
            return model.getObject().isSorted();
        }
    };
    sortPropertiesButton.setOutputMarkupId(true);
    sortPropertiesButton.setOutputMarkupPlaceholderTag(true);
    itemsTable.add(sortPropertiesButton);
    WebMarkupContainer oldValueLabel = new WebMarkupContainer(ID_OLD_VALUE_LABEL);
    oldValueLabel.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return model.getObject().containsDeltaItems();
        }
    });
    itemsTable.add(oldValueLabel);
    WebMarkupContainer newValueLabel = new WebMarkupContainer(ID_NEW_VALUE_LABEL);
    newValueLabel.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return model.getObject().containsDeltaItems();
        }
    });
    itemsTable.add(newValueLabel);
    WebMarkupContainer valueLabel = new WebMarkupContainer(ID_VALUE_LABEL);
    valueLabel.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return !model.getObject().containsDeltaItems();
        }
    });
    itemsTable.add(valueLabel);
    ListView<SceneItemDto> items = new ListView<SceneItemDto>(ID_ITEMS, new PropertyModel<>(model, SceneDto.F_ITEMS)) {

        @Override
        protected void populateItem(ListItem<SceneItemDto> item) {
            SceneItemPanel panel = new SceneItemPanel(ID_ITEM, item.getModel());
            panel.add(new VisibleBehaviour(() -> !isOperationalItem(item.getModel()) || isOperationalItemsVisible()));
            panel.setRenderBodyOnly(true);
            item.add(panel);
        }
    };
    items.setReuseItems(true);
    itemsTable.add(items);
    body.add(itemsTable);
    ListView<SceneDto> partialScenes = new ListView<SceneDto>(ID_PARTIAL_SCENES, new PropertyModel<>(model, SceneDto.F_PARTIAL_SCENES)) {

        @Override
        protected void populateItem(ListItem<SceneDto> item) {
            ScenePanel panel = new ScenePanel(ID_PARTIAL_SCENE, item.getModel()) {

                private static final long serialVersionUID = 1L;

                @Override
                protected boolean isOperationalItemsVisible() {
                    ScenePanel parentScenePanel = findParent(ScenePanel.class);
                    if (parentScenePanel != null) {
                        return parentScenePanel.isOperationalItemsVisible();
                    } else {
                        return ScenePanel.this.operationalItemsVisible;
                    }
                }
            };
            panel.add(new VisibleBehaviour(() -> !isOperationalPartialScene(item.getModel()) || operationalItemsVisible));
            panel.setOutputMarkupPlaceholderTag(true);
            item.add(panel);
        }
    };
    partialScenes.setReuseItems(true);
    body.add(partialScenes);
    AjaxButton showOperationalItemsLink = new AjaxButton(ID_SHOW_OPERATIONAL_ITEMS_LINK) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            setOperationalItemsVisible(!operationalItemsVisible);
            target.add(ScenePanel.this);
        }

        @Override
        public IModel<?> getBody() {
            return getShowOperationalItemsLinkLabel();
        }
    };
    showOperationalItemsLink.setOutputMarkupId(true);
    showOperationalItemsLink.add(AttributeAppender.append("style", "cursor: pointer;"));
    showOperationalItemsLink.add(new VisibleBehaviour(() -> showOperationalItems));
    body.add(showOperationalItemsLink);
}
Also used : ToggleIconButton(com.evolveum.midpoint.gui.api.component.togglebutton.ToggleIconButton) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) Label(org.apache.wicket.markup.html.basic.Label) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) PrismObject(com.evolveum.midpoint.prism.PrismObject) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) ListView(org.apache.wicket.markup.html.list.ListView) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) AjaxLinkPanel(com.evolveum.midpoint.web.component.data.column.AjaxLinkPanel) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ListItem(org.apache.wicket.markup.html.list.ListItem)

Aggregations

ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)243 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)126 Test (org.testng.annotations.Test)97 Task (com.evolveum.midpoint.task.api.Task)82 ObjectDelta (com.evolveum.midpoint.prism.delta.ObjectDelta)79 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)78 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)68 OperationResultType (com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType)55 ArrayList (java.util.ArrayList)51 Holder (javax.xml.ws.Holder)48 QName (javax.xml.namespace.QName)32 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)30 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)29 AbstractModelIntegrationTest (com.evolveum.midpoint.model.test.AbstractModelIntegrationTest)28 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)26 PrismObject (com.evolveum.midpoint.prism.PrismObject)25 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)25 SelectorQualifiedGetOptionsType (com.evolveum.midpoint.xml.ns._public.common.common_3.SelectorQualifiedGetOptionsType)24 SystemConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType)23 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)22