Package org.exoplatform.agenda.service
Interface AgendaCalendarLinkService
public interface AgendaCalendarLinkService
Publishes a calendar as a private, read-only iCal link that any calendar
application can subscribe to.
Who manages a link: the owner of a personal calendar; any manager of the space for a space calendar. Who reads it: whoever holds the URL, without an eXo session — which is why the link answers only while its creator still holds the right that let them create it, evaluated on every read.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteCalendarLink(long calendarId, String username) Deletes the link of a calendar.voiddeleteCalendarLinks(long calendarId) Deletes the link of a calendar with no permission check, for the platform's own clean-up once the calendar itself is gone.getCalendarFeed(String token) Renders the calendar a token publishes, as an iCalendar document.getCalendarLink(long calendarId, String username) Reads the link of a calendar for someone allowed to manage it.getCalendarLinks(String username) Lists the links of every calendar the user may manage a link for — their own calendars and the calendars of the spaces they manage — that have one, working or stopped, each read asgetCalendarLink(long, java.lang.String)reads it.longgetFeedCalendarId(String token) The calendar a token publishes, decided exactly asgetCalendarFeed(java.lang.String)decides whether to answer: a token that opens nothing there opens nothing here.saveCalendarLink(long calendarId, String username) Creates the link of a calendar, replacing any link it already has: the previous URL stops answering at once.
-
Method Details
-
getCalendarLink
CalendarLink getCalendarLink(long calendarId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Reads the link of a calendar for someone allowed to manage it. The token comes with it — so the URL can be shown again — while the link still answers and its stored copy can be decrypted; the digest and the encrypted copy never do.- Parameters:
calendarId- technical identifier of the calendarusername- user asking, who must be allowed to manage the link- Returns:
- the link, with
activeandtokencomputed now, or null when the calendar has none - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the calendar does not existIllegalAccessException- when the user may not manage its link
-
getCalendarLinks
Lists the links of every calendar the user may manage a link for — their own calendars and the calendars of the spaces they manage — that have one, working or stopped, each read asgetCalendarLink(long, java.lang.String)reads it.- Parameters:
username- user asking- Returns:
- the links, newest first; bounded
- Throws:
IllegalAccessException- when the user has no usable identity
-
saveCalendarLink
String saveCalendarLink(long calendarId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Creates the link of a calendar, replacing any link it already has: the previous URL stops answering at once.- Parameters:
calendarId- technical identifier of the calendarusername- user asking, who becomes the link's creator- Returns:
- the token of the new link
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the calendar does not existIllegalAccessException- when the user may not manage its link
-
deleteCalendarLink
void deleteCalendarLink(long calendarId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Deletes the link of a calendar. Deleting a link that does not exist is not an error.- Parameters:
calendarId- technical identifier of the calendarusername- user asking, who must be allowed to manage the link- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the calendar does not existIllegalAccessException- when the user may not manage its link
-
deleteCalendarLinks
void deleteCalendarLinks(long calendarId) Deletes the link of a calendar with no permission check, for the platform's own clean-up once the calendar itself is gone.- Parameters:
calendarId- technical identifier of the calendar
-
getCalendarFeed
String getCalendarFeed(String token) throws org.exoplatform.commons.exception.ObjectNotFoundException Renders the calendar a token publishes, as an iCalendar document.An unknown token, a token replaced by a reset, a deleted link and a link whose creator lost their right all answer the same way, so that holding a URL tells nothing about why it stopped working.
- Parameters:
token- the token presented in the URL- Returns:
- the iCalendar document
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the token opens nothing
-
getFeedCalendarId
long getFeedCalendarId(String token) throws org.exoplatform.commons.exception.ObjectNotFoundException The calendar a token publishes, decided exactly asgetCalendarFeed(java.lang.String)decides whether to answer: a token that opens nothing there opens nothing here. Used when a user subscribes to a link of this very eXo (EXO-90278), to recognise a calendar they can already see.- Parameters:
token- the token presented in the URL- Returns:
- technical identifier of the published calendar
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the token opens nothing
-