Search in sources :

Example 1 with SceneDto

use of com.evolveum.midpoint.web.component.prism.show.SceneDto in project midpoint by Evolveum.

the class TaskDto method createTaskChangesDto.

private static TaskChangesDto createTaskChangesDto(String titleKey, String boxClassOverride, ObjectTreeDeltas deltas, ModelInteractionService modelInteractionService, PrismContext prismContext, Task opTask, OperationResult result) throws SchemaException, ExpressionEvaluationException {
    ObjectTreeDeltasType deltasType = ObjectTreeDeltas.toObjectTreeDeltasType(deltas);
    Scene scene = SceneUtil.visualizeObjectTreeDeltas(deltasType, titleKey, prismContext, modelInteractionService, opTask, result);
    SceneDto sceneDto = new SceneDto(scene);
    sceneDto.setBoxClassOverride(boxClassOverride);
    return new TaskChangesDto(sceneDto);
}
Also used : SceneDto(com.evolveum.midpoint.web.component.prism.show.SceneDto) Scene(com.evolveum.midpoint.model.api.visualizer.Scene)

Example 2 with SceneDto

use of com.evolveum.midpoint.web.component.prism.show.SceneDto in project midpoint by Evolveum.

the class TaskDto method objectTreeDeltasToDeltaDtoList.

private List<SceneDto> objectTreeDeltasToDeltaDtoList(ObjectTreeDeltasType deltas, PrismContext prismContext, ModelInteractionService modelInteractionService, Task opTask, OperationResult thisOpResult) throws SchemaException, ExpressionEvaluationException {
    List<SceneDto> retval = new ArrayList<>();
    if (deltas == null) {
        return retval;
    }
    Scene wrapperScene = SceneUtil.visualizeObjectTreeDeltas(deltas, "", prismContext, modelInteractionService, opTask, thisOpResult);
    for (Scene scene : wrapperScene.getPartialScenes()) {
        retval.add(new SceneDto(scene));
    }
    return retval;
}
Also used : SceneDto(com.evolveum.midpoint.web.component.prism.show.SceneDto) ArrayList(java.util.ArrayList) Scene(com.evolveum.midpoint.model.api.visualizer.Scene)

Example 3 with SceneDto

use of com.evolveum.midpoint.web.component.prism.show.SceneDto in project midpoint by Evolveum.

the class ObjectDeltaOperationPanel method initLayout.

private void initLayout() {
    // ObjectDeltaType od = getModel().getObjectDelta();
    WebMarkupContainer objectDeltaOperationMarkup = new WebMarkupContainer(ID_OBJECT_DELTA_OPERATION_MARKUP);
    objectDeltaOperationMarkup.setOutputMarkupId(true);
    objectDeltaOperationMarkup.add(AttributeModifier.append("class", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return getBoxCssClass();
        }
    }));
    add(objectDeltaOperationMarkup);
    Label executionResult = new Label(ID_PARAMETERS_EXECUTION_RESULT, new PropertyModel(getModel(), "executionResult.status"));
    executionResult.setOutputMarkupId(true);
    objectDeltaOperationMarkup.add(executionResult);
    Label resourceName = new Label(ID_PARAMETERS_RESOURCE_NAME, new PropertyModel(getModel(), ObjectDeltaOperationType.F_RESOURCE_NAME.getLocalPart()));
    resourceName.setOutputMarkupId(true);
    objectDeltaOperationMarkup.add(resourceName);
    Label objectName = new Label(ID_PARAMETERS_OBJECT_NAME, new PropertyModel(getModel(), ObjectDeltaOperationType.F_OBJECT_NAME.getLocalPart()));
    objectName.setOutputMarkupId(true);
    objectDeltaOperationMarkup.add(objectName);
    final SceneDto sceneDto;
    try {
        sceneDto = loadSceneForDelta();
    } catch (SchemaException | ExpressionEvaluationException e) {
        OperationResult result = new OperationResult(ObjectDeltaOperationPanel.class.getName() + ".loadSceneForDelta");
        result.recordFatalError("Couldn't fetch or visualize the delta: " + e.getMessage(), e);
        parentPage.showResult(result);
        throw parentPage.redirectBackViaRestartResponseException();
    }
    IModel<SceneDto> deltaModel = new AbstractReadOnlyModel<SceneDto>() {

        private static final long serialVersionUID = 1L;

        public SceneDto getObject() {
            return sceneDto;
        }
    };
    ScenePanel deltaPanel = new ScenePanel(ID_DELTA_PANEL, deltaModel) {

        @Override
        public void headerOnClickPerformed(AjaxRequestTarget target, IModel<SceneDto> model) {
            super.headerOnClickPerformed(target, model);
            //				model.getObject().setMinimized(!model.getObject().isMinimized());
            target.add(ObjectDeltaOperationPanel.this);
        }
    };
    deltaPanel.setOutputMarkupId(true);
    objectDeltaOperationMarkup.add(deltaPanel);
}
Also used : AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) ScenePanel(com.evolveum.midpoint.web.component.prism.show.ScenePanel) ExpressionEvaluationException(com.evolveum.midpoint.util.exception.ExpressionEvaluationException) IModel(org.apache.wicket.model.IModel) Label(org.apache.wicket.markup.html.basic.Label) PropertyModel(org.apache.wicket.model.PropertyModel) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) SceneDto(com.evolveum.midpoint.web.component.prism.show.SceneDto)

Example 4 with SceneDto

use of com.evolveum.midpoint.web.component.prism.show.SceneDto in project midpoint by Evolveum.

the class ObjectDeltaOperationPanel method loadSceneForDelta.

private SceneDto loadSceneForDelta() throws SchemaException, ExpressionEvaluationException {
    Scene scene;
    ObjectDelta<? extends ObjectType> delta;
    ObjectDeltaType deltaType = getModel().getObject().getObjectDelta();
    try {
        delta = DeltaConvertor.createObjectDelta(deltaType, parentPage.getPrismContext());
    } catch (SchemaException e) {
        LoggingUtils.logException(LOGGER, "SchemaException while converting delta:\n{}", e, deltaType);
        throw e;
    }
    try {
        scene = parentPage.getModelInteractionService().visualizeDelta(delta, parentPage.createSimpleTask(ID_PARAMETERS_DELTA), new OperationResult(ID_PARAMETERS_DELTA));
    } catch (SchemaException | ExpressionEvaluationException e) {
        LoggingUtils.logException(LOGGER, "SchemaException while visualizing delta:\n{}", e, DebugUtil.debugDump(delta));
        throw e;
    }
    SceneDto deltaSceneDto = new SceneDto(scene);
    deltaSceneDto.setMinimized(true);
    return deltaSceneDto;
}
Also used : ObjectDeltaType(com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) ExpressionEvaluationException(com.evolveum.midpoint.util.exception.ExpressionEvaluationException) SceneDto(com.evolveum.midpoint.web.component.prism.show.SceneDto) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Scene(com.evolveum.midpoint.model.api.visualizer.Scene)

Example 5 with SceneDto

use of com.evolveum.midpoint.web.component.prism.show.SceneDto in project midpoint by Evolveum.

the class ModelOperationStatusPanel method initLayout.

protected void initLayout() {
    add(new Label(ID_STATE, new StringResourceModel("ModelOperationStatusPanel.state.${}", new PropertyModel<ModelState>(getModel(), ModelOperationStatusDto.F_STATE))));
    //        add(new Label(ID_FOCUS_TYPE, new PropertyModel<String>(getModel(), ModelOperationStatusDto.F_FOCUS_TYPE)));
    //        add(new Label(ID_FOCUS_NAME, new PropertyModel<String>(getModel(), ModelOperationStatusDto.F_FOCUS_NAME)));
    ScenePanel deltaPanel = new ScenePanel(ID_PRIMARY_DELTA, new PropertyModel<SceneDto>(getModel(), ModelOperationStatusDto.F_PRIMARY_DELTA));
    deltaPanel.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return getModelObject() != null && getModelObject().getPrimaryDelta() != null;
        }
    });
    add(deltaPanel);
}
Also used : ScenePanel(com.evolveum.midpoint.web.component.prism.show.ScenePanel) SceneDto(com.evolveum.midpoint.web.component.prism.show.SceneDto) Label(org.apache.wicket.markup.html.basic.Label) ModelState(com.evolveum.midpoint.model.api.context.ModelState) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) StringResourceModel(org.apache.wicket.model.StringResourceModel)

Aggregations

SceneDto (com.evolveum.midpoint.web.component.prism.show.SceneDto)7 Scene (com.evolveum.midpoint.model.api.visualizer.Scene)5 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)2 ExpressionEvaluationException (com.evolveum.midpoint.util.exception.ExpressionEvaluationException)2 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)2 ScenePanel (com.evolveum.midpoint.web.component.prism.show.ScenePanel)2 Label (org.apache.wicket.markup.html.basic.Label)2 ModelState (com.evolveum.midpoint.model.api.context.ModelState)1 ObjectTreeDeltas (com.evolveum.midpoint.schema.ObjectTreeDeltas)1 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)1 ObjectDeltaType (com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType)1 ArrayList (java.util.ArrayList)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)1 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)1 IModel (org.apache.wicket.model.IModel)1 PropertyModel (org.apache.wicket.model.PropertyModel)1 StringResourceModel (org.apache.wicket.model.StringResourceModel)1