use of com.evolveum.midpoint.util.exception.SchemaException in project midpoint by Evolveum.
the class CertDefinitionDto method updateScopeDefinition.
public void updateScopeDefinition(PrismContext prismContext) {
AccessCertificationAssignmentReviewScopeType scopeTypeObj = null;
if (definitionScopeDto != null) {
scopeTypeObj = new AccessCertificationAssignmentReviewScopeType(prismContext);
scopeTypeObj.setName(definitionScopeDto.getName());
scopeTypeObj.setDescription(definitionScopeDto.getDescription());
scopeTypeObj.setObjectType(definitionScopeDto.getObjectType() != null ? new QName(definitionScopeDto.getObjectType().name()) : null);
SearchFilterType parsedSearchFilter = definitionScopeDto.getParsedSearchFilter(prismContext);
if (parsedSearchFilter != null) {
// check if everything is OK
try {
QueryConvertor.parseFilterPreliminarily(parsedSearchFilter.getFilterClauseXNode(), prismContext);
} catch (SchemaException e) {
throw new SystemException("Couldn't parse search filter: " + e.getMessage(), e);
}
}
scopeTypeObj.setSearchFilter(parsedSearchFilter);
scopeTypeObj.setIncludeAssignments(definitionScopeDto.isIncludeAssignments());
scopeTypeObj.setIncludeInducements(definitionScopeDto.isIncludeInducements());
scopeTypeObj.setIncludeResources(definitionScopeDto.isIncludeResources());
scopeTypeObj.setIncludeRoles(definitionScopeDto.isIncludeRoles());
scopeTypeObj.setIncludeOrgs(definitionScopeDto.isIncludeOrgs());
scopeTypeObj.setIncludeServices(definitionScopeDto.isIncludeServices());
scopeTypeObj.setIncludeUsers(definitionScopeDto.isIncludeUsers());
scopeTypeObj.setEnabledItemsOnly(definitionScopeDto.isEnabledItemsOnly());
scopeTypeObj.setItemSelectionExpression(definitionScopeDto.getItemSelectionExpression());
scopeTypeObj.getRelation().addAll(definitionScopeDto.getRelationList());
}
definition.setScopeDefinition(scopeTypeObj);
}
use of com.evolveum.midpoint.util.exception.SchemaException in project midpoint by Evolveum.
the class DefinitionScopeDto method getParsedSearchFilter.
public SearchFilterType getParsedSearchFilter(PrismContext context) {
if (searchFilterText == null || searchFilterText.isEmpty()) {
return null;
}
SearchFilterType rv = new SearchFilterType();
RootXNode filterClauseNode;
try {
filterClauseNode = (RootXNode) context.parserFor(searchFilterText).xml().parseToXNode();
} catch (SchemaException e) {
throw new SystemException("Cannot parse search filter " + searchFilterText + ": " + e.getMessage(), e);
}
rv.setFilterClauseXNode(filterClauseNode);
return rv;
}
use of com.evolveum.midpoint.util.exception.SchemaException in project midpoint by Evolveum.
the class PageAccounts method showShadowResult.
private void showShadowResult(AjaxRequestTarget target, IModel<SelectableBean> rowModel) {
OperationResultType result = getResult(rowModel);
String xml;
ModalWindow aceDialog = (ModalWindow) get(createComponentPath(ID_RESULT_DIALOG));
AceEditorDialog aceEditor = (AceEditorDialog) aceDialog.get(aceDialog.getContentId());
try {
xml = getPrismContext().xmlSerializer().serializeRealValue(result, ShadowType.F_RESULT);
aceEditor.updateModel(new Model<String>(xml));
} catch (SchemaException e) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't parse result", e);
aceEditor.updateModel(new Model<String>("Unable to show result. For more information see logs."));
}
aceDialog.show(target);
target.add(getFeedbackPanel());
}
use of com.evolveum.midpoint.util.exception.SchemaException in project midpoint by Evolveum.
the class PageAbout method testRepositoryCheckOrgClosurePerformed.
private void testRepositoryCheckOrgClosurePerformed(AjaxRequestTarget target) {
OperationResult result = new OperationResult(OPERATION_TEST_REPOSITORY_CHECK_ORG_CLOSURE);
try {
Task task = createSimpleTask(OPERATION_TEST_REPOSITORY_CHECK_ORG_CLOSURE);
getModelDiagnosticService().repositoryTestOrgClosureConsistency(task, true, result);
} catch (SchemaException | SecurityViolationException e) {
result.recordFatalError(e);
} finally {
result.computeStatusIfUnknown();
}
showResult(result);
target.add(getFeedbackPanel());
}
use of com.evolveum.midpoint.util.exception.SchemaException in project midpoint by Evolveum.
the class PageAbout method reindexRepositoryObjectsPerformed.
private void reindexRepositoryObjectsPerformed(AjaxRequestTarget target) {
OperationResult result = new OperationResult(OPERATION_SUBMIT_REINDEX);
try {
TaskManager taskManager = getTaskManager();
Task task = taskManager.createTaskInstance();
MidPointPrincipal user = SecurityUtils.getPrincipalUser();
if (user == null) {
throw new RestartResponseException(PageLogin.class);
} else {
task.setOwner(user.getUser().asPrismObject());
}
getSecurityEnforcer().authorize(AuthorizationConstants.AUTZ_ALL_URL, null, null, null, null, null, result);
task.setChannel(SchemaConstants.CHANNEL_GUI_USER_URI);
task.setHandlerUri(ModelPublicConstants.REINDEX_TASK_HANDLER_URI);
task.setName("Reindex repository objects");
taskManager.switchToBackground(task, result);
result.setBackgroundTaskOid(task.getOid());
} catch (SecurityViolationException | SchemaException | RuntimeException e) {
result.recordFatalError(e);
} finally {
result.computeStatusIfUnknown();
}
showResult(result);
target.add(getFeedbackPanel());
}
Aggregations