Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Aug 17, 2019
2 parents 6e81984 + 2c55df8 commit 22124c2
Show file tree
Hide file tree
Showing 74 changed files with 151 additions and 145 deletions.
Expand Up @@ -3414,7 +3414,7 @@ public static void saveTask(PrismObject<TaskType> oldTask, OperationResult resul
pageBase.getModelService().executeChanges(WebComponentUtil.createDeltaCollection(delta), null, task, result);
} catch (Exception e){
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't save task.", e);
result.recordFatalError("Couldn't save task.", e);
result.recordFatalError(pageBase.createStringResource("WebModelUtils.couldntSaveTask").getString(), e);
}
result.recomputeStatus();
}
Expand Down Expand Up @@ -3576,7 +3576,7 @@ public static void workItemApproveActionPerformed(AjaxRequestTarget target, Case
dropPowerOfAttorneyIfRequested(result, powerDonor, pageBase);
}
} catch (Exception ex) {
result.recordFatalError("Couldn't save work item.", ex);
result.recordFatalError(pageBase.createStringResource("WebModelUtils.couldntSaveWorkItem").getString(), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't save work item", ex);
}
}
Expand Down
Expand Up @@ -295,11 +295,11 @@ public static <T extends ObjectType> PrismObject<T> loadObject(Class<T> type, St
LOGGER.debug("{} {} does not exist", type.getSimpleName(), oid, e);
return null;
} else {
subResult.recordFatalError("WebModelUtils.couldntLoadObject", e);
subResult.recordFatalError(page.createStringResource("WebModelUtils.couldntLoadObject").getString(), e);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't load object", e);
}
} catch (Exception ex) {
subResult.recordFatalError("WebModelUtils.couldntLoadObject", ex);
subResult.recordFatalError(page.createStringResource("WebModelUtils.couldntLoadObject").getString(), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't load object", ex);
} finally {
subResult.computeStatus();
Expand Down Expand Up @@ -417,7 +417,7 @@ public static <T extends ObjectType> List<PrismObject<T>> searchObjects(Class<T>
objects.addAll(list);
}
} catch (Exception ex) {
subResult.recordFatalError("WebModelUtils.couldntSearchObjects", ex);
subResult.recordFatalError(page.createStringResource("WebModelUtils.couldntSearchObjects").getString(), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't search objects", ex);
} finally {
subResult.computeStatus();
Expand All @@ -441,7 +441,7 @@ public static <T extends ObjectType> int countObjects(Class<T> type, ObjectQuery
count = page.getModelService().countObjects(type, query, null, task, parentResult);
} catch (SchemaException | ObjectNotFoundException | SecurityViolationException
| ConfigurationException | CommunicationException | ExpressionEvaluationException ex) {
parentResult.recordFatalError("WebModelUtils.couldntCountObjects", ex);
parentResult.recordFatalError(page.createStringResource("WebModelUtils.couldntCountObjects").getString(), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't count objects", ex);
}

Expand Down Expand Up @@ -478,7 +478,7 @@ public static <T extends ObjectType> void deleteObject(Class<T> type, String oid

page.getModelService().executeChanges(WebComponentUtil.createDeltaCollection(delta), options, task, subResult);
} catch (Exception ex) {
subResult.recordFatalError("WebModelUtils.couldntDeleteObject", ex);
subResult.recordFatalError(page.createStringResource("WebModelUtils.couldntDeleteObject").getString(), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't delete object", ex);
} finally {
subResult.computeStatus();
Expand Down
Expand Up @@ -82,7 +82,7 @@ public static <IW extends ItemWrapper, PV extends PrismValue, VW extends PrismVa

} catch (SchemaException e) {
LOGGER.error("Cannot create new value for {}", itemWrapper, e);
result.recordFatalError("Cannot create value wrapper for " + newValue + ". Reason: " + e.getMessage(), e);
result.recordFatalError(pageBase.createStringResource("WebPrismUtil.message.createNewValueWrapper.fatalError", newValue, e.getMessage()).getString(), e);
target.add(pageBase.getFeedbackPanel());
}

Expand Down
Expand Up @@ -50,7 +50,7 @@ public void register() {
@Override
public <IW extends ItemWrapper> boolean match(IW wrapper) {
QName type = wrapper.getTypeName();
return DOMUtil.XSD_STRING.equals(type) || DOMUtil.XSD_DURATION.equals(type)
return DOMUtil.XSD_STRING.equals(type) || DOMUtil.XSD_DURATION.equals(type) || DOMUtil.XSD_LONG.equals(type)
|| DOMUtil.XSD_ANYURI.equals(type) || DOMUtil.XSD_INT.equals(type);
}

Expand Down
Expand Up @@ -448,7 +448,7 @@ private void prepareNewContainers(AjaxRequestTarget target, List<PrismContainerD
((List) getModelObject().getItems()).add(iw);
} catch (SchemaException e) {
OperationResult result = ctx.getResult();
result.recordFatalError("Cannot create container wrapper for " + container, e);
result.recordFatalError(createStringResource("PrismContainerValuePanel.message.prepareNewContainers.fatalError", container).getString(), e);
getPageBase().showResult(ctx.getResult());
}
});
Expand Down
Expand Up @@ -187,7 +187,7 @@ private PrismObject<F> getReconstructedObject(String oid, String eventIdentifier
PrismObject<F> object = WebModelServiceUtils.reconstructObject(type, oid, eventIdentifier, task, result);
return object;
} catch (Exception ex) {
result.recordFatalError("Couldn't restruct object.", ex);
result.recordFatalError(getPageBase().createStringResource("ObjectHistoryTabPanel.message.getReconstructedObject.fatalError").getString(), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't restruct object", ex);
}
return null;
Expand Down
Expand Up @@ -139,7 +139,7 @@ private PrismObjectWrapper<O> createObjectWrapper(PrismObjectWrapperFactory<O> f
context);
result.recordSuccess();
} catch (SchemaException e) {
result.recordFatalError("Cannot initialize form, " + e.getMessage());
result.recordFatalError(createStringResource("DynamicFormPanel.message.createObjectWrapper.fatalError", e.getMessage()).getString());
getPageBase().showResult(result);

}
Expand Down
Expand Up @@ -144,7 +144,8 @@ public SceneDto getObject() {
result.computeStatus();
} catch (Throwable t) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't prepare approval information", t);
result.recordFatalError("Couldn't prepare approval information: " + t.getMessage(), t);
result.recordFatalError(
createStringResource("PreviewChangesTabPanel.message.prepareApproval.fatalError", t.getMessage()).getString(), t);
}
if (WebComponentUtil.showResultInPage(result)) {
getPageBase().showResult(result);
Expand Down
Expand Up @@ -218,7 +218,7 @@ public void deleteConfirmedPerformed(AjaxRequestTarget target, F selectedObject)
subResult.computeStatus();
} catch (RuntimeException ex) {
subResult.recomputeStatus();
subResult.recordFatalError("Couldn't delete object.", ex);
subResult.recordFatalError("FocusListInlineMenuHelper.message.delete.fatalError", ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't delete object", ex);
}
}
Expand Down Expand Up @@ -256,10 +256,10 @@ private void updateActivationPerformed(AjaxRequestTarget target, boolean enablin
} catch (CommonException|RuntimeException ex) {
subResult.recomputeStatus();
if (enabling) {
subResult.recordFatalError("Couldn't enable object.", ex);
subResult.recordFatalError("FocusListInlineMenuHelper.message.enable.fatalError", ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't enable object", ex);
} else {
subResult.recordFatalError("Couldn't disable object.", ex);
subResult.recordFatalError("FocusListInlineMenuHelper.message.disable.fatalError", ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't disable object", ex);
}
}
Expand Down Expand Up @@ -291,7 +291,8 @@ private void reconcilePerformed(AjaxRequestTarget target, F selectedObject) {
opResult.computeStatusIfUnknown();
} catch (CommonException|RuntimeException ex) {
opResult.recomputeStatus();
opResult.recordFatalError("Couldn't reconcile object " + object + ".", ex);
opResult.recordFatalError(
parentPage.createStringResource("FocusListInlineMenuHelper.message.reconcile.fatalError", object).getString(), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't reconcile object " + object + ".", ex);
}
}
Expand Down
Expand Up @@ -88,7 +88,8 @@ protected ApprovalSchemaExecutionInformationType load() {
result.computeStatus();
} catch (Throwable t) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get approval schema execution information for {}", t, getModelObject());
opTask.getResult().recordFatalError("Couldn't get approval schema execution information: " + t.getMessage(), t);
opTask.getResult().recordFatalError(
createStringResource("SwitchableApprovalProcessPreviewsPanel.message.approvalSchemaExecution.fatalError",t.getMessage()).getString(), t);
}
if (WebComponentUtil.showResultInPage(result)) {
parentPage.showResult(result);
Expand Down Expand Up @@ -125,7 +126,8 @@ private ApprovalProcessExecutionInformationDto createApprovalProcessExecutionInf
result.computeStatus();
} catch (Throwable t) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't create approval process execution information for {}", t, getModelObject());
opTask.getResult().recordFatalError("Couldn't create approval process execution information: " + t.getMessage(), t);
opTask.getResult().recordFatalError(
createStringResource("SwitchableApprovalProcessPreviewsPanel.message.createApprovalProcess.fatalError", t.getMessage()).getString(), t);
}
if (WebComponentUtil.showResultInPage(result)) {
;
Expand Down
Expand Up @@ -409,7 +409,7 @@ private void savePerformed() {
}
} catch (CommonException|RuntimeException e){
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't save capabilities", e);
result.recordFatalError("Couldn't save capabilities", e);
result.recordFatalError(getString("CapabilityStep.message.cantSaveCaps"), e);
} finally {
result.computeStatusIfUnknown();
setResult(result);
Expand Down
Expand Up @@ -302,7 +302,7 @@ private void saveChanges() {
}
} catch (Exception ex) {
LoggingUtils.logUnexpectedException(LOGGER, "Error occurred during saving changes", ex);
result.recordFatalError("Couldn't save configuration changes.", ex);
result.recordFatalError(getString("ConfigurationStep.message.saveConfiguration.fatalError"), ex);
} finally {
result.computeStatusIfUnknown();
setResult(result);
Expand Down
Expand Up @@ -497,7 +497,7 @@ public void applyState() {

} catch (RuntimeException|SchemaException ex) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't save resource", ex);
result.recordFatalError("Couldn't save resource, reason: " + ex.getMessage(), ex);
result.recordFatalError(createStringResource("NameStep.message.saveResource.fatalError", ex.getMessage()).getString(), ex);
} finally {
result.computeStatusIfUnknown();
setResult(result);
Expand Down
Expand Up @@ -137,7 +137,7 @@ private void reloadPerformed(AjaxRequestTarget target) {
result.computeStatusIfUnknown();
} catch (CommonException|RuntimeException e) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't reload the schema", e);
result.recordFatalError("Couldn't reload the schema: " + e.getMessage(), e);
result.recordFatalError(createStringResource("SchemaStep.message.reload.fatalError", e.getMessage()).getString(), e);
}

// if (result.isSuccess()) {
Expand Down
Expand Up @@ -242,7 +242,7 @@ private List<ObjectReferenceType> createPasswordPolicyList(){
policies = getPageBase().getModelService().searchObjects(ValuePolicyType.class, null, null, task, result);
result.recomputeStatus();
} catch (CommonException |RuntimeException e) {
result.recordFatalError("Couldn't load password policies.", e);
result.recordFatalError(getString("ResourceCredentialsEditor.message.createPasswordPolicyList.fatalError"), e);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't load password policies", e);
}

Expand Down
Expand Up @@ -277,7 +277,7 @@ private List<ObjectReferenceType> createResourceList(){
resources = getPageBase().getModelService().searchObjects(ResourceType.class, null, null, task, result);
result.recomputeStatus();
} catch (CommonException|RuntimeException e){
result.recordFatalError("Couldn't get resource list.", e);
result.recordFatalError(getString("ResourceDependencyEditor.message.createResourceList.fatalError"), e);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get resource list.", e);
}

Expand Down
Expand Up @@ -218,7 +218,7 @@ private List<ObjectReferenceType> createObjectReferenceListDeprecated() {
result);
result.recomputeStatus();
} catch (CommonException|RuntimeException e) {
result.recordFatalError("Couldn't load objects from repository.", e);
result.recordFatalError("ExpressionVariableEditorDialog.message.createObjectReferenceListDeprecated.fatalError", e);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't load objects from repository", e);
}

Expand Down
Expand Up @@ -571,7 +571,7 @@ private List<ObjectReferenceType> createPasswordPolicyList() {
task, result);
result.recomputeStatus();
} catch (CommonException|RuntimeException e) {
result.recordFatalError("Couldn't load password policies.", e);
result.recordFatalError(getString("MappingEditorDialog.message.createPasswordPolicyList.fatalError"), e);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't load password policies", e);
}

Expand Down
Expand Up @@ -263,7 +263,7 @@ private List<ObjectReferenceType> createObjectTemplateList(){
templates = getPageBase().getModelService().searchObjects(ObjectTemplateType.class, null, null, task, result);
result.recomputeStatus();
} catch (CommonException|RuntimeException e){
result.recordFatalError("Couldn't load object templates from repository. ", e);
result.recordFatalError(getString("SynchronizationReactionEditor.message.createObjectTemplateList.fatalError"), e);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't load object templates from repository", e);
}

Expand Down
Expand Up @@ -316,7 +316,7 @@ public void loadFullShadow(PrismObjectValueWrapper<ShadowType> shadowWrapperValu
result, createLoadOptionForShadowWrapper());

if (projection == null) {
result.recordFatalError("Cannot full projection for " + shadowWrapperValue.getRealValue());
result.recordFatalError(getString("PageAdminFocus.message.loadFullShadow.fatalError", shadowWrapperValue.getRealValue()));
showResult(result);
target.add(getFeedbackPanel());
return;
Expand Down Expand Up @@ -595,7 +595,7 @@ protected boolean executeForceDelete(PrismObjectWrapper<F> userWrapper, Task tas
options, task, result);
}
} catch (Exception ex) {
result.recordFatalError("Failed to execute delete operation with force.");
result.recordFatalError(getString("PageAdminFocus.message.executeForceDelete.fatalError"));
LoggingUtils.logUnexpectedException(LOGGER, "Failed to execute delete operation with force", ex);
return false;
}
Expand Down Expand Up @@ -739,7 +739,7 @@ private List<ObjectDelta<? extends ObjectType>> getShadowModifyDeltas(OperationR
deltas.add(delta);

} catch (Exception ex) {
result.recordFatalError("Couldn't compute account delta.", ex);
result.recordFatalError(getString("PageAdminFocus.message.getShadowModifyDeltas.fatalError"), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't compute account delta", ex);
}
}
Expand Down
Expand Up @@ -331,7 +331,7 @@ protected PrismObjectWrapper<O> loadObjectWrapper(PrismObject<O> objectToEdit, b

result.recordSuccess();
} catch (Exception ex) {
result.recordFatalError("Couldn't get object.", ex);
result.recordFatalError(getString("PageAdminObjectDetails.message.loadObjectWrapper.fatalError"), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't load object", ex);
}

Expand Down Expand Up @@ -366,8 +366,8 @@ protected PrismObjectWrapper<O> loadObjectWrapper(PrismObject<O> objectToEdit, b
try {
wrapper = factory.createObjectWrapper(object, itemStatus, context);
} catch (Exception ex) {
result.recordFatalError("Couldn't get user.", ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't load user", ex);
result.recordFatalError(getString("PageAdminObjectDetails.message.loadObjectWrapper.fatalError"), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't load object", ex);
try {
wrapper = factory.createObjectWrapper(object, itemStatus, context);
} catch (SchemaException e) {
Expand Down
Expand Up @@ -162,7 +162,7 @@ private void delegateConfirmedPerformed(AjaxRequestTarget target, UserType deleg
WebComponentUtil.dropPowerOfAttorneyIfRequested(result, getPowerDonor(), getPageBase());
}
} catch (Exception ex) {
result.recordFatalError("Couldn't delegate work item.", ex);
result.recordFatalError(getString("CaseWorkItemActionsPanel.message.delegateConfirmedPerformed.fatalError"), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't delegate work item", ex);
}
getPageBase().processResult(target, result, false);
Expand Down
Expand Up @@ -172,7 +172,7 @@ private CaseType loadCaseIfNecessary() {
result.recordFatalError(getString("PageCaseWorkItem.couldNotGetCase"), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get case because it does not exist. (It might have been already completed or deleted.)", ex);
} catch (RuntimeException ex) {
result.recordFatalError("Couldn't get case.", ex);
result.recordFatalError(getString("PageCaseWorkItem.couldNotGetCase.runtime"), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get case.", ex);
}
showResult(result, false);
Expand Down
Expand Up @@ -255,7 +255,7 @@ private void stopCaseProcessConfirmed(AjaxRequestTarget target, List<CaseType> c
getWorkflowService().cancelCase(caseObject.getOid(), task, result);
} catch (Exception ex){
LOGGER.error("Couldn't stop case process, ", ex.getLocalizedMessage());
result.recordFatalError("Couldn't stop case process, ", ex);
result.recordFatalError(createStringResource("PageCases.message.stopCaseProcessConfirmed.fatalError").getString(), ex);
}
});
result.computeStatusComposite();
Expand Down
Expand Up @@ -79,7 +79,7 @@ public Iterator<CaseWorkItemDto> internalIterator(long first, long count) {
getAvailableData().add(new CaseWorkItemDto(workItem));
}
} catch (Exception ex) {
result.recordFatalError("Couldn't list case work items.", ex);
result.recordFatalError(getPage().createStringResource("CaseWorkItemDtoProvider.message.internalIterator.fatalError").getString(), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't list case work items", ex);
} finally {
result.computeStatusIfUnknown();
Expand Down Expand Up @@ -111,7 +111,7 @@ protected int internalSize() {
Collection<SelectorOptions<GetOperationOptions>> resolveNames = createCollection(createResolveNames());
count = modelService.countContainers(CaseWorkItemType.class, query, resolveNames, task, result);
} catch (Exception ex) {
result.recordFatalError("Couldn't count objects.", ex);
result.recordFatalError(getPage().createStringResource("CaseWorkItemDtoProvider.message.internalSize.fatalError").getString(), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't count objects", ex);
} finally {
result.computeStatusIfUnknown();
Expand Down

0 comments on commit 22124c2

Please sign in to comment.