Skip to content

Commit

Permalink
Replacing String constants in MP form validator impl. with values fro…
Browse files Browse the repository at this point in the history
…m schema.
  • Loading branch information
Erik Suta committed Mar 4, 2015
1 parent 35f7711 commit 0246381
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -42,11 +42,11 @@ public Collection<SimpleValidationError> validateObject(PrismObject<? extends Ob
UserType user = (UserType)object.asObjectable();

if(user.getName() == null){
errors.add(new SimpleValidationError("The name of the user can't be null", new ItemPathType("user/name")));
errors.add(new SimpleValidationError("The name of the user can't be null", new ItemPathType(UserType.F_NAME.getLocalPart())));
}

if(user.getGivenName() == null){
errors.add(new SimpleValidationError("The given name of the user can't be null", new ItemPathType("user/givenName")));
errors.add(new SimpleValidationError("The given name of the user can't be null", new ItemPathType(UserType.F_GIVEN_NAME.getLocalPart())));
}
}

Expand All @@ -62,11 +62,11 @@ public Collection<SimpleValidationError> validateAssignment(AssignmentType assig
}

if(assignment.getTargetRef() == null){
errors.add(new SimpleValidationError("The target ref of the assignment can't be null", new ItemPathType("assignment/targetRef")));
errors.add(new SimpleValidationError("The target ref of the assignment can't be null", new ItemPathType(AssignmentType.F_TARGET_REF.getLocalPart())));
}

if(assignment.getTenantRef() == null){
errors.add(new SimpleValidationError("The tenant ref of the assignment can't be null", new ItemPathType("assignment/tenantRef")));
errors.add(new SimpleValidationError("The tenant ref of the assignment can't be null", new ItemPathType(AssignmentType.F_TENANT_REF.getLocalPart())));
}

return errors;
Expand Down

0 comments on commit 0246381

Please sign in to comment.