Package org.exoplatform.agenda.service
Interface AgendaCalendarService
public interface AgendaCalendarService
-
Method Summary
Modifier and TypeMethodDescriptionintcountCalendars(String username) Count available calendars for a designated usercreateCalendar(Calendar calendar) Creates a new calendarcreateCalendar(Calendar calendar, String username) Creates a new calendarcreateCalendarInstance(long ownerId) Create newCalendarobject instancecreateCalendarInstance(long ownerId, long userIdentityId) Create newCalendarobject instancevoiddeleteCalendarById(long calendarId) Deletes an existing calendarvoiddeleteCalendarById(long calendarId, String username) Deletes an existing calendargetCalendarById(long calendarId) Retrieves a calendar identified by its technical identifier.getCalendarById(long calendarId, String username) Retrieves a calendar identified by its technical identifier.getCalendars(int offset, int limit, String username) Retrieve list of calendars for a designated usergetCalendarsByOwnerIds(List<Long> ownerIds, String username) getOrCreateCalendarByOwnerId(long ownerId) voidupdateCalendar(Calendar calendar) Updates an existing calendarvoidupdateCalendar(Calendar calendar, String username) Updates an existing calendar
-
Method Details
-
getCalendars
Retrieve list of calendars for a designated user -
countCalendars
Count available calendars for a designated user- Parameters:
username- User name accessing calendars- Returns:
- count of available calendars
- Throws:
Exception- when an error occurs while accessing database
-
getCalendarById
Retrieves a calendar identified by its technical identifier.- Parameters:
calendarId- technical identifier of a calendarusername- User name accessing calendar- Returns:
- A
Calendarobject - Throws:
IllegalAccessException- when user is not authorized to access calendar
-
getCalendarById
Retrieves a calendar identified by its technical identifier.- Parameters:
calendarId- technical identifier of a calendar- Returns:
- A
Calendarobject
-
getOrCreateCalendarByOwnerId
-
getCalendarsByOwnerIds
List<Calendar> getCalendarsByOwnerIds(List<Long> ownerIds, String username) throws IllegalAccessException - Parameters:
ownerIds-ListofIdentitytechnical identifierusername- User accessing list of calendars- Returns:
ListCalendarcorresponding to calendar objects of owners.- Throws:
IllegalAccessException- when user doesn't have acces to one of the calendars
-
createCalendar
Creates a new calendar- Parameters:
calendar-Calendarobject to createusername- User name creating calendar- Returns:
- created
Calendarwith generated technical identifier - Throws:
IllegalAccessException- when user is not authorized to create a calendar for the designated owner defined in object
-
createCalendar
Creates a new calendar -
createCalendarInstance
Create newCalendarobject instance -
createCalendarInstance
Create newCalendarobject instance- Parameters:
ownerId-Identitytechnical id of theCalendaruserIdentityId- user identity Technical Identifier accessingCalendar- Returns:
Calendarobject instance- Throws:
IllegalAccessException- when user is not authorized to access calendar of the designated owner
-
updateCalendar
void updateCalendar(Calendar calendar, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Updates an existing calendar- Parameters:
calendar-Calendarobject to updateusername- User name updating calendar- Throws:
IllegalAccessException- when user is not authorized to update the calendarorg.exoplatform.commons.exception.ObjectNotFoundException- when the calendar identified by its technical identifier is not found
-
updateCalendar
void updateCalendar(Calendar calendar) throws org.exoplatform.commons.exception.ObjectNotFoundException Updates an existing calendar- Parameters:
calendar-Calendarobject to update- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the calendar identified by its technical identifier is not found
-
deleteCalendarById
void deleteCalendarById(long calendarId, String username) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException Deletes an existing calendar- Parameters:
calendarId- Calendar technical identifier to deleteusername- User name deleting calendar- Throws:
IllegalAccessException- when user is not authorized to delete the calendarorg.exoplatform.commons.exception.ObjectNotFoundException- when the calendar identified by its technical identifier is not found
-
deleteCalendarById
void deleteCalendarById(long calendarId) throws org.exoplatform.commons.exception.ObjectNotFoundException Deletes an existing calendar- Parameters:
calendarId- Calendar technical identifier to delete- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the calendar identified by its technical identifier is not found
-