Package dbbeans

Examples of dbbeans.Users


     * @param password
     * @param layout
     */
    public void addUser(String user, String password, int layout) {
        try {
            usersController.create(new Users(0, user, password, layout));
        } catch (RollbackFailureException ex) {
            Logger.getLogger(MainController.class.getName()).log(Level.SEVERE, null, ex);
        } catch (Exception ex) {
            Logger.getLogger(MainController.class.getName()).log(Level.SEVERE, null, ex);
        }
View Full Code Here


     * @param user
     * @param password
     * @return
     */
    public boolean loginUser(String user, String password) {
        Users u = usersController.getUserByUser(user);
        if (u != null) {
            if (u.getPassword().equals(password)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

        }
    }

    public void setLayout(int id, int layout) {
        try {
            Users u = usersController.findUsers(id);
            u.setLayout(layout);
            usersController.edit(u);
        } catch (NonexistentEntityException ex) {
            Logger.getLogger(MainController.class.getName()).log(Level.SEVERE, null, ex);
        } catch (RollbackFailureException ex) {
            Logger.getLogger(MainController.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here

    public void destroy(Integer id) throws NonexistentEntityException, RollbackFailureException, Exception {
        EntityManager em = null;
        try {
            utx.begin();
            em = getEntityManager();
            Users users;
            try {
                users = em.getReference(Users.class, id);
                users.getId();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The users with id " + id + " no longer exists.", enfe);
            }
            em.remove(users);
            utx.commit();
View Full Code Here

     * @return
     * @throws Exception
     */
    @Override
    public String execute() throws Exception {
        Users user;
        Roles role;
        if (!checkIfRoleExists("webuser")) {
            createRole("webuser", "Web-site users role");
        }
        try {
View Full Code Here

    }

    private Users createUserEntityAndRelateRole(String role) {
        List<Roles> webUserRoleList=null;
        logger.log(Level.INFO, "Parameters input are = {0}, {1}, {2}, {3}", new Object[]{username, password, mailinglist, email});
        Users user = new Users();
        user.setUsername(username);
        user.setPassword(password);
        user.setEmail(email);
        boolean b = false;
        try {
        webUserRoleList = DBInitializer.getRoleByID(role);
        } catch (Exception e) {
            logger.log(Level.SEVERE, "Role: WebUser retrival failed. {0}", e.getMessage());                       
        }
        user.setRolesList(webUserRoleList);
        if (mailinglist == true) {
            user.setMailinglist(Character.valueOf('Y'));
        } else {
            user.setMailinglist(Character.valueOf('N'));
        }
        logger.log(Level.INFO, "User Role List: {0}", user.getRolesList().listIterator().next().toString());
        return user;
    }
View Full Code Here

            } else {
                drawingExists = true;
            }
            // DBInitializer.getUserByID throws Exception
            //   String usid = (String)session.getAttribute("userID");
            Users u = DBInitializer.getUsersByID(userID);
            dr.setUsers(u);
            dr.setVXML(vXML);
            dr.setDatetime(new Date());
            if (!drawingExists) {
                u.getDrawingsList().add(dr);
                DBInitializer.tranxUpdate(u);
                DBInitializer.tranxPersist(dr);
            } else {
                DBInitializer.tranxUpdate(dr);
            }
View Full Code Here

TOP

Related Classes of dbbeans.Users

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.