Examples of addValidationError()


Examples of org.sonatype.configuration.validation.ValidationResponse.addValidationError()

          "Privilege ID '"
              + privilege.getId()
              + "' cannot be assigned to both a group and repository."
              + "  Either assign a group, a repository or neither (which assigns to ALL repositories).",
          "Cannot select both a Repository and Repository Group.");
      response.addValidationError(message);
    }

    if (StringUtils.isEmpty(method)) {
      response.addValidationError("Method cannot be empty on a privilege!");
    }
View Full Code Here

Examples of org.sonatype.configuration.validation.ValidationResponse.addValidationError()

          "Cannot select both a Repository and Repository Group.");
      response.addValidationError(message);
    }

    if (StringUtils.isEmpty(method)) {
      response.addValidationError("Method cannot be empty on a privilege!");
    }
    else {
      String[] methods = null;

      if (method.contains(",")) {
View Full Code Here

Examples of org.sonatype.configuration.validation.ValidationResponse.addValidationError()

        ValidationMessage message = new ValidationMessage(
            "method",
            "Privilege ID '" + privilege.getId()
                + "' Method is wrong! (Allowed methods are: create, delete, read and update)",
            "Invalid method selected.");
        response.addValidationError(message);
      }

    }

    return response;
View Full Code Here

Examples of org.sonatype.configuration.validation.ValidationResponse.addValidationError()

    ValidationResponse validationResponse = new ValidationResponse();
    validationResponse.setContext(context);

    if (context.getSecurityConfiguration() == null) {
      if (realms.size() < 1) {
        validationResponse.addValidationError("Security is enabled, You must have at least one realm enabled.");
      }
      // TODO: we should also try to load each one to see if it exists
    }

    return validationResponse;
View Full Code Here

Examples of org.sonatype.configuration.validation.ValidationResponse.addValidationError()

    if (StringUtils.isEmpty(privilege.getType())) {
      ValidationMessage message =
          new ValidationMessage("type", "Cannot have an empty type", "Privilege cannot have an invalid type");

      response.addValidationError(message);
    }

    if (StringUtils.isEmpty(privilege.getName())) {
      ValidationMessage message =
          new ValidationMessage("name", "Privilege ID '" + privilege.getId() + "' requires a name.",
View Full Code Here

Examples of org.sonatype.configuration.validation.ValidationResponse.addValidationError()

    if (StringUtils.isEmpty(privilege.getName())) {
      ValidationMessage message =
          new ValidationMessage("name", "Privilege ID '" + privilege.getId() + "' requires a name.",
              "Name is required.");
      response.addValidationError(message);
    }

    return response;
  }
}
View Full Code Here

Examples of org.sonatype.configuration.validation.ValidationResponse.addValidationError()

    try {
      // this will throw a NoSuchRoleMappingException, if there isn't one
      readUserRoleMapping(userRoleMapping.getUserId(), userRoleMapping.getSource());

      ValidationResponse vr = new ValidationResponse();
      vr.addValidationError(new ValidationMessage("*", "User Role Mapping for user '"
          + userRoleMapping.getUserId() + "' already exists."));

      throw new InvalidConfigurationException(vr);
    }
    catch (NoSuchRoleMappingException e) {
View Full Code Here

Examples of org.sonatype.configuration.validation.ValidationResponse.addValidationError()

      context = initializeContext();
    }

    if (readUserRoleMapping(userRoleMapping.getUserId(), userRoleMapping.getSource()) == null) {
      ValidationResponse vr = new ValidationResponse();
      vr.addValidationError(new ValidationMessage("*", "No User Role Mapping found for user '"
          + userRoleMapping.getUserId() + "'."));

      throw new InvalidConfigurationException(vr);
    }

View Full Code Here

Examples of org.sonatype.configuration.validation.ValidationResponse.addValidationError()

        permission = property.getValue();
      }
    }

    if (StringUtils.isEmpty(permission)) {
      response.addValidationError("Permission cannot be empty on a privilege!");
    }

    if (StringUtils.isEmpty(method)) {
      response.addValidationError("Method cannot be empty on a privilege!");
    }
View Full Code Here

Examples of org.sonatype.configuration.validation.ValidationResponse.addValidationError()

    if (StringUtils.isEmpty(permission)) {
      response.addValidationError("Permission cannot be empty on a privilege!");
    }

    if (StringUtils.isEmpty(method)) {
      response.addValidationError("Method cannot be empty on a privilege!");
    }
    else {
      String[] methods = null;

      if (method.contains(",")) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.