Package net.sf.archimede.jsf.util

Examples of net.sf.archimede.jsf.util.ResourceBundleUtil


        this.usernameComponent = usernameComponent;
    }
   
    public String newUser() {
        if (!password.equals(passwordVerify)) {
          ResourceBundleUtil bundleUtil = ResourceBundleUtil.getInstance();
            FacesMessage message = new FacesMessage( bundleUtil.getMessage("password_notEqual") );
            FacesContext context = FacesContext.getCurrentInstance();
            context.addMessage(this.passwordComponent.getClientId(context), message);
            return "";
        }
        if (password.length() < 6) {
          ResourceBundleUtil bundleUtil = ResourceBundleUtil.getInstance();
            FacesMessage message = new FacesMessage( bundleUtil.getMessage("password_tooShort") );
            FacesContext context = FacesContext.getCurrentInstance();
            context.addMessage(this.passwordComponent.getClientId(context), message);
            return "";
        }
       
        User user = new UserImpl();
        user.setUsername(this.username);
        user.setPassword(this.password);
        try {
            UserDao.createInstance().save(user);
        } catch (ObjectExistsException e) {
          ResourceBundleUtil bundleUtil = ResourceBundleUtil.getInstance();
            FacesMessage message = new FacesMessage( bundleUtil.getMessage("username_alreadySelected") );
            FacesContext context = FacesContext.getCurrentInstance();
            context.addMessage(this.usernameComponent.getClientId(context), message);
            return "";
        }
       
        ResourceBundleUtil bundleUtil = ResourceBundleUtil.getInstance();
        FacesMessage message = new FacesMessage( bundleUtil.getMessage("user_added") );
        FacesContext context = FacesContext.getCurrentInstance();
        context.addMessage(null, message);
       
        this.username = null;
        this.password = null;
View Full Code Here


       
        VisitBean visitBean = (VisitBean) FacesContext.getCurrentInstance().getApplication().createValueBinding(VisitBean.BEAN_REF).getValue(FacesContext.getCurrentInstance());
        this.username = visitBean.getCredentials().getUsername();
       
        if (!password.equals(passwordVerify)) {
          ResourceBundleUtil bundleUtil = ResourceBundleUtil.getInstance();
            FacesMessage message = new FacesMessage( bundleUtil.getMessage("password_notEqual") );
            FacesContext context = FacesContext.getCurrentInstance();
            context.addMessage(this.passwordComponent.getClientId(context), message);
            return "";
        }
        if (password.length() < 6) {
          ResourceBundleUtil bundleUtil = ResourceBundleUtil.getInstance();
            FacesMessage message = new FacesMessage( bundleUtil.getMessage("password_tooShort") );
            FacesContext context = FacesContext.getCurrentInstance();
            context.addMessage(this.passwordComponent.getClientId(context), message);
            return "";
        }
       
        if (!UserDao.createInstance().exists(this.username, this.oldPassword)) {
          ResourceBundleUtil bundleUtil = ResourceBundleUtil.getInstance();
            FacesMessage message = new FacesMessage( bundleUtil.getMessage("authentication_failed") );
            FacesContext context = FacesContext.getCurrentInstance();
            context.addMessage(null , message);
            return "";
        }
      
        UserDao userDao = UserDao.createInstance();
        User updatedUser = new UserImpl();
        updatedUser.setUsername(this.username);
        updatedUser.setPassword(this.password);
        userDao.update(updatedUser);
       
        visitBean.setCredentials(new CredentialsWrapper(this.username, this.password));
       
        ResourceBundleUtil bundleUtil = ResourceBundleUtil.getInstance();
        FacesMessage message = new FacesMessage( bundleUtil.getMessage("user_updated") );
        FacesContext context = FacesContext.getCurrentInstance();
        context.addMessage(null, message);
       
        this.username = null;
        this.password = null;
View Full Code Here

            request.getSession(true).setAttribute(SESSION_REF, this);           
           
            this.credentials = cw;
        } catch (AuthenticationException ae) {
            FacesContext context = FacesContext.getCurrentInstance();
            ResourceBundleUtil bundleUtil =  ResourceBundleUtil.getInstance()
            FacesMessage message = new FacesMessage( bundleUtil.getMessage("authentication_failed") );          
            String clientId = this.usernameInput.getClientId(context);
            context.addMessage(clientId, message);
            return "";
        }
       
View Full Code Here

TOP

Related Classes of net.sf.archimede.jsf.util.ResourceBundleUtil

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.