Package org.opencustomer.db.vo.system

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


    }

    @Override
    protected boolean isEditable(EditPanel panel, HttpServletRequest request)
    {
        UserVO user         = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
        EventVO event       = (EventVO)panel.getEntity();
        CalendarVO calendar = (CalendarVO)panel.getAttribute("calendar");

        // active event calendar
        EventCalendarVO activeEventCalendar = null;
View Full Code Here


        return participientCalendar && participientEvent;
    }
       
    private boolean isContentEditable(EditPanel panel, CalendarVO calendar, HttpServletRequest request) {
        EventVO event = (EventVO)panel.getEntity();
        UserVO user   = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);

        EventCalendarVO hostEventCalendar   = null;
        EventCalendarVO activeEventCalendar = null;
       
        // identify the host calendar
View Full Code Here

    }
   
    @Override
    protected EntityPanel createPanel(EntityPanel mainPanel, ChooseForm form, HttpServletRequest request, HttpServletResponse response)
    {
        UserVO user = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
       
        EntityPanel panel = new EntityPanel(Panel.Type.CHOOSE, user);
        panel.setTitle(MessageUtil.message(request, "module.calendar.choose.title"));
        panel.setPath("/calendar/choose");
       
View Full Code Here

    }
   
    @Override
    protected void chooseEntity(EntityPanel panel, ChooseForm form, ActionMessages errors, HttpServletRequest request, HttpServletResponse response)
    {
        UserVO user = (UserVO)panel.getEntity();
       
        // add/remove calendar
        if(form.getId() > 0) {
            try {
                CalendarVO calendar = new CalendarDAO().getById(form.getId());
               
                if(user.getCalendars().contains(calendar)) {
                    if(log.isDebugEnabled())
                        log.debug("remove calendar "+calendar);
                   
                    user.getCalendars().remove(calendar);
                } else {
                    if(log.isDebugEnabled())
                        log.debug("add calendar "+calendar);
                   
                    user.getCalendars().add(calendar);
                }
                HibernateContext.getSession().clear();
               
                new UserDAO().update(user);
            } catch (HibernateException e) {
View Full Code Here

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

        // reload list
        List<CalendarListVO> list = null;
        long count = 0;

        Sort sort = null;
        if (form.getSort() == null)
            sort = new Sort(UserDAO.SORT_USERNAME, true);
        else
            sort = Sort.parseParam(form.getSort());

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

        String paramUserName = form.getUserName();
        String paramName = form.getName();

        List<CalendarVO> excludedCalendars = new ArrayList<CalendarVO>();
        excludedCalendars.add(user.getCalendar());
       
        CalendarListDAO dao = new CalendarListDAO();
       
        count = dao.countList(paramName, paramUserName, null, null, excludedCalendars, user);
        if (count < page.getFirstEntry())
View Full Code Here

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

    @Override
    protected void search(PageContactForm form, ActionMessages errors, HttpServletRequest request)
    {
        UserVO user       = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
        CompanyVO company = (CompanyVO) getPanel().getEntity();
        UserConfiguration conf = (UserConfiguration)request.getSession().getAttribute(Globals.CONFIGURATION_KEY);

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

        return panel;
    }
   
    @Override
    public void createEntity(ActionMessages errors, LoadForm form, Hashtable<String, Object> attributes, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        UserVO activeUser = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
        if (log.isDebugEnabled())
            log.debug("new company");
       
        CompanyVO company = new CompanyVO();
        company.setAssignedUser(activeUser);
       
        company.setAccessUser(EntityAccess.Access.WRITE_SYSTEM);
        company.setOwnerUser(activeUser.getId());
        company.setAccessGroup(EntityAccess.Access.NONE);
        company.setOwnerGroup(activeUser.getProfile().getDefaultUsergroup().getId());
        company.setAccessGlobal(EntityAccess.Access.WRITE_SYSTEM);
       
        attributes.put("company", company);
    }
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 user = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);

        try
        {
            new CompanyDAO().delete((CompanyVO)panel.getEntity());
        }
View Full Code Here

public class SaveAction extends EditSaveAction {
    private static Logger log = Logger.getLogger(SaveAction.class);
   
    @Override
    protected void saveEntity(EditPanel panel, ActionMessages errors, HttpServletRequest request) {
        UserVO user = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);

        CompanyVO company = (CompanyVO) panel.getEntity();

        try {
            // speicher die Firma
View Full Code Here

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

    @Override
    protected void preOperations(E form, ActionMessages errors, HttpServletRequest request)
    {
        UserVO activeUser = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
       
        EditPanel panel = getPanel();
       
        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)
                {
                    return usergroup1.getName().compareTo(usergroup2.getName());
                }
            });           
            panel.setAttribute("system_usergroups", usergroups);
           
            if(ea != null) {
                UserVO user = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
               
                Page activePage = panel.getActivePage();
               
                activePage.setEditable(isEditable(panel, user, ea, request));
            }
           
            UserVO ownerUser = null;
   
            if(panel.getAttribute("system_ownerUser") == null && ea.getOwnerUser() > 0) {
                if(log.isDebugEnabled())
                    log.debug("load user for owner of entity access");
               
                ownerUser = new UserDAO().getById(ea.getOwnerUser());
                panel.setAttribute("system_ownerUser", ownerUser);
            }
           
            if(ea instanceof StampedVO) {
                StampedVO vo = (StampedVO)ea;
                panel.setAttribute("system_isStamped", Boolean.TRUE);
               
                if(panel.getAttribute("system_createUser") == null && vo.getCreateUser() != null && vo.getCreateUser() > 0) {
                    UserVO user = null;
                    if(vo.getCreateUser().equals(ea.getOwnerUser())) {
                        user = ownerUser;
                    } else {
                        user = new UserDAO().getById(vo.getCreateUser());
                    }
                    panel.setAttribute("system_createUser", user);
                }
   
                if(panel.getAttribute("system_modifyUser") == null && vo.getModifyUser() != null && vo.getModifyUser() > 0) {
                    UserVO user = null;
                    if(vo.getModifyUser().equals(ea.getOwnerUser())) {
                        user = ownerUser;
                    } else if(vo.getModifyUser().equals(vo.getCreateUser())) {
                        user = ownerUser;
                    } else {
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.