Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
Conflicts:
	gui/admin-gui/src/main/resources/localization/Midpoint.properties
  • Loading branch information
KaterynaHonchar committed Oct 14, 2016
2 parents 08c0ac0 + 739863c commit 9ff8ee5
Show file tree
Hide file tree
Showing 8 changed files with 389 additions and 201 deletions.
@@ -0,0 +1,39 @@
<!--
~ Copyright (c) 2010-2013 Evolveum
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<wicket:panel xmlns:wicket="http://wicket.apache.org">

<div wicket:id="objectDeltaOperationMarkup" class="box">
<table class="table table-striped">
<tr>
<td><wicket:message key="ObjectDeltaOperationType.resourceName" /></td>
<td><span wicket:id="resourceName" /></td>
</tr>
<tr>
<td><wicket:message
key="ObjectDeltaOperationType.objectName" /></td>
<td><span wicket:id="objectName" /></td>
</tr>
<tr>
<td><wicket:message key="ObjectDeltaOperationType.executionResult" /></td>
<td><span wicket:id="executionResult" /></td>
</tr>
</table>

<div wicket:id="deltaPanel" />
</div>

</wicket:panel>
@@ -0,0 +1,153 @@
package com.evolveum.midpoint.gui.api.component.delta;

import org.apache.wicket.AttributeModifier;
import org.apache.wicket.RestartResponseException;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;

import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.model.api.visualizer.Scene;
import com.evolveum.midpoint.prism.delta.ObjectDelta;
import com.evolveum.midpoint.schema.DeltaConvertor;
import com.evolveum.midpoint.schema.ObjectDeltaOperation;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.prism.show.SceneDto;
import com.evolveum.midpoint.web.component.prism.show.ScenePanel;
import com.evolveum.midpoint.web.component.prism.show.WrapperScene;
import com.evolveum.midpoint.web.page.admin.reports.PageNewReport;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectDeltaOperationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultStatusType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType;
import com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType;

public class ObjectDeltaOperationPanel extends BasePanel<ObjectDeltaOperationType> {

private static final long serialVersionUID = 1L;

private static final Trace LOGGER = TraceManager.getTrace(ObjectDeltaOperationPanel.class);

private static final String ID_PARAMETERS_DELTA = "delta";
private static final String ID_PARAMETERS_EXECUTION_RESULT = "executionResult";
private static final String ID_PARAMETERS_OBJECT_NAME = "objectName";
private static final String ID_PARAMETERS_RESOURCE_NAME = "resourceName";

private static final String ID_DELTA_PANEL = "deltaPanel";
private static final String ID_OBJECT_DELTA_OPERATION_MARKUP = "objectDeltaOperationMarkup";
PageBase parentPage;

public ObjectDeltaOperationPanel(String id, IModel<ObjectDeltaOperationType> model, PageBase parentPage) {
super(id, model);
this.parentPage = parentPage;
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);

IModel<SceneDto> deltaModel = new AbstractReadOnlyModel<SceneDto>() {
private static final long serialVersionUID = 1L;

public SceneDto getObject() {
return loadSceneForDelta();
}

};
ScenePanel deltaPanel = new ScenePanel(ID_DELTA_PANEL, deltaModel) {
@Override
public void headerOnClickPerformed(AjaxRequestTarget target, IModel<SceneDto> model) {
super.headerOnClickPerformed(target, model);
// model.getObject();
target.add(ObjectDeltaOperationPanel.this);
}
};
deltaPanel.setOutputMarkupId(true);
objectDeltaOperationMarkup.add(deltaPanel);

}

private String getBoxCssClass() {
if (getModel().getObject() == null) {
return " box-primary";
}

if (getModel().getObject().getExecutionResult() == null) {
return " box-primary";
}

if (getModel().getObject().getExecutionResult().getStatus() == null) {
return " box-primary";
}

OperationResultStatusType status = getModel().getObject().getExecutionResult().getStatus();
switch (status) {
case PARTIAL_ERROR :
case FATAL_ERROR : return " box-danger";
case WARNING :
case UNKNOWN :
case HANDLED_ERROR : return " box-warning";
case IN_PROGRESS : return " box-primary";
case NOT_APPLICABLE : return " box-primary";
case SUCCESS : return " box-success";

}
return " box-primary";

}

private SceneDto loadSceneForDelta() {
Scene scene = null;

ObjectDelta<? extends ObjectType> delta;
try {
delta = DeltaConvertor.createObjectDelta(getModel().getObject().getObjectDelta(),
parentPage.getPrismContext());

scene = parentPage.getModelInteractionService().visualizeDelta(delta,
parentPage.createSimpleTask(ID_PARAMETERS_DELTA),
new OperationResult(ID_PARAMETERS_DELTA));
} catch (SchemaException e) {
return null;
}
SceneDto deltaSceneDto = new SceneDto(scene);
deltaSceneDto.setMinimized(true);
return deltaSceneDto;

}

}
Expand Up @@ -14,87 +14,91 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:wicket="http://wicket.apache.org">
<body>
<wicket:extend>
<wicket:extend>

<div wicket:id="eventPanel">
<div wicket:id="eventPanel">

<div wicket:id="eventDetailsPanel" class="col-md-6">
<div class="box box-success">
<table class="table table-striped">
<tr>
<td><wicket:message key="PageAuditLogDetails.eventTimestamp" /></td>
<td><span wicket:id="timestamp"/></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.eventIdentifier" /></td>
<td><span wicket:id="eventIdentifier"/></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.eventType" /></td>
<td><span wicket:id="eventType" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.eventStage" /></td>
<td><span wicket:id="eventStage" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.eventInitiatorRef" /></td>
<td><span wicket:id="initiatorRef" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.eventTargetRef" /></td>
<td><span wicket:id="targetRef" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.eventTargetOwnerRef" /></td>
<td><span wicket:id="targetOwnerRef"/></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.eventResult" /></td>
<td><span wicket:id="result" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.eventOutcome" /></td>
<td><span wicket:id="outcome" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.sessionIdentifier" /></td>
<td><span wicket:id="sessionIdentifier"/></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.taskIdentifier" /></td>
<td><span wicket:id="taskIdentifier"/></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.taskOID" /></td>
<td><span wicket:id="taskOID"/></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.hostIdentifier" /></td>
<td><span wicket:id="hostIdentifier"/></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.channel" /></td>
<td><span wicket:id="channel"/></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.parameter" /></td>
<td><span wicket:id="parameter"/></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.message" /></td>
<td><span wicket:id="message"/></td>
</tr>
</table>
</div>
</div>
<div wicket:id="deltaPanel" class="col-md-6">

</div>
</div>

</wicket:extend>
<div wicket:id="eventDetailsPanel" class="col-md-6">
<div class="box box-success">
<table class="table table-striped">
<tr>
<td><wicket:message key="PageAuditLogDetails.eventTimestamp" /></td>
<td><span wicket:id="timestamp" /></td>
</tr>
<tr>
<td><wicket:message
key="PageAuditLogDetails.eventIdentifier" /></td>
<td><span wicket:id="eventIdentifier" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.eventType" /></td>
<td><span wicket:id="eventType" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.eventStage" /></td>
<td><span wicket:id="eventStage" /></td>
</tr>
<tr>
<td><wicket:message
key="PageAuditLogDetails.eventInitiatorRef" /></td>
<td><span wicket:id="initiatorRef" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.eventTargetRef" /></td>
<td><span wicket:id="targetRef" /></td>
</tr>
<tr>
<td><wicket:message
key="PageAuditLogDetails.eventTargetOwnerRef" /></td>
<td><span wicket:id="targetOwnerRef" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.eventResult" /></td>
<td><span wicket:id="result" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.eventOutcome" /></td>
<td><span wicket:id="outcome" /></td>
</tr>
<tr>
<td><wicket:message
key="PageAuditLogDetails.sessionIdentifier" /></td>
<td><span wicket:id="sessionIdentifier" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.taskIdentifier" /></td>
<td><span wicket:id="taskIdentifier" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.taskOID" /></td>
<td><span wicket:id="taskOID" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.hostIdentifier" /></td>
<td><span wicket:id="hostIdentifier" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.channel" /></td>
<td><span wicket:id="channel" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.parameter" /></td>
<td><span wicket:id="parameter" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.message" /></td>
<td><span wicket:id="message" /></td>
</tr>
</table>
</div>
</div>
<div class="col-md-6">
<div wicket:id="deltaListPanel"></div>
</div>
</div>
</wicket:extend>
</body>
</html>

0 comments on commit 9ff8ee5

Please sign in to comment.