Package net.sourceforge.stripes.validation

Examples of net.sourceforge.stripes.validation.LocalizableError


        if (!errors.containsKey("name")
            && cardService.cardExists(getContext().getUserInformation().getUserId(),
                                      name,
                                      cardId,
                                      getContext().getUserInformation().getEncryptionKey())) {
            errors.add("name", new LocalizableError("cardNameAlreadyExists"));
        }
    }
View Full Code Here


    public Resolution validateAtLeastOneKindIncluded(ValidationErrors errors) {
        if (!(lowerCaseLettersIncluded
              || upperCaseLettersIncluded
              || digitsIncluded
              || specialCharactersIncluded)) {
            errors.add(ValidationErrors.GLOBAL_ERROR, new LocalizableError("atLeastOneKinfMustBeIncluded"));
        }
        return null;
    }
View Full Code Here

  @ValidationMethod(on="save")
  public void validateEmail(ValidationErrors ignore) {
    final String sEmail = getParam("taxPayer.email");
    if (sEmail!=null)
          if (sEmail.length()>0 && !Gadgets.checkEMail(sEmail))
            addError("email", new LocalizableError("com.zesped.action.SaveClient.invalidEmail"));
  }
View Full Code Here

  @ValidationMethod(on="save")
  public void validateTaxId(ValidationErrors ignore) {
    final String sTaxId = getParam("taxPayer.taxId");
    if (sTaxId==null)
      addError(new LocalizableError("com.zesped.action.SaveClient.taxId.valueNotPresent"));         
    else if (sTaxId.length()==0)
      addError(new LocalizableError("com.zesped.action.SaveClient.taxId.valueNotPresent"));         
  }
View Full Code Here

    final String sBusinessName = getParam("taxPayer.businessName");
    final String sTaxId = getParam("taxPayer.taxId");
    final String sFormerId = getParam("taxPayer.id");
    Log.out.debug("Validating TaxPayer with business name "+sBusinessName+" and tax id. "+sTaxId+" for former id "+sFormerId);
    if (sBusinessName==null) {
      addError(new LocalizableError("com.zesped.action.SaveClient.businessName.valueNotPresent"));
    } else if (sBusinessName.length()==0) {
      addError(new LocalizableError("com.zesped.action.SaveClient.businessName.valueNotPresent"));
    } else {
      try {
        connect();
        CustomerAccount oAcc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
        TaxPayer oFoundTaxPayer = oAcc.taxpayers(getSession()).seek(getSession(), sBusinessName);
        if (!oFoundTaxPayer.id().equals(sFormerId))
          addError(new LocalizableError("com.zesped.action.SaveClient.businessNameAlreadyExists"));
        oFoundTaxPayer = oAcc.taxpayers(getSession()).seek(getSession(), sTaxId);
        if (!oFoundTaxPayer.id().equals(sFormerId))
          addError(new LocalizableError("com.zesped.action.SaveClient.taxIdAlreadyExists"));
      } catch (ElementNotFoundException clientnotfound) {
      } catch (Exception e) {
        Log.out.error("SaveTaxPayer.validateBusinessName("+sBusinessName+") "+e.getClass().getName()+" "+e.getMessage(), e);
      } finally {
        close();
View Full Code Here

  @ValidationMethod(on="save,settle")
  public void validateDates(ValidationErrors errors) {   
    for (String sDate : getTicketDates())
      if (sDate.length()>0 && !Calendar.isDate(sDate, "s"))
        errors.add("fecha", new LocalizableError("com.zesped.action.FastEditBillNote.invalidDate", sDate));
  }
View Full Code Here

  }

  @ValidationMethod(on="buy")
  public void validate(ValidationErrors errors) {
    if (selectedProduct.getCredits()==null) {
      errors.add("selectedProduct", new LocalizableError("com.zesped.action.BuyCredits.noCreditsSpecified"))
    }
  }
View Full Code Here

  @ValidationMethod(on="save")
  public void validateName(ValidationErrors ignore) {
    final String sName = getParam("employee.name");
    if (sName==null)
      addError(new LocalizableError("com.zesped.action.SaveEmployee.name.valueNotPresent"));         
    else if (sName.length()==0)
      addError(new LocalizableError("com.zesped.action.SaveEmployee.name.valueNotPresent"));         
  }
View Full Code Here

  @ValidationMethod(on="save")
  public void validateIds(ValidationErrors ignore) {
    final String sTaxId = getParam("employee.taxId","");
    final String sEmpId = getParam("employee.employeeId","");
    if (sTaxId.length()>20)
      addError(new LocalizableError("com.zesped.action.SaveEmployee.taxId.valueTooLong"));
    if (sEmpId.length()>20)
      addError(new LocalizableError("com.zesped.action.SaveEmployee.employeeId.valueTooLong"));
  }
View Full Code Here

  @ValidationMethod(on="save")
  public void validateEmail(ValidationErrors ignore) {
    final String sEmail = getParam("client.email");
    if (sEmail!=null)
          if (sEmail.length()>0 && !Gadgets.checkEMail(sEmail))
            addError("email", new LocalizableError("com.zesped.action.SaveClient.invalidEmail"));
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.stripes.validation.LocalizableError

Copyright © 2018 www.massapicom. 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.