Examples of LocalizableError


Examples of net.sourceforge.stripes.validation.LocalizableError

  }

  @ValidationMethod(on="save")
  public void validatePassw(ValidationErrors errors) {
    if (!getPassword().equals(getPassword2()))
      errors.add("password", new LocalizableError("com.zesped.action.SignUpForm.passwMismatch"));
  }
View Full Code Here

Examples of net.sourceforge.stripes.validation.LocalizableError

  @ValidationMethod(on="settle")
  public void validateSettlingPreconditions(ValidationErrors errors) {
    final int nTickets = getTicketIds().size();
    for (int t=0; t<nTickets; t++) {
      if (getBaseAmounts().get(t)==null)
        errors.add("base", new LocalizableError("com.zesped.action.FastEditBillNote.missingTicketBase"));
      if (getTotalAmounts().get(t)==null)
        errors.add("total", new LocalizableError("com.zesped.action.FastEditBillNote.missingTicketTotal"));
      if (getVats().get(t)==null)
        errors.add("iva", new LocalizableError("com.zesped.action.FastEditBillNote.missingTicketVat"));
    }
  }
View Full Code Here

Examples of net.sourceforge.stripes.validation.LocalizableError

    public void validatePayInformation() {
        ValidationErrors errors= getContext().getValidationErrors();
        if(selectedProduct.getPrice().compareTo(BigDecimal.ZERO)>0)
        {
            if(getCvv2()==null){
                errors.add("cvv2", new LocalizableError("com.zesped.action.EngageCredit.EmptyCvv2"));
            }
            if(getCardnumber()==null){
                errors.add("cardnumber", new LocalizableError("com.zesped.action.EngageCredit.EmptyCardnumber"));
            }
            if(getCardholder()==null){
                errors.add("cardholder", new LocalizableError("com.zesped.action.EngageCredit.EmptyCardholder"));
            }
        }
       
    }
View Full Code Here

Examples of net.sourceforge.stripes.validation.LocalizableError

  public void validateEmailSyntax(ValidationErrors ignore) {
    for (int e=0; e<=6; e++) {
      final String sEmail = getParam("email["+String.valueOf(e)+"]","");
      if (sEmail.trim().length()>0)
        if (!Gadgets.checkEMail(sEmail))
          addError(new LocalizableError("com.zesped.action.SendInvitations.email.invalidSyntax",sEmail));
    }
  }
View Full Code Here

Examples of net.sourceforge.stripes.validation.LocalizableError

  public void validateNames(ValidationErrors ignore) {
    for (int e=0; e<=6; e++) {
      final String sEmail = getParam("email["+String.valueOf(e)+"]","");
      final String sFirstName = getParam("firstName["+String.valueOf(e)+"]","");
      if (sEmail.trim().length()>0 && sFirstName.trim().length()==0)
        addError(new LocalizableError("com.zesped.action.SendInvitations.firstName.valueNotPresent",sEmail));
    }
  }
View Full Code Here

Examples of net.sourceforge.stripes.validation.LocalizableError

          if (sEmail.trim().length()>0) {
            try {
              User.forEmail(sEmail);
              for (User u : aAlu) {
                if (u.getEmail().equals(sEmail))
                  addError(new LocalizableError("com.zesped.action.SendInvitations.user.alreadyAuthorized",sEmail,oTxp.getBusinessName()));
              }
            } catch (ElementNotFoundException enfe) { }
          }
        } // next       
      } // next
View Full Code Here

Examples of net.sourceforge.stripes.validation.LocalizableError

          connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
          Dms oDms = getSession().getDms();
          AccountingAccount oAacc = new AccountingAccount(oDms, id);
          SortableList<Document> oTcks = oDms.query("Ticket$accounting_uuid='"+oAacc.getUuid()+"'");
      if (!oTcks.isEmpty()) {
        addError(new LocalizableError("com.zesped.action.CheckCanDeleteAccountingAccount.hasTickets"));       
      }
      disconnect();
      } catch (Exception xcpt) {
        Log.out.error("CheckCanDeleteAccountingAccount.form() "+xcpt.getClass().getName()+" "+xcpt.getMessage(), xcpt);
      } finally {
View Full Code Here

Examples of net.sourceforge.stripes.validation.LocalizableError

    try {
          connect();
          sUId = User.forEmail(getEmail());
          disconnect();
        } catch (Exception xcpt) {
        errors.add("password", new LocalizableError("com.zesped.action.RecoverPassword.emailDoesNotExist"));
        } finally {
          close();
        }     
  }
View Full Code Here

Examples of net.sourceforge.stripes.validation.LocalizableError

  }

  @ValidationMethod(on="upload")
  public void requireOneItem(ValidationErrors errors) {
    if (getItems()==null)
      errors.add("items", new LocalizableError("com.zesped.action.InvoceUpload.oneItemIsRequired"));
    else if (getItems().size()==0)
      errors.add("items", new LocalizableError("com.zesped.action.InvoceUpload.oneItemIsRequired"));
  }
View Full Code Here

Examples of net.sourceforge.stripes.validation.LocalizableError

  @ValidationMethod(on="upload")
  public void checkClientAndSupplier(ValidationErrors errors) {
    try {
      if (getRecipientTaxPayer().length()==0) {
        errors.add("items", new LocalizableError("com.zesped.action.InvoceUpload.clientIsRequired"));
      } else if (getBillerTaxPayer().length()>0) {
        connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
        Dms oDms = getSession().getDms();
        Document r,b;
        try {
          r = oDms.getDocument(getRecipientTaxPayer());
          try {
          b = oDms.getDocument(getBillerTaxPayer());
          if (r.type().name().equals(b.type().name()))
            errors.add("items", new LocalizableError("com.zesped.action.InvoceUpload.incompatibleClientAndSupplier"));
          } catch (NumberFormatException nfe) {
          Log.out.error("NumberFormatException getting biller "+getBillerTaxPayer(), nfe);
          errors.add("items", new LocalizableError("com.zesped.action.InvoceUpload.incompatibleClientAndSupplier"));
            }
        } catch (NumberFormatException nfe) {
          Log.out.error("NumberFormatException getting recipient "+getRecipientTaxPayer(), nfe);
          errors.add("items", new LocalizableError("com.zesped.action.InvoceUpload.incompatibleClientAndSupplier"));
        }
        disconnect();
       
      }
    } catch (StorageException e) { }
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.