Interface EventCalendarAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Events to
Calendars . An Event may map to multiple Calendars and
removing the last reference to an Event is the equivalent of
deleting it. Each Calendar may have its own authorizations
governing who is allowed to operate on it.
Moving or adding a reference of an Event to another
Calendar is not a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignEventToCalendar(Id eventId, Id calendarId) Adds an existingEventto aCalendar.booleanTests if this user can alter event/calendar mappings.booleancanAssignEventsToCalendar(Id calendarId) Tests if this user can alter event/calendar mappings.getAssignableCalendarIds(Id calendarId) Gets a list of calendars including and under the given calendar node in which any event can be assigned.getAssignableCalendarIdsForEvent(Id calendarId, Id eventId) Gets a list of calendars including and under the given calendar node in which a specific event can be assigned.voidreassignEventToCalendar(Id eventId, Id fromCalendarId, Id toCalendarId) Moves anEventfrom oneCalendarto another.voidunassignEventFromCalendar(Id eventId, Id calendarId) Removes anEventfrom aCalendar.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
canAssignEvents
boolean canAssignEvents()Tests if this user can alter event/calendar mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignEventsToCalendar
Tests if this user can alter event/calendar mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Parameters:
calendarId- theIdof theCalendar- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-calendarIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableCalendarIds
Gets a list of calendars including and under the given calendar node in which any event can be assigned.- Parameters:
calendarId- theIdof theCalendar- Returns:
- list of assignable calendar
Ids - Throws:
NullArgumentException-calendarIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableCalendarIdsForEvent
Gets a list of calendars including and under the given calendar node in which a specific event can be assigned.- Parameters:
calendarId- theIdof theCalendareventId- theIdof theEvent- Returns:
- list of assignable calendar
Ids - Throws:
NullArgumentException-calendarIdoreventIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignEventToCalendar
void assignEventToCalendar(Id eventId, Id calendarId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingEventto aCalendar.- Parameters:
eventId- theIdof theEventcalendarId- theIdof theCalendar- Throws:
AlreadyExistsException-eventIdis already assigned tocalendarIdNotFoundException-eventIdorcalendarIdnot foundNullArgumentException-eventIdorcalendarIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignEventFromCalendar
void unassignEventFromCalendar(Id eventId, Id calendarId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes anEventfrom aCalendar.- Parameters:
eventId- theIdof theEventcalendarId- theIdof theCalendar- Throws:
NotFoundException-eventId or calendarId not found or eventId not assigned to calendarIdNullArgumentException-eventIdorcalendarIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignEventToCalendar
void reassignEventToCalendar(Id eventId, Id fromCalendarId, Id toCalendarId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves anEventfrom oneCalendarto another. Mappings to otherCalendarsare unaffected.- Parameters:
eventId- theIdof theEventfromCalendarId- theIdof the currentCalendartoCalendarId- theIdof the destinationCalendar- Throws:
AlreadyExistsException-eventIdalready assigned totoCalendarIdNotFoundException-eventId, fromCalendarId, ortoCalendarIdnot found oreventIdnot mapped tofromCalendarIdNullArgumentException-eventId, fromCalendarId, ortoCalendarIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-