Skip to content

Commit

Permalink
small fixes for GUI:
Browse files Browse the repository at this point in the history
-> better check for isVirtual so the display name is displayed correctly
-> better error handling while loading prism object to create wrapper
  • Loading branch information
katkav committed Oct 12, 2022
1 parent bc47ec9 commit c4dd702
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -511,21 +511,20 @@ private PrismObject<O> loadPrismObject() {
Task task = createSimpleTask(OPERATION_LOAD_OBJECT);
OperationResult result = task.getResult();
PrismObject<O> prismObject;
if (!isEditObject()) {
try {
try {
if (!isEditObject()) {
prismObject = getPrismContext().createObject(getType());
} catch (Exception ex) {
result.recordFatalError(getString("PageAdminObjectDetails.message.loadObjectWrapper.fatalError"), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't load object", ex);
throw redirectBackViaRestartResponseException();
} else {
String focusOid = getObjectOidParameter();
prismObject = WebModelServiceUtils.loadObject(getType(), focusOid, getOperationOptions(), false, this, task, result);
LOGGER.trace("Loading object: Existing object (loadled): {} -> {}", focusOid, prismObject);
}
} else {
String focusOid = getObjectOidParameter();
prismObject = WebModelServiceUtils.loadObject(getType(), focusOid, getOperationOptions(), false, this, task, result);
LOGGER.trace("Loading object: Existing object (loadled): {} -> {}", focusOid, prismObject);
} catch (Exception ex) {
result.recordFatalError(getString("PageAdminObjectDetails.message.loadObjectWrapper.fatalError"), ex);
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't load object", ex);
throw redirectBackViaRestartResponseException();
}
result.recordSuccess();

result.computeStatusIfUnknown();
showResult(result, false);
return prismObject;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ public List<VirtualContainerItemSpecificationType> getVirtualItems() {

@Override
public boolean isVirtual() {
return virtualItems != null;
return virtualItems != null && !virtualItems.isEmpty();
}

@Override
Expand Down

0 comments on commit c4dd702

Please sign in to comment.