Package org.opencustomer.db.vo.calendar

Examples of org.opencustomer.db.vo.calendar.CalendarVO


   
    public static Date calculateRecurrenceEndDate(EventVO event)
    {
        Date recurrenceEndDate = event.getStartDate();
       
        CalendarVO calendar = null;
        for(EventCalendarVO vo : event.getEventCalendars()) {
            if(vo.getParticipiantType().equals(EventCalendarVO.ParticipiantType.HOST)) {
                calendar = vo.getCalendar();
            }
        }
View Full Code Here


        super.delete(entity, userId);
    }

    public CalendarVO getForUser(UserVO user)
    {
        CalendarVO calendar = null;

        try
        {
            StringBuilder hql = new StringBuilder();
            hql.append("FROM ").append(getEntityClass().getName()).append(" c ");
View Full Code Here

        }
       
        if(saveOrUpdateEvent.getEntity() instanceof EventVO)
        {
            EventVO event = (EventVO) saveOrUpdateEvent.getEntity();
            CalendarVO mainCalendar = null;
            for(EventCalendarVO vo : event.getEventCalendars()) {
                if(EventCalendarVO.ParticipiantType.HOST.equals(vo.getParticipiantType())) {
                    mainCalendar = vo.getCalendar();
                }
            }
View Full Code Here

                if(saveUser.getLocale() == null)
                    saveUser.setLocale(activeUser.getLocale());

                new UserDAO().insert(saveUser, activeUser);

                CalendarVO calendar = new CalendarVO();
                calendar.setUser(saveUser);
                calendar.setAccessUser(EntityAccess.Access.WRITE_SYSTEM);
                calendar.setOwnerUser(saveUser.getId());
                calendar.setAccessGroup(EntityAccess.Access.NONE);
                calendar.setOwnerGroup(saveUser.getProfile().getDefaultUsergroup().getId());
                calendar.setAccessGlobal(EntityAccess.Access.WRITE_SYSTEM);
               
                new CalendarDAO().insert(calendar, activeUser);
            }
            else
            {
View Full Code Here

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

    @Override
    protected EntityAccess getEntityAccess(HttpServletRequest request) {
        EventVO event = (EventVO)getPanel().getEntity();
        CalendarVO calendar = (CalendarVO)getPanel().getAttribute("calendar");
       
        for(EventCalendarVO eventCalendar : event.getEventCalendars()) {
            if(calendar.equals(eventCalendar.getCalendar())) {
                if(log.isDebugEnabled())
                    log.debug("use for entity access: "+eventCalendar);
               
                return eventCalendar;
            }
View Full Code Here

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

        boolean participientCalendar = EntityAccessUtility.isAccessGranted(user, ea, EntityAccess.Access.WRITE_SYSTEM);
        boolean participientEvent = EntityAccessUtility.isAccessGranted(user, calendar, EntityAccess.Access.WRITE_SYSTEM);
       
        if(log.isDebugEnabled())
View Full Code Here

    @Override
    protected EntityAccess getEntityAccess(HttpServletRequest request)
    {
        EventVO event = (EventVO)getPanel().getEntity();
        CalendarVO calendar = (CalendarVO)getPanel().getAttribute("calendar");
       
        for(EventCalendarVO eventCalendar : event.getEventCalendars()) {
            if(calendar.equals(eventCalendar.getCalendar())) {
                return eventCalendar;
            }
        }
       
        return  null;
View Full Code Here

                || form.getDoStatusDelete().isSelected()) {
            if (log.isDebugEnabled())
                log.debug("change status");
           
            UserVO user = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
            CalendarVO calendar = (CalendarVO)getPanel().getAttribute("calendar");
            EventCalendarVO userEventCalendar = null;
           
            List<EventCalendarVO> eventCalendars = (List<EventCalendarVO>)getPanel().getAttribute("eventCalendars");
            for(EventCalendarVO eventCalendar : eventCalendars) {
                if(calendar.equals(eventCalendar.getCalendar())
                        && !eventCalendar.getParticipiantType().equals(EventCalendarVO.ParticipiantType.HOST)) {
                    userEventCalendar = eventCalendar;
                    break;
                }
            }
View Full Code Here

    {
        UserVO activeUser   = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
        boolean update = true;
       
        // Pr�fe ob schon ein Standardkalender besteht
        CalendarVO calendar = (CalendarVO) panel.getAttribute("calendar");

        ActionMessages errors = getErrors(request);
        if(errors.isEmpty()) {
            if (form.getId() > 0) {
                calendar = new CalendarDAO().getById(form.getId());
                if (!EntityAccessUtility.isAccessGranted(activeUser, calendar, EntityAccess.Access.READ)) {
                    log.debug("user tries to access an invalid calendar");
                    errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("default.error.invalidEntity", calendar.getId()));
                    calendar = null;
                   
                    // refresh the user
                    UserVO user = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);
                    user = new UserDAO().getById(user.getId());
                    if(user != null) {
                        request.getSession().setAttribute(Globals.USER_KEY, user);
                    } else {
                        log.info("could not reload user (may be deleted)");
                    }
                } else {
                    if (log.isDebugEnabled())
                        log.debug("use calendar: " + calendar);
                }
            }
           
            if (form.isMain() || calendar == null) {
                calendar = new CalendarDAO().getForUser(activeUser);
                if (log.isDebugEnabled())
                    log.debug("use calendar: " + calendar);
            }
        } else if (log.isDebugEnabled()) {
            log.debug("found errors > use old calendar: " + calendar);
        }
       
        String title = MessageUtil.message(request, "module.calendar.showCalendar.month.headLine")+" - ";
        if(calendar.getUser().equals(activeUser)) {
            title += MessageUtil.message(request, "module.calendar.personalCalendar");
        } else {
            title += calendar.getUser().getUserName();
        }
        panel.setTitle(title);

       
        // update calendar
        if (!calendar.equals(panel.getAttribute("calendar"))) {
            if (log.isDebugEnabled())
                log.debug("update calendar");
            panel.removeAttribute("calendar");
            panel.removeAttribute("calendarView");
        }
View Full Code Here

    @Override
    protected boolean validateData(EditPanel panel, ActionMessages errors, HttpServletRequest request)
    {
        UserVO user            = (UserVO) request.getSession().getAttribute(Globals.USER_KEY);
        EventVO event          = (EventVO) panel.getAttribute("event");
        CalendarVO calendar    = (CalendarVO) panel.getAttribute("calendar");
       
        EntityAccess testEntity = null;
        if (event.getId() == null)
            testEntity = calendar;
        else {
            EventCalendarVO myEventCalendar = null;
           
            for(EventCalendarVO eventCalendar : event.getEventCalendars()) {
                if(calendar.equals(eventCalendar.getCalendar())) {
                    testEntity = eventCalendar;
                    break;
                }
            }
           
View Full Code Here

TOP

Related Classes of org.opencustomer.db.vo.calendar.CalendarVO

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.