Search in sources :

Example 1 with InformationPartType

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

the class InformationPanel method initLayout.

private void initLayout() {
    Label titleLabel = new Label(ID_TITLE, new PropertyModel<>(getModel(), InformationType.F_TITLE.getLocalPart()));
    titleLabel.add(new VisibleBehaviour(() -> getModelObject().getTitle() != null));
    add(titleLabel);
    ListView<InformationPartType> list = new ListView<InformationPartType>(ID_PARTS, new PropertyModel<>(getModel(), InformationType.F_PART.getLocalPart())) {

        @Override
        protected void populateItem(ListItem<InformationPartType> item) {
            InformationPartType part = item.getModelObject();
            Label label = new Label(ID_PART, part.getText());
            if (Boolean.TRUE.equals(part.isHasMarkup())) {
                label.setEscapeModelStrings(false);
            }
            item.add(label);
        }
    };
    add(list);
}
Also used : ListView(org.apache.wicket.markup.html.list.ListView) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) Label(org.apache.wicket.markup.html.basic.Label) ListItem(org.apache.wicket.markup.html.list.ListItem) InformationPartType(com.evolveum.midpoint.xml.ns._public.common.common_3.InformationPartType)

Example 2 with InformationPartType

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

the class PrepareForTaskCreation method wrapAdditionalInformationIfNeeded.

@SuppressWarnings("unchecked")
private List<InformationType> wrapAdditionalInformationIfNeeded(List<?> data) {
    // data is not empty
    if (data.stream().allMatch(o -> o instanceof String)) {
        InformationType info = new InformationType();
        for (Object o : data) {
            InformationPartType part = new InformationPartType();
            part.setText((String) o);
            info.getPart().add(part);
        }
        return Collections.singletonList(info);
    } else if (data.stream().allMatch(o -> o instanceof InformationType)) {
        return (List<InformationType>) data;
    } else {
        throw new SystemException("Couldn't create 'additional information' structure from list of " + data.stream().map(o -> o != null ? o.getClass().getSimpleName() : null).collect(Collectors.joining(", ", "[", "]")));
    }
}
Also used : SpringApplicationContextHolder.getTaskManager(com.evolveum.midpoint.wf.impl.processes.common.SpringApplicationContextHolder.getTaskManager) SingleItemSerializationSafeContainerImpl(com.evolveum.midpoint.wf.impl.util.SingleItemSerializationSafeContainerImpl) com.evolveum.midpoint.xml.ns._public.common.common_3(com.evolveum.midpoint.xml.ns._public.common.common_3) com.evolveum.midpoint.wf.impl.processes.common(com.evolveum.midpoint.wf.impl.processes.common) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Trace(com.evolveum.midpoint.util.logging.Trace) Task(com.evolveum.midpoint.task.api.Task) MiscDataUtil(com.evolveum.midpoint.wf.impl.util.MiscDataUtil) Collectors(java.util.stream.Collectors) DOMUtil(com.evolveum.midpoint.util.DOMUtil) QNameUtil(com.evolveum.midpoint.util.QNameUtil) JavaDelegate(org.activiti.engine.delegate.JavaDelegate) ExpressionVariables(com.evolveum.midpoint.repo.common.expression.ExpressionVariables) List(java.util.List) SpringApplicationContextHolder.getPrismContext(com.evolveum.midpoint.wf.impl.processes.common.SpringApplicationContextHolder.getPrismContext) ActivitiUtil.getRequiredVariable(com.evolveum.midpoint.wf.impl.processes.common.ActivitiUtil.getRequiredVariable) PrismContext(com.evolveum.midpoint.prism.PrismContext) SystemException(com.evolveum.midpoint.util.exception.SystemException) DelegateExecution(org.activiti.engine.delegate.DelegateExecution) Collections(java.util.Collections) TraceManager(com.evolveum.midpoint.util.logging.TraceManager) SystemException(com.evolveum.midpoint.util.exception.SystemException)

Aggregations

PrismContext (com.evolveum.midpoint.prism.PrismContext)1 ExpressionVariables (com.evolveum.midpoint.repo.common.expression.ExpressionVariables)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 Task (com.evolveum.midpoint.task.api.Task)1 DOMUtil (com.evolveum.midpoint.util.DOMUtil)1 QNameUtil (com.evolveum.midpoint.util.QNameUtil)1 SystemException (com.evolveum.midpoint.util.exception.SystemException)1 Trace (com.evolveum.midpoint.util.logging.Trace)1 TraceManager (com.evolveum.midpoint.util.logging.TraceManager)1 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)1 com.evolveum.midpoint.wf.impl.processes.common (com.evolveum.midpoint.wf.impl.processes.common)1 ActivitiUtil.getRequiredVariable (com.evolveum.midpoint.wf.impl.processes.common.ActivitiUtil.getRequiredVariable)1 SpringApplicationContextHolder.getPrismContext (com.evolveum.midpoint.wf.impl.processes.common.SpringApplicationContextHolder.getPrismContext)1 SpringApplicationContextHolder.getTaskManager (com.evolveum.midpoint.wf.impl.processes.common.SpringApplicationContextHolder.getTaskManager)1 MiscDataUtil (com.evolveum.midpoint.wf.impl.util.MiscDataUtil)1 SingleItemSerializationSafeContainerImpl (com.evolveum.midpoint.wf.impl.util.SingleItemSerializationSafeContainerImpl)1 com.evolveum.midpoint.xml.ns._public.common.common_3 (com.evolveum.midpoint.xml.ns._public.common.common_3)1 InformationPartType (com.evolveum.midpoint.xml.ns._public.common.common_3.InformationPartType)1 Collections (java.util.Collections)1 List (java.util.List)1