public interface EventAdminSession extends OsidSession
This session creates, updates, and deletes Events.
The
data for create and update is provided by the consumer via the form
object. OsidForms
are requested for each create or update
and may not be reused.
Create and update operations differ in their usage. To create an
Event,
an EventForm
is requested using
getEventFormForCreate()
specifying the desired and record
Types
or none if no record Types
are needed.
The returned EventForm
will indicate that it is to be used
with a create operation and can be used to examine metdata or validate
data prior to creation. Once the EventForm
is submiited to
a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each EventForm
corresponds to an attempted transaction.
For updates, EventForms
are requested to the
Event
Id
that is to be updated using
getEventFormForUpdate().
Similarly, the EventForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The EventForm
can
only be used once for a successful update and cannot be reused.
The delete operations delete Events.
To unmap an
Event
from the current Calendar,
the
EventCalendarAssignmentSession
should be used. These delete
operations attempt to remove the Event
itself thus removing
it from all known Calendar
catalogs.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasEvent(Id eventId,
Id aliasId)
Adds an
Id to an Event for the purpose
of creating compatibility. |
boolean |
canCreateEvents()
Tests if this user can create
Events. |
boolean |
canCreateEventWithRecordTypes(Type[] eventRecordTypes)
Tests if this user can create a single
Event using the
desired record types. |
boolean |
canDeleteEvents()
Tests if this user can delete
Events. |
boolean |
canManageEventAliases()
Tests if this user can manage
Id aliases for
Events. |
boolean |
canUpdateEvents()
Tests if this user can update
Events. |
Event |
createEvent(EventForm eventForm)
Creates a new
Event. |
void |
deleteEvent(Id eventId)
Deletes the
Event identified by the given Id. |
Calendar |
getCalendar()
Gets the
Calendar associated with this session. |
Id |
getCalendarId()
Gets the
Calendar Id associated with
this session. |
EventForm |
getEventFormForCreate(Type[] eventRecordTypes)
Gets the event form for creating new events.
|
EventForm |
getEventFormForUpdate(Id eventId)
Gets the event form for updating an existing event.
|
void |
updateEvent(EventForm eventForm)
Updates an existing event.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getCalendarId()
Calendar
Id
associated with
this session. Calendar Id
associated with this sessionmandatory
- This method must be implemented. Calendar getCalendar() throws OperationFailedException, PermissionDeniedException
Calendar
associated with this session. Calendar
associated with this sessionOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateEvents()
Events.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating an Event
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer create operations to
an unauthorized user. false
if Event
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateEventWithRecordTypes(Type[] eventRecordTypes)
Event
using the
desired record types. While
CalendaringManager.getEventRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Event.
Providing
an empty array tests if an Event
can be created with no
records.eventRecordTypes
- array of event record types true
if Event
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- eventRecordTypes
is null
mandatory
- This method must be implemented. EventForm getEventFormForCreate(Type[] eventRecordTypes) throws OperationFailedException, PermissionDeniedException
eventRecordTypes
- array of event record typesNullArgumentException
- eventRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Event createEvent(EventForm eventForm) throws OperationFailedException, PermissionDeniedException
Event.
eventForm
- the form for this Event
Event
IllegalStateException
- eventForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- eventForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- eventForm
did not
originate from getEventFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateEvents()
Events.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating an Event
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer update operations to
an unauthorized user. false
if event modification is not authorized,
true
otherwisemandatory
- This method must be implemented. EventForm getEventFormForUpdate(Id eventId) throws NotFoundException, OperationFailedException, PermissionDeniedException
eventId
- the Id
of the Event
NotFoundException
- eventId
is not foundNullArgumentException
- eventId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateEvent(EventForm eventForm) throws OperationFailedException, PermissionDeniedException
eventForm
- the form containing the elements to be updatedIllegalStateException
- eventForm
already used in an update transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- eventForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- eventForm
did not
originate from getEventFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteEvents()
Events.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting an Event
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer delete operations to
an unauthorized user. false
if Event
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteEvent(Id eventId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Event
identified by the given Id.
eventId
- the Id
of the Event
to
deleteNotFoundException
- an Event
was not
found identified by the given Id
NullArgumentException
- eventId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageEventAliases()
Id
aliases for
Events.
A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED.
This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false
if Event
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasEvent(Id eventId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to an Event
for the purpose
of creating compatibility. The primary Id
of the
Event
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the alias is
a pointer to another event, it is reassigned to the given event
Id.
eventId
- the Id
of an Event
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- eventId
not foundNullArgumentException
- eventId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.