use of com.evolveum.midpoint.schema.result.OperationResult in project midpoint by Evolveum.
the class H3Header method createFetchErrorVisibleBehaviour.
private VisibleEnableBehaviour createFetchErrorVisibleBehaviour() {
return new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
OperationResult fetchResult = getModelObject().getFetchResult();
if (fetchResult != null && !WebComponentUtil.isSuccessOrHandledError(fetchResult)) {
return true;
}
OperationResult result = getModelObject().getResult();
if (result != null && !WebComponentUtil.isSuccessOrHandledError(result)) {
return true;
}
return false;
}
};
}
use of com.evolveum.midpoint.schema.result.OperationResult in project midpoint by Evolveum.
the class ObjectHistoryTabPanel method getReconstructedObject.
private PrismObject<F> getReconstructedObject(String oid, String eventIdentifier, Class type) {
OperationResult result = new OperationResult(OPERATION_RESTRUCT_OBJECT);
try {
Task task = getPageBase().createSimpleTask(OPERATION_RESTRUCT_OBJECT);
PrismObject<F> object = WebModelServiceUtils.reconstructObject(type, oid, eventIdentifier, task, result);
return object;
} catch (Exception ex) {
result.recordFatalError("Couldn't restruct object.", ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't restruct object", ex);
}
return null;
}
use of com.evolveum.midpoint.schema.result.OperationResult in project midpoint by Evolveum.
the class CheckTableHeader method createFetchErrorVisibleBehaviour.
private VisibleEnableBehaviour createFetchErrorVisibleBehaviour() {
return new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
OperationResult fetchResult = getModelObject().getFetchResult();
if (fetchResult != null && !WebComponentUtil.isSuccessOrHandledError(fetchResult)) {
return true;
}
//TODO: do we need to check overall status????
OperationResult result = getModelObject().getResult();
result.computeStatusIfUnknown();
if (result != null && !WebComponentUtil.isSuccessOrHandledError(result)) {
return true;
}
return false;
}
};
}
use of com.evolveum.midpoint.schema.result.OperationResult in project midpoint by Evolveum.
the class ObjectWrapperFactory method createObjectWrapper.
public <O extends ObjectType> ObjectWrapper<O> createObjectWrapper(String displayName, String description, PrismObject<O> object, ContainerStatus status, boolean delayContainerCreation, AuthorizationPhaseType authorizationPhase, Task task) {
if (authorizationPhase == null) {
authorizationPhase = AuthorizationPhaseType.REQUEST;
}
try {
// Task task = modelServiceLocator.createSimpleTask(CREATE_OBJECT_WRAPPER);
OperationResult result = task.getResult();
PrismObjectDefinition<O> objectDefinitionForEditing = modelServiceLocator.getModelInteractionService().getEditObjectDefinition(object, authorizationPhase, task, result);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Edit definition for {}:\n{}", object, objectDefinitionForEditing.debugDump(1));
}
RefinedObjectClassDefinition objectClassDefinitionForEditing = null;
if (isShadow(object)) {
PrismReference resourceRef = object.findReference(ShadowType.F_RESOURCE_REF);
PrismObject<ResourceType> resource = resourceRef.getValue().getObject();
Validate.notNull(resource, "No resource object in the resourceRef");
objectClassDefinitionForEditing = modelServiceLocator.getModelInteractionService().getEditObjectClassDefinition((PrismObject<ShadowType>) object, resource, authorizationPhase);
}
return createObjectWrapper(displayName, description, object, objectDefinitionForEditing, objectClassDefinitionForEditing, status, delayContainerCreation, result);
} catch (SchemaException | ConfigurationException | ObjectNotFoundException ex) {
throw new SystemException(ex);
}
}
use of com.evolveum.midpoint.schema.result.OperationResult in project midpoint by Evolveum.
the class ObjectWrapperFactory method createObjectWrapper.
private <O extends ObjectType> ObjectWrapper<O> createObjectWrapper(String displayName, String description, PrismObject<O> object, PrismObjectDefinition<O> objectDefinitionForEditing, RefinedObjectClassDefinition objectClassDefinitionForEditing, ContainerStatus status, boolean delayContainerCreation, OperationResult result) {
if (result == null) {
this.result = new OperationResult(CREATE_OBJECT_WRAPPER);
} else {
this.result = result;
}
ObjectWrapper<O> objectWrapper = new ObjectWrapper<O>(displayName, description, object, objectDefinitionForEditing, objectClassDefinitionForEditing, status, delayContainerCreation);
List<ContainerWrapper<? extends Containerable>> containerWrappers = createContainerWrappers(objectWrapper, object, objectDefinitionForEditing, status, this.result);
objectWrapper.setContainers(containerWrappers);
this.result.computeStatusIfUnknown();
objectWrapper.setResult(this.result);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Created object wrapper:\n{}", objectWrapper.debugDump());
}
return objectWrapper;
}
Aggregations