Package org.opencustomer.db.dao.system

Examples of org.opencustomer.db.dao.system.UsergroupDAO


    }
   
    @Override
    public void loadEnvironment(ActionMessages errors, EditLoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
    {
        attributes.put("usergroups", new UsergroupDAO().getAll());
    }
View Full Code Here


        Page page = new Page(conf.getIntValue(UserConfiguration.Key.LIST_NUMBER_ROWS), form.getPage());

        String paramName = form.getName();
        UsergroupDAO.AdminSelect paramAdmin = EnumUtility.valueOf(UsergroupDAO.AdminSelect.class, form.getAdmin(), UsergroupDAO.AdminSelect.ALL);
               
        UsergroupDAO dao = new UsergroupDAO();

        count = dao.countList(paramName, paramAdmin, user);
        if (count < page.getFirstEntry())
            page.setPage(1);

        if (count > 0)
            list = dao.getList(paramName, paramAdmin, sort, page, user);
        else
            list = new ArrayList<UsergroupVO>();

        ScrollBean scroll = new ScrollBean();
        scroll.setCount(count);
View Full Code Here

        if (log.isDebugEnabled())
            log.debug("delete usergroup (ID:" + usergroup.getId() + ")");

        try
        {
            new UsergroupDAO().delete(usergroup);
        }
        catch (HibernateException e)
        {
            log.error("could not save usergroup", e);
           
View Full Code Here

        UsergroupVO usergroup = (UsergroupVO) panel.getEntity();
        UserVO activeUser = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);

        try
        {
            UsergroupDAO dao = new UsergroupDAO();
            if (usergroup.getId() == null)
            {
                if (log.isDebugEnabled())
                    log.debug("create usergroup");
                dao.insert(usergroup, activeUser);
            }
            else
            {
                if (log.isDebugEnabled())
                    log.debug("save usergroup (ID:" + usergroup.getId() + ")");
                dao.update(usergroup, activeUser);
            }
        }
        catch (HibernateException e)
        {
            log.error("problems saving usergroup", e);
View Full Code Here

        if (usergroup.getName() != null)
        {
            try
            {
                UsergroupDAO dao = new UsergroupDAO();

                UsergroupVO editUsergroup = dao.getByName(usergroup.getName());
                if (editUsergroup != null && !editUsergroup.getId().equals(usergroup.getId())) {
                    if(editUsergroup.isAdmin())
                        errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("module.system.usergroup.block.error.nameExistsInAdmin"));
                    else
                        errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("module.system.usergroup.block.error.nameExists"));
View Full Code Here

        try
        {
            UserVO user = (UserVO) panel.getEntity();

            UsergroupVO usergroup = new UsergroupDAO().getById(form.getId());
           
            if (user.getProfile().getLdapGroup() == null && !user.getProfile().getUsergroups().contains(usergroup))
                user.getProfile().getUsergroups().add(usergroup);
        }
        catch (HibernateException e)
View Full Code Here

        if (log.isDebugEnabled())
            log.debug("load usergroup (ID:" + form.getId() + ")");

        try
        {
            UsergroupVO usergroup = new UsergroupDAO().getById(form.getId());

            attributes.put("usergroup", usergroup);
            attributes.put("users", new UserDAO().getForUsergroup(usergroup));
            attributes.put("roles", new RoleDAO().getForDefaultUsergroup(usergroup));
        }
View Full Code Here

        try
        {
            RoleVO role = (RoleVO) panel.getEntity();

            UsergroupVO usergroup = new UsergroupDAO().getById(form.getId());
           
            role.setDefaultUsergroup(usergroup);
        }
        catch (HibernateException e)
        {
View Full Code Here

        EntityAccess ea = getEntityAccess(request);
       
        if(panel.getAttribute("system_entityAccess") == null) {
            panel.setAttribute("system_entityAccess", ea);

            List<UsergroupVO> usergroups = new UsergroupDAO().getList(null, UsergroupDAO.AdminSelect.ALL, new Sort(UsergroupDAO.SORT_NAME, true), null, activeUser);
           
            // load a set usergroup where you do not have rights
            boolean usergroupAccess = false;
            for(UsergroupVO vo : usergroups) {
                if(ea.getOwnerGroup().equals(vo.getId())) {
                    usergroupAccess = true;
                    break;
                }
            }
            if(!usergroupAccess) {
                UsergroupVO vo = new UsergroupDAO().getById(ea.getOwnerGroup());
                usergroups.add(0, vo);
            }
            Collections.sort(usergroups, new Comparator<UsergroupVO>() {
                public int compare(UsergroupVO usergroup1, UsergroupVO usergroup2)
                {
View Full Code Here

        UsergroupDAO.AdminSelect adminSelect = UsergroupDAO.AdminSelect.NOT_ADMIN;
        if(isAdmin(panel))
            adminSelect = UsergroupDAO.AdminSelect.ADMIN;
       
        UsergroupDAO dao = new UsergroupDAO();
        count = dao.countList(paramName, adminSelect, activeUser);
        if (count < page.getFirstEntry())
            page.setPage(1);

        if (count > 0)
            list = dao.getList(paramName, adminSelect, sort, page, activeUser);
        else
            list = new ArrayList<UsergroupVO>();

        ScrollBean scroll = new ScrollBean();
        scroll.setCount(count);
View Full Code Here

TOP

Related Classes of org.opencustomer.db.dao.system.UsergroupDAO

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.