Interface AgendaCalendarShareService
The rules, all held here. Only the owner of a personal calendar that is not a subscription shares it; a sharee may read the calendar and its events and nothing else, a private event as busy time only; a sharee may hide the calendar from their agenda without the share being deleted. Space calendars are not shareable in this version, nor is a share with a space or a group.
The status contract of every method taking a user: the calendar must
exist (ObjectNotFoundException), the user must be its owner
(IllegalAccessException), then the arguments are validated
(IllegalArgumentException with a message code).
Delivery channels (CalendarShareChannelPlugin) are asked after
the record is written and never decide whether it exists.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringBroadcast once the owner changes what a colleague may do with a shared calendar (EXO-90378); source theCalendarShareas it now stands, data the owner identity id.static final StringBroadcast once a share is recorded; source theCalendarShare, data the owner identity id.static final StringBroadcast once a share is deleted by its owner; source theCalendarShare, data the owner identity id.static final StringMessage code: the calendar identifier is not positive.static final StringMessage code: no access level was given for a share (EXO-90378).static final StringMessage code: the channel carrying a share did not narrow its grant to the lower level asked for, so the level is unchanged (EXO-90378).static final StringMessage code: no channel carries this share, so nothing can be removed there.static final StringMessage code: the sharee has no record on this calendar.static final StringMessage code: the channel could not remove a share held on its server.static final StringMessage code: the sharee's account is disabled or deleted.static final StringMessage code: the sharee is the owner.static final StringMessage code: the sharee is not a known user. -
Method Summary
Modifier and TypeMethodDescriptionvoidclearDelivery(long ownerIdentityId, String channelId) Forgets that a channel carries the shares of a user's calendars, once the user disconnected from that channel: the eXo shares stay, the channel's grants are left as the channel's truth.countShareesByCalendar(String ownerUsername) How many colleagues each of the user's own calendars is shared with, from one query; a calendar shared with nobody is absent.voiddeleteShares(long calendarId) Deletes every share of a calendar, once the calendar is deleted.voiddeleteSharesOfUser(long identityId) Deletes every share a deleted user held, as sharee and as owner of the shared calendars.getChannelShares(long calendarId, String ownerUsername) What every channel has to say about a calendar in one pass (EXO-90385): the access held outside eXo, asgetExternalShares(long, java.lang.String)answers it, and whether a channel writes the owner's eXo meeting copies into it, asholdsMeetingCopies(long, java.lang.String)answers it.getExternalShares(long calendarId, String ownerUsername) The access a calendar's channels hold outside eXo, read live from every channel.getSharedCalendarIds(long viewerIdentityId) The identifiers of every calendar shared with an identity.getSharedWithMe(String username) The calendars shared with a user, newest share first, hidden ones included (they say so).getShareLevel(long calendarId, long viewerIdentityId) The level a calendar is shared with an identity at (EXO-90378): the write primitive, read from the same cached map asisSharedWith(long, long).getShareLevels(long viewerIdentityId) Every calendar shared with an identity and the level of each (EXO-90378): what a listing asks once, instead of asking per event.The colleagues a calendar is shared with, oldest share first.booleanholdsMeetingCopies(long calendarId, String ownerUsername) Whether a channel writes copies of the owner's eXo meetings into the calendar: what the drawer asks a confirmation for before sharing it (EXO-90345), since a share then exposes every meeting the owner attends.booleanisSharedWith(long calendarId, long viewerIdentityId) Whether a calendar is shared with an identity: the read primitive every ACL path relies on.voidremoveExternalShare(long calendarId, String channelId, String externalId, String ownerUsername) Removes a share on a channel's server, at the owner's request.voidHides, or shows again, a calendar shared with the user.setLevel(long calendarId, long shareeIdentityId, CalendarShareLevel level, String ownerUsername) Changes what a colleague may do with a calendar shared with them (EXO-90378), then asks the delivery channels to make their grant match the new level.share(long calendarId, String shareeUsername, CalendarShareLevel level, String ownerUsername) Shares a calendar with a colleague, then asks every delivery channel to carry it.voidWithdraws a share from the channel that carries it, then deletes the record.
-
Field Details
-
SHAREE_UNKNOWN
Message code: the sharee is not a known user.- See Also:
-
SHAREE_IS_OWNER
Message code: the sharee is the owner.- See Also:
-
SHAREE_DISABLED
Message code: the sharee's account is disabled or deleted.- See Also:
-
INVALID_CALENDAR
Message code: the calendar identifier is not positive.- See Also:
-
NO_CHANNEL
Message code: no channel carries this share, so nothing can be removed there.- See Also:
-
SHARE_NOT_REMOVED
Message code: the channel could not remove a share held on its server.- See Also:
-
SHARE_NOT_FOUND
Message code: the sharee has no record on this calendar.- See Also:
-
LEVEL_MANDATORY
Message code: no access level was given for a share (EXO-90378).- See Also:
-
LEVEL_NOT_NARROWED
Message code: the channel carrying a share did not narrow its grant to the lower level asked for, so the level is unchanged (EXO-90378).- See Also:
-
CALENDAR_SHARED_EVENT
Broadcast once a share is recorded; source theCalendarShare, data the owner identity id.- See Also:
-
CALENDAR_UNSHARED_EVENT
Broadcast once a share is deleted by its owner; source theCalendarShare, data the owner identity id.- See Also:
-
CALENDAR_SHARE_LEVEL_CHANGED_EVENT
Broadcast once the owner changes what a colleague may do with a shared calendar (EXO-90378); source theCalendarShareas it now stands, data the owner identity id.- See Also:
-
-
Method Details
-
holdsMeetingCopies
boolean holdsMeetingCopies(long calendarId, String ownerUsername) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Whether a channel writes copies of the owner's eXo meetings into the calendar: what the drawer asks a confirmation for before sharing it (EXO-90345), since a share then exposes every meeting the owner attends.The Share drawer reads
getChannelShares(long, java.lang.String); this method stays for a caller that needs the flag alone.- Parameters:
calendarId- technical identifier of the calendarownerUsername- the owner- Returns:
- true when any channel says so
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the calendar does not existIllegalAccessException- when the user does not own it
-
setHidden
void setHidden(long calendarId, String username, boolean hidden) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException Hides, or shows again, a calendar shared with the user. Never deletes the share.- Parameters:
calendarId- technical identifier of the calendarusername- the shareehidden- whether to hide it- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- when the calendar is not shared with the userIllegalAccessException- when the user has no usable identity
-
clearDelivery
Forgets that a channel carries the shares of a user's calendars, once the user disconnected from that channel: the eXo shares stay, the channel's grants are left as the channel's truth.- Parameters:
ownerIdentityId- identity identifier of the ownerchannelId- the channel the owner left