use of com.evolveum.midpoint.xml.ns._public.common.common_3.FormAuthorizationType in project midpoint by Evolveum.
the class DynamicFormPanel method createObjectWrapper.
private PrismObjectWrapper<O> createObjectWrapper(PrismObjectWrapperFactory<O> factory, Task task, PrismObject<O> prismObject, boolean enforceRequiredFields) {
FormAuthorizationType formAuthorization = form.getFormDefinition().getAuthorization();
AuthorizationPhaseType authorizationPhase = formAuthorization != null && formAuthorization.getPhase() != null ? formAuthorization.getPhase() : AuthorizationPhaseType.REQUEST;
OperationResult result = task.getResult();
WrapperContext context = new WrapperContext(task, result);
context.setShowEmpty(true);
context.setAuthzPhase(authorizationPhase);
// TODO: enforce required fields???? what is it?
PrismObjectWrapper<O> objectWrapper = null;
try {
objectWrapper = factory.createObjectWrapper(prismObject, prismObject.getOid() == null ? ItemStatus.ADDED : ItemStatus.NOT_CHANGED, context);
result.recordSuccess();
} catch (SchemaException e) {
result.recordFatalError(createStringResource("DynamicFormPanel.message.createObjectWrapper.fatalError", e.getMessage()).getString());
getPageBase().showResult(result);
}
return objectWrapper;
}
Aggregations