Package org.exoplatform.agenda.service
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 Summary
ConstructorsConstructorDescriptionAgendaCalendarServiceImpl(AgendaCalendarStorage agendaCalendarStorage, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.container.xml.InitParams initParams) -
Method Summary
Modifier and TypeMethodDescriptionintcountCalendars(String username) org.exoplatform.agenda.model.CalendarcreateCalendar(org.exoplatform.agenda.model.Calendar calendar) org.exoplatform.agenda.model.CalendarcreateCalendar(org.exoplatform.agenda.model.Calendar calendar, String username) org.exoplatform.agenda.model.CalendarcreateCalendarInstance(long ownerId) org.exoplatform.agenda.model.CalendarcreateCalendarInstance(long ownerId, long userIdentityId) voiddeleteCalendarById(long calendarId) voiddeleteCalendarById(long calendarId, String username) Deleting a calendar deletes the events it holds.org.exoplatform.agenda.model.CalendargetCalendarById(long calendarId) org.exoplatform.agenda.model.CalendargetCalendarById(long calendarId, String username) getCalendarIdsByOwnerId(long ownerId) List<org.exoplatform.agenda.model.Calendar> getCalendars(int offset, int limit, String username) List<org.exoplatform.agenda.model.Calendar> getCalendarsByOwnerIds(List<Long> ownerIds, String username) org.exoplatform.agenda.model.CalendargetOrCreateCalendarByOwnerId(long ownerId) The default calendar of an owner is its system calendar (theisSystemflag, 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.voidupdateCalendar(org.exoplatform.agenda.model.Calendar calendar) voidupdateCalendar(org.exoplatform.agenda.model.Calendar calendar, String username)
-
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:
getCalendarsin interfaceorg.exoplatform.agenda.service.AgendaCalendarService- Throws:
Exception
-
getCalendarsByOwnerIds
public List<org.exoplatform.agenda.model.Calendar> getCalendarsByOwnerIds(List<Long> ownerIds, String username) throws IllegalAccessException - Specified by:
getCalendarsByOwnerIdsin interfaceorg.exoplatform.agenda.service.AgendaCalendarService- Throws:
IllegalAccessException
-
getCalendarIdsByOwnerId
- Specified by:
getCalendarIdsByOwnerIdin interfaceorg.exoplatform.agenda.service.AgendaCalendarService
-
countCalendars
- Specified by:
countCalendarsin interfaceorg.exoplatform.agenda.service.AgendaCalendarService- Throws:
Exception
-
getCalendarById
public org.exoplatform.agenda.model.Calendar getCalendarById(long calendarId, String username) throws IllegalAccessException - Specified by:
getCalendarByIdin interfaceorg.exoplatform.agenda.service.AgendaCalendarService- Throws:
IllegalAccessException
-
getCalendarById
public org.exoplatform.agenda.model.Calendar getCalendarById(long calendarId) - Specified by:
getCalendarByIdin interfaceorg.exoplatform.agenda.service.AgendaCalendarService
-
getOrCreateCalendarByOwnerId
public org.exoplatform.agenda.model.Calendar getOrCreateCalendarByOwnerId(long ownerId) The default calendar of an owner is its system calendar (theisSystemflag, 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:
getOrCreateCalendarByOwnerIdin interfaceorg.exoplatform.agenda.service.AgendaCalendarService
-
createCalendarInstance
public org.exoplatform.agenda.model.Calendar createCalendarInstance(long ownerId) - Specified by:
createCalendarInstancein interfaceorg.exoplatform.agenda.service.AgendaCalendarService
-
createCalendarInstance
public org.exoplatform.agenda.model.Calendar createCalendarInstance(long ownerId, long userIdentityId) throws IllegalAccessException - Specified by:
createCalendarInstancein interfaceorg.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:
createCalendarin interfaceorg.exoplatform.agenda.service.AgendaCalendarService- Throws:
IllegalAccessException
-
createCalendar
public org.exoplatform.agenda.model.Calendar createCalendar(org.exoplatform.agenda.model.Calendar calendar) - Specified by:
createCalendarin interfaceorg.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:
updateCalendarin interfaceorg.exoplatform.agenda.service.AgendaCalendarService- Throws:
IllegalAccessExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
updateCalendar
public void updateCalendar(org.exoplatform.agenda.model.Calendar calendar) throws org.exoplatform.commons.exception.ObjectNotFoundException - Specified by:
updateCalendarin interfaceorg.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:
deleteCalendarByIdin interfaceorg.exoplatform.agenda.service.AgendaCalendarService- Throws:
IllegalAccessExceptionorg.exoplatform.commons.exception.ObjectNotFoundException
-
deleteCalendarById
public void deleteCalendarById(long calendarId) throws org.exoplatform.commons.exception.ObjectNotFoundException - Specified by:
deleteCalendarByIdin interfaceorg.exoplatform.agenda.service.AgendaCalendarService- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException
-