Class AgendaCalendarServiceImpl

java.lang.Object
org.exoplatform.agenda.service.AgendaCalendarServiceImpl
All Implemented Interfaces:
org.exoplatform.agenda.service.AgendaCalendarService

public class AgendaCalendarServiceImpl extends Object implements org.exoplatform.agenda.service.AgendaCalendarService
  • Constructor Details

    • AgendaCalendarServiceImpl

      public AgendaCalendarServiceImpl(AgendaCalendarStorage agendaCalendarStorage, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.container.xml.InitParams initParams)
  • Method Details

    • getCalendars

      public List<org.exoplatform.agenda.model.Calendar> getCalendars(int offset, int limit, String username) throws Exception
      Specified by:
      getCalendars in interface org.exoplatform.agenda.service.AgendaCalendarService
      Throws:
      Exception
    • getCalendarsByOwnerIds

      public List<org.exoplatform.agenda.model.Calendar> getCalendarsByOwnerIds(List<Long> ownerIds, String username) throws IllegalAccessException
      Specified by:
      getCalendarsByOwnerIds in interface org.exoplatform.agenda.service.AgendaCalendarService
      Throws:
      IllegalAccessException
    • countCalendars

      public int countCalendars(String username) throws Exception
      Specified by:
      countCalendars in interface org.exoplatform.agenda.service.AgendaCalendarService
      Throws:
      Exception
    • getCalendarById

      public org.exoplatform.agenda.model.Calendar getCalendarById(long calendarId, String username) throws IllegalAccessException
      Specified by:
      getCalendarById in interface org.exoplatform.agenda.service.AgendaCalendarService
      Throws:
      IllegalAccessException
    • getCalendarById

      public org.exoplatform.agenda.model.Calendar getCalendarById(long calendarId)
      Specified by:
      getCalendarById in interface org.exoplatform.agenda.service.AgendaCalendarService
    • getOrCreateCalendarByOwnerId

      public org.exoplatform.agenda.model.Calendar getOrCreateCalendarByOwnerId(long ownerId)
      The default calendar of an owner is its system calendar (the isSystem flag, not the oldest row): it is created lazily here when absent — even when the owner already has user-created, non-system calendars — and can never be deleted, so this method always returns a usable default.
      Specified by:
      getOrCreateCalendarByOwnerId in interface org.exoplatform.agenda.service.AgendaCalendarService
    • createCalendarInstance

      public org.exoplatform.agenda.model.Calendar createCalendarInstance(long ownerId)
      Specified by:
      createCalendarInstance in interface org.exoplatform.agenda.service.AgendaCalendarService
    • createCalendarInstance

      public org.exoplatform.agenda.model.Calendar createCalendarInstance(long ownerId, long userIdentityId) throws IllegalAccessException
      Specified by:
      createCalendarInstance in interface org.exoplatform.agenda.service.AgendaCalendarService
      Throws:
      IllegalAccessException
    • createCalendar

      public org.exoplatform.agenda.model.Calendar createCalendar(org.exoplatform.agenda.model.Calendar calendar, String username) throws IllegalAccessException
      Specified by:
      createCalendar in interface org.exoplatform.agenda.service.AgendaCalendarService
      Throws:
      IllegalAccessException
    • createCalendar

      public org.exoplatform.agenda.model.Calendar createCalendar(org.exoplatform.agenda.model.Calendar calendar)
      Specified by:
      createCalendar in interface org.exoplatform.agenda.service.AgendaCalendarService
    • updateCalendar

      public void updateCalendar(org.exoplatform.agenda.model.Calendar calendar, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      updateCalendar in interface org.exoplatform.agenda.service.AgendaCalendarService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • updateCalendar

      public void updateCalendar(org.exoplatform.agenda.model.Calendar calendar) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      updateCalendar in interface org.exoplatform.agenda.service.AgendaCalendarService
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • deleteCalendarById

      public void deleteCalendarById(long calendarId, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Deleting a calendar deletes the events it holds.

      It used to move them into the owner's default calendar instead, on the reading that a calendar is an organizational label rather than a lifecycle boundary. In practice that put the events somewhere the user had not chosen, mixed with the ones already there and no longer separable from them — and undoing it meant finding them one by one.

      On a calendar bound to a remote account it was worse than untidy: the events landed in the default calendar, which the automatic-copy setting then pushed back to the server, so deleting a calendar could add events to the account it came from.

      The confirmation dialog is where this is decided, and it now says what happens rather than promising the opposite.

      Specified by:
      deleteCalendarById in interface org.exoplatform.agenda.service.AgendaCalendarService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • deleteCalendarById

      public void deleteCalendarById(long calendarId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      deleteCalendarById in interface org.exoplatform.agenda.service.AgendaCalendarService
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException