Examples of addCodedMessage()


Examples of org.sete.service.BusinessRuleException.addCodedMessage()

        catch(Exception e){
          // only duplicate email address will invoke the following exception
          if(e instanceof DataIntegrityViolationException)
          { 
            BusinessRuleException bre = new BusinessRuleException();
            bre.addCodedMessage("seteUser.EmailAlreadyExists", new String[]{csupvo.getEmailAddress()});
            throw bre;
          }
        }

    }
View Full Code Here

Examples of org.sete.service.BusinessRuleException.addCodedMessage()

            catch(Exception e){
              // only duplicate email address will invoke the following exception
              if(e instanceof DataIntegrityViolationException)
              { 
                BusinessRuleException bre = new BusinessRuleException();
                bre.addCodedMessage("seteUser.EmailAlreadyExists", new String[]{csupvo.getEmailAddress()});
                throw bre;
              }
             }
    }
View Full Code Here

Examples of org.sete.service.BusinessRuleException.addCodedMessage()

        String oldPassword = su.getPassword() ;
        String userFormOldPassword = passwordEncoder.encodePassword(csupvo.getOldPassword(), null) ;
        if(!oldPassword.equals(userFormOldPassword))
        {
          BusinessRuleException bre = new BusinessRuleException();
      bre.addCodedMessage("seteUser.OldPasswordInvalid");
      throw bre;
        }

        // new password
        su.setPassword(passwordEncoder.encodePassword(csupvo.getNewPassword(), null));
View Full Code Here

Examples of org.sete.service.BusinessRuleException.addCodedMessage()

     */
    public void createNewScienceProjectCategory(CreateScienceProjectCategoryVo vo) {

      if(projectCategoryDao.findByProjectCategoryName(vo.getProjectCategoryName()) != null){
        BusinessRuleException bre = new BusinessRuleException();
        bre.addCodedMessage("projectCategory.nameAlreadyExists", new String[]{vo.getProjectCategoryName()});
        throw bre;
      }
     
      ScienceProjectCategoryType spc = new ScienceProjectCategoryType();
        spc.setLabel(vo.getProjectCategoryName()) ;
View Full Code Here

Examples of org.sete.service.BusinessRuleException.addCodedMessage()

     */
    public void deleteScienceProjectCategory(ScienceProjectCategoryType spct){
       
      if(projectCategoryDao.isProjectCategoryInUse(spct.getId())){
        BusinessRuleException bre2 = new BusinessRuleException();
        bre2.addCodedMessage("projectCategory.inUse", new String[]{spct.getLabel()});
        throw bre2;
        }
      projectCategoryDao.deleteScienceProjectCategory(spct);
    }

View Full Code Here

Examples of org.sete.service.BusinessRuleException.addCodedMessage()

            baseDao.delete(type);
        }
        catch(Exception e) {
            // assume there are dependencies
            BusinessRuleException bre = new BusinessRuleException();
            bre.addCodedMessage("error.typeData.hasDependencies");
            throw bre;
        }
    }

    // ==================================================================================================
View Full Code Here

Examples of org.sete.service.BusinessRuleException.addCodedMessage()

        // Only non-significant Types can have their respective keys updated
        // The Label drives key generation
        if(type instanceof Significant) {
            if(!type.getLabel().equals(vo.getLabel())) {
                BusinessRuleException bre = new BusinessRuleException();
                bre.addCodedMessage("error.typeData.cannotChangeLabelForNonSignificant");
                throw bre;
            }
        }

        String key = generateNewKey(vo.getLabel());
View Full Code Here

Examples of org.sete.service.BusinessRuleException.addCodedMessage()

            // found something so now check to see if we are updating ourself or is it
            // really a violation.
            if(!type.getKey().equals(key)) {
                BusinessRuleException bre = new BusinessRuleException();
                bre.addCodedMessage("error.typeData.duplicateKey");
                throw bre;
            }

        }
        catch(IllegalArgumentException iad) {
View Full Code Here

Examples of org.sete.service.BusinessRuleException.addCodedMessage()

    private void checkTypeKeyIsUnique(Class<AbstractLookupType> clazz, String key) {
        try {
            TypeUtil.forKey(clazz, key);

            BusinessRuleException bre = new BusinessRuleException();
            bre.addCodedMessage("error.typeData.duplicateKey");
            throw bre;
        }
        catch(IllegalArgumentException iae) {
            // No duplicates so key is okay
        }
View Full Code Here

Examples of org.sete.service.BusinessRuleException.addCodedMessage()

        Set<SeteUser> students = new HashSet<SeteUser>();

        if(projectDao.isStudentInAnotherProject(Integer.valueOf(vo.getCreator()))) {
            BusinessRuleException bre = new BusinessRuleException();
            bre.addCodedMessage("scienceProject.error.student.already.projectMember",
                                new String[] {"You"});
            throw bre;
        }

        students.add(userDao.findById(Integer.valueOf(vo.getCreator())));
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.