Skip to content

Commit

Permalink
Support for ObjectCollections in view compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Dec 20, 2018
1 parent f2f101a commit b20bb76
Show file tree
Hide file tree
Showing 12 changed files with 259 additions and 43 deletions.
Expand Up @@ -586,7 +586,7 @@ public CompiledUserProfile getCompiledUserProfile() {
Task task = createSimpleTask(PageBase.DOT_CLASS + "getCompiledUserProfile");
try {
compiledUserProfile = modelInteractionService.getCompiledUserProfile(task, task.getResult());
} catch (ObjectNotFoundException | SchemaException e) {
} catch (ObjectNotFoundException | SchemaException | CommunicationException | ConfigurationException | SecurityViolationException | ExpressionEvaluationException e) {
LoggingUtils.logUnexpectedException(LOGGER, "Cannot retrieve compiled user profile", e);
if (InternalsConfig.nonCriticalExceptionsAreFatal()) {
throw new SystemException("Cannot retrieve compiled user profile: " + e.getMessage(), e);
Expand Down
Expand Up @@ -23,8 +23,12 @@
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.task.api.TaskManager;
import com.evolveum.midpoint.util.exception.CommunicationException;
import com.evolveum.midpoint.util.exception.ConfigurationException;
import com.evolveum.midpoint.util.exception.ExpressionEvaluationException;
import com.evolveum.midpoint.util.exception.ObjectNotFoundException;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.util.exception.SecurityViolationException;
import com.evolveum.midpoint.util.exception.SystemException;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.security.MidPointApplication;
Expand Down Expand Up @@ -83,7 +87,7 @@ public boolean isVisible() {
CompiledUserProfile config;
try {
config = getModelInteractionService().getCompiledUserProfile(task, result);
} catch (ObjectNotFoundException | SchemaException e) {
} catch (ObjectNotFoundException | SchemaException | CommunicationException | ConfigurationException | SecurityViolationException | ExpressionEvaluationException e) {
throw new SystemException("Cannot load GUI configuration: " + e.getMessage(), e);
}

Expand Down
Expand Up @@ -26,8 +26,12 @@
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.util.QNameUtil;
import com.evolveum.midpoint.util.exception.CommunicationException;
import com.evolveum.midpoint.util.exception.ConfigurationException;
import com.evolveum.midpoint.util.exception.ExpressionEvaluationException;
import com.evolveum.midpoint.util.exception.ObjectNotFoundException;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.util.exception.SecurityViolationException;
import com.evolveum.midpoint.web.component.prism.ContainerValueWrapper;
import com.evolveum.midpoint.web.component.prism.ContainerWrapper;
import com.evolveum.midpoint.web.session.RoleCatalogStorage;
Expand Down Expand Up @@ -433,7 +437,7 @@ public static int loadAssignmentsLimit(OperationResult result, PageBase pageBase
if (adminGuiConfig != null && adminGuiConfig.getRoleManagement() != null){
assignmentsLimit = adminGuiConfig.getRoleManagement().getAssignmentApprovalRequestLimit();
}
} catch (ObjectNotFoundException | SchemaException ex){
} catch (ObjectNotFoundException | SchemaException | CommunicationException | ConfigurationException | SecurityViolationException | ExpressionEvaluationException ex){
LOGGER.error("Error getting system configuration: {}", ex.getMessage(), ex);
}
return assignmentsLimit;
Expand Down
Expand Up @@ -303,7 +303,7 @@ private static <T extends ObjectType> SearchBoxModeType getDefaultSearchType(Mod
}
}
return null;
} catch (SchemaException | ObjectNotFoundException ex) {
} catch (SchemaException | ObjectNotFoundException | CommunicationException | ConfigurationException | SecurityViolationException | ExpressionEvaluationException ex) {
throw new SystemException(ex);
}
}
Expand Down
Expand Up @@ -48,8 +48,12 @@
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.QNameUtil;
import com.evolveum.midpoint.util.exception.AuthorizationException;
import com.evolveum.midpoint.util.exception.CommunicationException;
import com.evolveum.midpoint.util.exception.ConfigurationException;
import com.evolveum.midpoint.util.exception.ExpressionEvaluationException;
import com.evolveum.midpoint.util.exception.ObjectNotFoundException;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.util.exception.SecurityViolationException;
import com.evolveum.midpoint.util.exception.SystemException;
import com.evolveum.midpoint.util.logging.LoggingUtils;
import com.evolveum.midpoint.util.logging.Trace;
Expand Down Expand Up @@ -703,7 +707,7 @@ public List<ObjectFormType> getObjectFormTypes() {
CompiledUserProfile adminGuiConfiguration;
try {
adminGuiConfiguration = getModelInteractionService().getCompiledUserProfile(task, result);
} catch (ObjectNotFoundException | SchemaException e) {
} catch (ObjectNotFoundException | SchemaException | CommunicationException | ConfigurationException | SecurityViolationException | ExpressionEvaluationException e) {
throw new SystemException("Cannot load GUI configuration: "+e.getMessage(), e);
}
ObjectFormsType objectFormsType = adminGuiConfiguration.getObjectForms();
Expand Down
Expand Up @@ -39,8 +39,12 @@
import com.evolveum.midpoint.security.api.SecurityContextManager;
import com.evolveum.midpoint.security.enforcer.api.SecurityEnforcer;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.exception.CommunicationException;
import com.evolveum.midpoint.util.exception.ConfigurationException;
import com.evolveum.midpoint.util.exception.ExpressionEvaluationException;
import com.evolveum.midpoint.util.exception.ObjectNotFoundException;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.util.exception.SecurityViolationException;
import com.evolveum.midpoint.util.exception.SystemException;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
Expand Down Expand Up @@ -220,7 +224,7 @@ public CompiledUserProfile getCompiledUserProfile() {
Task task = createSimpleTask("getCompiledUserProfile");
try {
return getModelInteractionService().getCompiledUserProfile(task, task.getResult());
} catch (ObjectNotFoundException | SchemaException e) {
} catch (ObjectNotFoundException | SchemaException | CommunicationException | ConfigurationException | SecurityViolationException | ExpressionEvaluationException e) {
throw new SystemException(e.getMessage(), e);
}
}
Expand Down
Expand Up @@ -255,7 +255,7 @@ <F extends ObjectType> ModelContext<F> previewChanges(
* values applicable for current user, therefore the authorization might be considered to be implicit in this case.
*/
@NotNull
CompiledUserProfile getCompiledUserProfile(Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException;
CompiledUserProfile getCompiledUserProfile(Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException;

SystemConfigurationType getSystemConfiguration(OperationResult parentResult) throws ObjectNotFoundException, SchemaException;

Expand Down
Expand Up @@ -781,7 +781,7 @@ public SecurityPolicyType getSecurityPolicy(PrismObject<UserType> user, Task tas

@NotNull
@Override
public CompiledUserProfile getCompiledUserProfile(Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException {
public CompiledUserProfile getCompiledUserProfile(Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException {
MidPointPrincipal principal = null;
try {
principal = securityContextManager.getPrincipal();
Expand All @@ -791,7 +791,7 @@ public CompiledUserProfile getCompiledUserProfile(Task task, OperationResult par

if (principal == null || !(principal instanceof MidPointUserProfilePrincipal)) {
// May be used for unathenticated user, error pages and so on
return userProfileCompiler.getGlobalCompiledUserProfile(parentResult);
return userProfileCompiler.getGlobalCompiledUserProfile(task, parentResult);
} else {
return ((MidPointUserProfilePrincipal)principal).getCompiledUserProfile();
}
Expand Down

0 comments on commit b20bb76

Please sign in to comment.