Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Aug 1, 2015
2 parents b61e2aa + cd10fcf commit 2a59f63
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
Expand Up @@ -161,7 +161,7 @@ private ObjectViewDto loadObject() {
showResult(result);
}

if (!WebMiscUtil.isSuccessOrHandledError(result)) {
if (!WebMiscUtil.isSuccessOrHandledErrorOrWarning(result)) {
showResultInSession(result);
throw new RestartResponseException(PageDebugList.class);
}
Expand Down
Expand Up @@ -533,6 +533,14 @@ public static boolean isSuccessOrHandledError(OperationResult result) {
return result.isSuccess() || result.isHandledError();
}

public static boolean isSuccessOrHandledErrorOrWarning(OperationResult result) {
if (result == null) {
return false;
}

return result.isSuccess() || result.isHandledError() || result.isWarning();
}

public static boolean isSuccessOrHandledErrorOrInProgress(OperationResult result) {
if (result == null) {
return false;
Expand Down
Expand Up @@ -86,7 +86,7 @@ public boolean isAccountRelated() {
}

public boolean isUserRelated() {
return isCategoryType(EventCategoryType.MODEL_EVENT);
return false; // overriden in ModelEvent
}

public boolean isWorkItemRelated() {
Expand Down
Expand Up @@ -33,6 +33,7 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.EventOperationType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.EventStatusType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;

import javax.xml.namespace.QName;
import java.util.ArrayList;
Expand Down Expand Up @@ -161,7 +162,7 @@ public ObjectDelta<? extends FocusType> getSummarizedFocusDeltas() throws Schema
}

public boolean hasFocusOfType(Class<? extends FocusType> clazz) {
return clazz.isAssignableFrom(getFocusContext().getObjectTypeClass());
return getFocusContext() != null && clazz.isAssignableFrom(getFocusContext().getObjectTypeClass());
}

public boolean hasFocusOfType(QName focusType) {
Expand All @@ -187,4 +188,8 @@ public boolean isRelatedToItem(ItemPath itemPath) {
return containsItem(getFocusDeltas(), itemPath);
}

@Override
public boolean isUserRelated() {
return hasFocusOfType(UserType.class);
}
}
Expand Up @@ -246,7 +246,12 @@ public <T extends ObjectType> PrismObject<T> getObject(Class<T> type, String oid
if (GetOperationOptions.isRaw(rootOptions)) {
// This is (almost) OK in raw. We want to get whatever is available, even if it violates
// the schema
ProvisioningUtil.logWarning(LOGGER, result, "Repository object "+repositoryObject+" violates the schema: " + e.getMessage() + ". Reason: ", e);
String m = "Repository object "+repositoryObject+" violates the schema: " + e.getMessage();
ProvisioningUtil.logWarning(LOGGER, result, m + ". Reason: ", e);
OperationResult last = result.getLastSubresult();
if (last != null) {
last.recordWarning(m, e); // MID-2486 - if raw, we want to display this as a warning only
}
} else {
ProvisioningUtil.recordFatalError(LOGGER, result, "Repository object "+repositoryObject+" violates the schema: " + e.getMessage() + ". Reason: ", e);
throw e;
Expand Down

0 comments on commit 2a59f63

Please sign in to comment.