Package org.opencustomer.db.vo.system

Examples of org.opencustomer.db.vo.system.UserVO


    }
   
    @Override
    protected void search(Panel panel, ListForm form, boolean formCached, ActionMessages errors, HttpServletRequest request, HttpServletResponse response)
    {
        UserVO user   = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
        UserConfiguration conf = (UserConfiguration)request.getSession().getAttribute(Globals.CONFIGURATION_KEY);

        List list = null;
        long count = 0;
View Full Code Here


    protected void chooseEntity(EntityPanel panel, AddUserForm form, ActionMessages errors, HttpServletRequest request, HttpServletResponse response)
    {
        if (log.isDebugEnabled())
            log.debug("add calendar for user with ID: " + form.getId());

        UserVO user = new UserDAO().getById(form.getId());

        if (user == null || user.getCalendar() == null)
        {
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("default.error.invalidEntity", form.getId()));

            log.error("problems loading calendar for user (ID:" + form.getId() + ")");
        }
        else
        {
            EventVO event = (EventVO) panel.getEntity();
           
            EventCalendarVO eventCalendar = new EventCalendarVO();
            eventCalendar.setEvent(event);
            eventCalendar.setCalendar(user.getCalendar());
            eventCalendar.setInvitationStatus(EventCalendarVO.InvitationStatus.NEW);
            eventCalendar.setParticipiantType(EventCalendarVO.ParticipiantType.GUEST);
           
            eventCalendar.setOwnerUser(user.getCalendar().getOwnerUser());
            eventCalendar.setOwnerGroup(user.getCalendar().getOwnerGroup());
            eventCalendar.setAccessUser(user.getCalendar().getAccessUser());
            eventCalendar.setAccessGroup(user.getCalendar().getAccessGroup());
            eventCalendar.setAccessGlobal(user.getCalendar().getAccessGlobal());
           
            if (!event.getEventCalendars().contains(eventCalendar))
                event.getEventCalendars().add(eventCalendar);
        }
    }
View Full Code Here

    }
   
    @Override
    protected void search(Panel panel, ListForm form, boolean formCached, ActionMessages errors, HttpServletRequest request, HttpServletResponse response)
    {
        UserVO user = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
        UserConfiguration conf = (UserConfiguration)request.getSession().getAttribute(Globals.CONFIGURATION_KEY);

        List<UsergroupVO> list = null;
        long count = 0;
View Full Code Here

    }
   
    @Override
    protected void search(Panel panel, ListForm form, boolean formCached, ActionMessages errors, HttpServletRequest request, HttpServletResponse response)
    {
        UserVO user = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
        UserConfiguration conf = (UserConfiguration)request.getSession().getAttribute(Globals.CONFIGURATION_KEY);

        List<UserVO> list = null;
        long count = 0;
View Full Code Here

    private static Logger log = Logger.getLogger(DeleteAction.class);

    @Override
    protected void deleteEntity(DeletePanel panel, HttpServletRequest request, HttpServletResponse response, ActionMessages errors)
    {
        UserVO activeUser = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
       
        UserVO deleteUser = (UserVO) panel.getEntity();

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

        if (deleteUser.getId() != null)
        {
            try
            {
                // l�sche nicht den aktiven Benutzer
                if (deleteUser.getProfile().getLdapGroup() == null && !deleteUser.equals(activeUser))
                    new UserDAO().delete(deleteUser, activeUser.getId());
            }
            catch (HibernateException e)
            {
                errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("default.error.couldNotDeleteEntity", panel.getEntity().getId()));

                log.error("could not delete user with id: " + deleteUser.getId(), e);
            }
        }
    }
View Full Code Here

    @Override
    protected void saveEntity(EditPanel panel, ActionMessages errors, HttpServletRequest request)
    {
        UsergroupVO usergroup = (UsergroupVO) panel.getEntity();
        UserVO activeUser = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);

        try
        {
            UsergroupDAO dao = new UsergroupDAO();
            if (usergroup.getId() == null)
View Full Code Here

        for (HttpSession session : monitor.getUserSessions()) {
            SessionInfoBean bean = new SessionInfoBean();
            bean.setLoginTime(new Date(session.getCreationTime()));
            bean.setLastAccessTime(new Date(session.getLastAccessedTime()));
            bean.setInactiveTime(System.currentTimeMillis() - session.getLastAccessedTime());
            UserVO user = (UserVO) session.getAttribute(Globals.USER_KEY);
            if (user != null)
                bean.setUsername(user.getUserName());
            list.add(bean);
        }

        Collections.sort(list, new Comparator<SessionInfoBean>() {
            public int compare(SessionInfoBean bean1, SessionInfoBean bean2)
View Full Code Here

    @Override
    protected void chooseEntity(EntityPanel panel, AddPersonForm form, ActionMessages errors, HttpServletRequest request, HttpServletResponse response)
    {
        try
        {
            UserVO user = (UserVO) panel.getEntity();
           
            if(!user.getProfile().getRole().isAdmin()) {
                PersonVO person = new PersonDAO().getById(form.getId());
                user.setPerson(person);
            }
        }
        catch (HibernateException e)
        {
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("default.error.invalidEntity", form.getId()));
View Full Code Here

        }
    }

    @Override
    protected List<PersonVO> getIgnoredPersons(EntityPanel panel){
        UserVO user = (UserVO) panel.getEntity();
       
        List<PersonVO> ignoredPersons = new ArrayList<PersonVO>();
        for(PersonVO person : new PersonDAO().getWithUser(user.getPerson()))
            ignoredPersons.add(person);
       
        return ignoredPersons;
    }
View Full Code Here

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

        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)
        {
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("default.error.invalidEntity", new Integer(form.getId())));
View Full Code Here

TOP

Related Classes of org.opencustomer.db.vo.system.UserVO

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.