Package org.opencustomer.db.dao.calendar

Examples of org.opencustomer.db.dao.calendar.CalendarDAO


        return UserVO.class;
    }
   
    public void delete(UserVO entity, Integer userId) throws HibernateException
    {
        new CalendarDAO().delete(entity.getCalendar(), userId);
       
        super.delete(entity, userId);
    }
View Full Code Here


                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
            {
                if (log.isDebugEnabled())
                    log.debug("save user " + saveUser);
View Full Code Here

        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);
View Full Code Here

        try
        {
            if (log.isDebugEnabled())
                log.debug("save calendar (ID:" + calendar.getId() + ")");
           
            new CalendarDAO().update(calendar);
        }
        catch (HibernateException e)
        {
            log.error("problems saving calendar", e);
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("default.error.rollback"));
View Full Code Here

        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);
                   
View Full Code Here

                    else
                        eventMap.put("recurrenceNumber", "0");
                    for(EventCalendarVO eventCalendar :event.getEventCalendars())
                    {
                        if(eventCalendar.getParticipiantType() == EventCalendarVO.ParticipiantType.HOST
                                && eventCalendar.getCalendar() == new CalendarDAO().getForUser(uservo))
                        {
                            eventMap.put("ownevent",Boolean.toString(true));
                        }  
                        else
                            eventMap.put("ownevent",Boolean.toString(false));
View Full Code Here

                calendar.setOwnerUser(user.getId());
                calendar.setAccessGroup(EntityAccess.Access.NONE);
                calendar.setOwnerGroup(user.getProfile().getDefaultUsergroup().getId());
                calendar.setAccessGlobal(EntityAccess.Access.NONE);
               
                new CalendarDAO().insert(calendar, user);
            }
            else
            {
                if(log.isDebugEnabled())
                    log.debug("user has no Ldap group: " + username);
View Full Code Here

       
        user = new UserDAO().getByUserName(principal.getName());
        if(log.isDebugEnabled())
            log.debug("found user " + user);
       
        List<CalendarVO> calendars = new CalendarDAO().getAvailableCalendars(user);
        for(CalendarVO calendar : calendars)
        {
            if(!new EventCalendarDAO().getByCalendar(calendar, false).isEmpty())
                calendarmap.put("/files/" + calendar.getUser().getUserName() + ".ics", calendar);
        }
View Full Code Here

TOP

Related Classes of org.opencustomer.db.dao.calendar.CalendarDAO

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.