Examples of ValidationStatus


Examples of com.openii.moa.objects.resources.v1_0.ValidationStatus

    String password = querySpec.getCandidatePassword();
    if (password.matches(".*[a-z].*") && password.matches(".*[A-Z].*")
        && password.matches(".*[0-9].*")) {
      return null;
    } else {
      ValidationStatus vs=new ValidationStatus();
      try {
        vs.setStatusCode(validationStatusCode);
        vs.setExplanation(explanation);
        vs.setDescription(description);
      } catch (EnterpriseFieldException e) {
        e.printStackTrace();
        throw new PasswordValidationException(e.getMessage());
      }
      return vs;
View Full Code Here

Examples of com.openii.moa.objects.resources.v1_0.ValidationStatus

    }
    int l = querySpec.getCandidatePassword().length();
    if (l>=minimum && l<=maximum) {
      return null;
    } else {
      ValidationStatus vs=new ValidationStatus();
      try {
        vs.setStatusCode(validationStatusCode);
        vs.setExplanation(explanation);
        if (l<minimum) {
          vs.setDescription(minimumLengthDescription);
        }
        if (l>maximum) {
          vs.setDescription(maximumLengthDescription);
        }
      } catch (EnterpriseFieldException e) {
        e.printStackTrace();
        throw new PasswordValidationException(e.getMessage());
      }
View Full Code Here

Examples of com.openii.moa.objects.resources.v1_0.ValidationStatus

      if (myIdType.equalsIgnoreCase(idType)) {
        System.out.println("ID match");
        String idValue = id.getValue();
        System.out.println("value="+idValue);
        if (password.indexOf(idValue)!=-1) {
          ValidationStatus vs=new ValidationStatus();
          try {
            vs.setStatusCode(validationStatusCode);
            vs.setExplanation(explanation);
            vs.setDescription(description);
          } catch (EnterpriseFieldException e) {
            e.printStackTrace();
            throw new PasswordValidationException(e.getMessage());
          }
          return vs;         
View Full Code Here

Examples of com.volantis.mcs.eclipse.validation.ValidationStatus

                final IFile file = ResourcesPlugin.getWorkspace().getRoot().
                        getFile(filePath);

                // Ensure that the specified file can be written to.
                ValidationStatus status = ValidationUtils.checkFile(file.
                        getLocation().toFile().getAbsolutePath(),
                        ValidationUtils.FILE_CAN_WRITE);

                if (!status.isOK()) {
                    String title = EditorMessages.getString("Editor.error." +
                            "saveas.problems.title");
                    ErrorDialog.openError(shell, title, null, status);
                } else {
                    SaveCommandFactory factory =
View Full Code Here

Examples of com.volantis.mcs.eclipse.validation.ValidationStatus

        device = null;
        fallbackDevice = null;
        updateValues();

        // Default status is valid.
        ValidationStatus status = VALID_STATUS;
        String supplementaryArgs[] = {
            DevicesMessages.getString(RESOURCE_PREFIX + "newDevice.text")
        };
        validationMessageBuilder.setSupplementaryFormatArgs(supplementaryArgs);

        status = DEVICE_NAME_VALIDATOR.validate(getDevice(),
                validationMessageBuilder);

        // Ensure the fallback device has been selected.
        if ((status.getSeverity() == Status.OK) &&
                deviceFallbackTree.getSelectionCount() <= 0) {
            String message = DevicesMessages.getString(RESOURCE_PREFIX +
                    "error.fallbackDeviceIsMandatory");
            status = new ValidationStatus(4, message);
        }

        // If the status is OK then check to see if we have any duplicate names.
        if (status.getSeverity() == Status.OK) {
            visitor.reset();
            walker.visit(root, visitor);
            if (visitor.isDuplicate()) {
                String message = DevicesMessages.getString(RESOURCE_PREFIX +
                        "error.duplicateDeviceName");
                String args[] = {
                    getDevice()
                };
                MessageFormat format = new MessageFormat(message);
                message = format.format(args);
                status = new ValidationStatus(Status.ERROR, message);
            }
        }

        if (status.getSeverity() == Status.ERROR) {
            setErrorMessage(status.getMessage());
        } else if (status.getSeverity() == Status.WARNING) {
            setErrorMessage(null);
            setMessage(status.getMessage());
        } else {
            setErrorMessage(null);
            if(context.isAdminProject()) {
                setMessage(DevicesMessages.getString(RESOURCE_PREFIX +
                            "info.admin"));
            } else {
                setMessage(DevicesMessages.getString(RESOURCE_PREFIX +
                            "info.custom"));
            }
        }
        valid = status.getSeverity() == Status.OK;
        return valid;
    }
View Full Code Here

Examples of com.volantis.mcs.eclipse.validation.ValidationStatus

    /**
     * Validates the selector and list items. Error messages from
     * the selector validation take precedence.
     */
    protected void validateDialog() {
        ValidationStatus status = listBuilder.validate();
        if (status.isOK()) {
            //Clear error message
            setErrorMessage(null);
        } else if (status.getSeverity() == ValidationStatus.ERROR) {
            setErrorMessage(status.getMessage());
        }
    }
View Full Code Here

Examples of com.volantis.mcs.eclipse.validation.ValidationStatus

     * @todo If this logic changes, you may also need to change the
     * validatePage method in MCSProjectproperties.
     */
    public boolean validatePage() {
        boolean valid = true;
        ValidationStatus status = null;

        if (origPolicySource != null &&
                !origPolicySource.equals(policySource.getText())) {
            valid = false;
            String message = WizardMessages.getString(RESOURCE_PREFIX +
                    "policySourceConflict.message");
            status = new ValidationStatus(Status.ERROR, message);
        } else {
            status = REPOSITORY_NAME_VALIDATOR.validate(
                    fileSelector.getValue(), messageBuilder);
        }

        if (status.getSeverity() == Status.ERROR) {
            setErrorMessage(status.getMessage());
            valid = false;
        } else if (status.getSeverity() == Status.INFO) {
            setErrorMessage(null);
            setMessage(status.getMessage(), DialogPage.INFORMATION);
        } else {
            status = PROJECT_CONTAINER_NAME_VALIDATOR.validate(
                    policySource.getText().trim(), messageBuilder);
            if (status.getSeverity() == Status.ERROR) {
                setErrorMessage(status.getMessage());
                valid = false;
            } else if (status.getSeverity() == Status.INFO) {
                setErrorMessage(null);
                setMessage(status.getMessage(), DialogPage.INFORMATION);
            } else {
                setErrorMessage(null);
                setMessage(null);
            }
            if (valid) {
View Full Code Here

Examples of com.volantis.mcs.eclipse.validation.ValidationStatus

     * Validates the ValidatedTextControl and list in that order. Validation
     * stops when the first error is encountered.
     * @return the validation status
     */
    public ValidationStatus validate() {
        ValidationStatus status = textControl.validate();
        if (status.isOK() && listValidator != null) {
            status = validateListItems();
        }
        return status;
    }
View Full Code Here

Examples of com.volantis.mcs.eclipse.validation.ValidationStatus

    /**
     * Validates the items in the list. Validation stops at the first error.
     * @return the validation status
     */
    private ValidationStatus validateListItems() {
        ValidationStatus status = OK_STATUS;
        String[] items = list.getItems();
        for (int i = 0; i < items.length && status.isOK(); i++) {
            status = listValidator.validate(items[i]);
        }
        return status;
    }
View Full Code Here

Examples of com.volantis.mcs.eclipse.validation.ValidationStatus

        if (!resourceGroup.areAllValuesValid()) {
            setErrorMessage(resourceGroup.getProblemMessage());
            valid = false;
        } else {
            ValidationStatus status =
                    VALIDATOR.validate(getPolicyName(), messageBuilder);

            if (status.getSeverity() == Status.ERROR) {
                setErrorMessage(status.getMessage());
                valid = false;
            } else if (status.getSeverity() == Status.INFO) {
                setErrorMessage(null);
                setMessage(status.getMessage());
                valid = false;
            } else {
                // Attempt to reduce garbage by using a StringBuffer and storing
                // the result of  the toString in a variable. Also the check for
                // policy existence is performed after other validation succeeds
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.