use of com.evolveum.midpoint.gui.api.component.result.OpResult in project midpoint by Evolveum.
the class PageBase method showResult.
public OpResult showResult(OperationResult result, String errorMessageKey, boolean showSuccess) {
Validate.notNull(result, "Operation result must not be null.");
Validate.notNull(result.getStatus(), "Operation result status must not be null.");
OperationResult scriptResult = executeResultScriptHook(result);
if (scriptResult == null) {
return null;
}
result = scriptResult;
OpResult opResult = OpResult.getOpResult((PageBase) getPage(), result);
opResult.determineObjectsVisibility(this);
switch(opResult.getStatus()) {
case FATAL_ERROR:
case PARTIAL_ERROR:
getSession().error(opResult);
break;
case IN_PROGRESS:
case NOT_APPLICABLE:
getSession().info(opResult);
break;
case SUCCESS:
if (!showSuccess) {
break;
}
getSession().success(opResult);
break;
case UNKNOWN:
case WARNING:
default:
getSession().warn(opResult);
}
return opResult;
}
use of com.evolveum.midpoint.gui.api.component.result.OpResult in project midpoint by Evolveum.
the class PageOperationResult method initLayout.
private void initLayout() {
if (result != null) {
OpResult opresult = showResult(result);
if (opresult != null) {
opresult.setShowMoreAll(true);
} else {
warn(getString("PageOperationResult.noResultAvailable"));
}
}
AjaxButton back = new AjaxButton(ID_BACK, createStringResource("PageError.button.back")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
backPerformed(target);
}
};
add(back);
}
use of com.evolveum.midpoint.gui.api.component.result.OpResult in project midpoint by Evolveum.
the class TaskResultTabPanel method initLayout.
private void initLayout() {
IModel<List<OperationResult>> resultModel = new ReadOnlyModel<>(() -> createOperationResultList());
SelectableListDataProvider<SelectableBean<OperationResult>, OperationResult> provider = new SelectableListDataProvider<>(this, resultModel);
BoxedTablePanel<SelectableBean<OperationResult>> resultTablePanel = new BoxedTablePanel<>(ID_OPERATION_RESULT, provider, initResultColumns());
resultTablePanel.setOutputMarkupId(true);
add(resultTablePanel);
AjaxFallbackLink<Void> showResult = new AjaxFallbackLink<Void>(ID_SHOW_RESULT) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(Optional<AjaxRequestTarget> optionalTarget) {
if (!optionalTarget.isPresent()) {
LOGGER.warn("Cannot show result in interactive way, request target not present.");
return;
}
AjaxRequestTarget target = optionalTarget.get();
PrismObjectWrapper<TaskType> taskWrapper = TaskResultTabPanel.this.getModelObject();
TaskType taskType = taskWrapper.getObject().asObjectable();
OperationResult opResult = OperationResult.createOperationResult(taskType.getResult());
OpResult result = opResult != null ? OpResult.getOpResult(getPageBase(), opResult) : null;
OperationResultPanel body = new OperationResultPanel(getPageBase().getMainPopupBodyId(), new Model<>(result));
body.add(new VisibleBehaviour(() -> opResult != null));
body.setOutputMarkupId(true);
getPageBase().showMainPopup(body, target);
}
};
showResult.setOutputMarkupId(true);
add(showResult);
}
Aggregations