Package org.sete.service

Examples of org.sete.service.BusinessRuleException


        // old password validation
        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


        {
            saveNewAwardType(atVo);
        }
        catch(final Exception excp)
        {
            final BusinessRuleException bre = new BusinessRuleException();
            bre.addCodedMessage("awardType.createError", new String[]{atVo.getType()});
           
            throw bre;
        }
       
        return mapping.findForward("view");
View Full Code Here

        {
            saveDeletedAwardType(key);
        }
        catch(final Exception excp)
        {
            final BusinessRuleException bre = new BusinessRuleException();
            bre.addCodedMessage("awardType.deleteError", new String[]{key});
           
            throw bre;
        }
       
        return mapping.findForward( "view" );
View Full Code Here

      if(log.isErrorEnabled()) {
        log.error(msg);
      }
     
        BusinessRuleException bre = new BusinessRuleException();
        bre.addCodedMessage("seteUser.doesNotExist", new String[]{userId});
        throw bre;        
        }
        return vo;
    }
View Full Code Here

        {
          service.createNewScienceProjectFileType(cspftvo);
        }
        catch(final Exception excp)
        {
            final BusinessRuleException bre = new BusinessRuleException();
            bre.addCodedMessage("projectFileType.exists", new String[]{key});
           
            throw bre;
        }
       
        TypeLoader.initializeSystemTypes(super.getServletContext());
View Full Code Here

      }

        SeteUser su = userDao.findByLoginName(vo.getLoginName());

       if(vo.getUserRoles().length < 1){
        BusinessRuleException bre = new BusinessRuleException();
        bre.addCodedMessage("seteUser.NoRolesSelected", new String[]{vo.getLoginName()});
        throw bre;
      }
     
      su.setFirstName(vo.getFirstName());
      su.setMiddleName(vo.getMiddleName());
View Full Code Here

     */
    private void validateUser(CreateSeteUserVo vo) throws BusinessRuleException {
      /* Verify Non violation of Business Rules */
     
      if(StringUtils.isEmpty(vo.getPassword()) || StringUtils.isEmpty(vo.getPassword2())){
        BusinessRuleException bre = new BusinessRuleException();
        bre.addCodedMessage("seteUser.PasswordEmpty", new String[]{""});
        throw bre;
      }
      else if(userDao.findByLoginName(vo.getLoginName()) != null){
        BusinessRuleException bre = new BusinessRuleException();
        bre.addCodedMessage("seteUser.LoginAlreadyExists", new String[]{vo.getLoginName()});
        throw bre;
      }
      else if(!vo.getPassword().equals(vo.getPassword2())){
        BusinessRuleException bre = new BusinessRuleException();
        bre.addCodedMessage("seteUser.PasswordMismatch", new String[]{""});
        throw bre;
      }
      else if(vo.getUserRoles().length < 1){
        BusinessRuleException bre = new BusinessRuleException();
        bre.addCodedMessage("seteUser.NoRolesSelected", new String[]{vo.getLoginName()});
        throw bre;
      }     
    }
View Full Code Here

    public void createNewScienceProject(CreateScienceProjectVo vo) {

        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())));

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

            if(vo.getPartner().equals(vo.getCreator())) {
                BusinessRuleException bre = new BusinessRuleException();
                bre.addCodedMessage("scienceProject.error.adding.student.moreThanOnce");
                throw bre;
            }

            students.add(userDao.findById(Integer.valueOf(vo.getPartner())));
        }
View Full Code Here

    public void createNewSeteUser(CreateSeteUserVo vo) {

        /* Verify Non violation of Business Rules */
        if(userDao.findByLoginName(vo.getLoginName()) != null){
          BusinessRuleException bre = new BusinessRuleException();
          bre.addCodedMessage("seteUser.LoginAlreadyExists", new String[]{vo.getLoginName()});
          throw bre;
        }
        else if(userDao.findByEmailAddress(vo.getEmailAddress()) != null){
          BusinessRuleException bre = new BusinessRuleException();
          bre.addCodedMessage("seteUser.EmailAlreadyExists", new String[]{vo.getEmailAddress()});
          throw bre;
        }

        SeteUser su = new SeteUser();
        su.setFirstName(vo.getFirstName());
View Full Code Here

        if(log.isErrorEnabled()) {
            log.error("Could not process request.", e);
        }

        if(e instanceof BusinessRuleException) {
            BusinessRuleException bre = (BusinessRuleException)e;
            ActionMessages errors = new ActionMessages();
            String[] params = null;
            Map<String, String[]> codedMessages = bre.getCodedMessages();

            for(String c : codedMessages.keySet()) {
                params = codedMessages.get(c);
                if(params != null) {
                    errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(c, params));
View Full Code Here

TOP

Related Classes of org.sete.service.BusinessRuleException

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.