public interface ActivityAdminSession extends OsidSession
This session creates, updates, and deletes Activities.
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
Activity,
an ActivityForm
is requested using
getActivityFormForCreate()
specifying the desired activity
unit, course offering, term, and record Types
or none if no
record Types
are needed. The returned ActivityForm
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 ActivityForm
is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each ActivityForm
corresponds to an
attempted transaction.
For updates, ActivityForms
are requested to the
Activity
Id
that is to be updated using
getActivityFormForUpdate().
Similarly, the ActivityForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The ActivityForm
can only be used once for a successful update and cannot be reused.
The delete operations delete ActivityForms.
To unmap an
Activity
from the current CourseCatalog,
the
ActivityCourseCatalogAssignmentSession
should be used.
These delete operations attempt to remove the ActivityForm
itself thus removing it from all known CourseCatalog
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 |
addBlackout(Id activityId,
DateTime from,
DateTime to)
Adds a blackout to the given activity that blocks events in the
series.
|
void |
addMeetingTime(Id activityId,
DateTime time,
Id locationId)
Adds a specific meeting time to the given activity.
|
void |
addSchedule(Id activityId,
Id scheduleId)
Adds a schedule to the activity.
|
void |
aliasActivity(Id activityId,
Id aliasId)
Adds an
Id to an Activity for the
purpose of creating compatibility. |
boolean |
canCreateActivities()
Tests if this user can create
Activities. |
boolean |
canCreateActivityWithRecordTypes(Type[] activityRecordTypes)
Tests if this user can create a single
Activity using
the desired record types. |
boolean |
canDeleteActivities()
Tests if this user can delete
Activities. |
boolean |
canManageActivityAliases()
Tests if this user can manage
Id aliases for
Activities. |
boolean |
canScheduleActivities()
Tests if this user can schedule actviities.
|
boolean |
canUpdateActivities()
Tests if this user can update
Activities. |
void |
clearBlackout(Id activityId,
DateTime from,
DateTime to)
Clears any blackouts between the given dates inclusive.
|
void |
clearMeetingTimes(Id activityId,
DateTime from,
DateTime to)
Clears any specific meeting times between the given dates inclusive.
|
Activity |
createActivity(ActivityForm activityForm)
Creates a new
Activity. |
void |
deleteActivity(Id activityId)
Deletes an
Activity. |
ActivityForm |
getActivityFormForCreate(Id activityUnitId,
Id courseOfferingId,
Id termId,
Type[] activityRecordTypes)
Gets the activity form for creating new activities.
|
ActivityForm |
getActivityFormForUpdate(Id activityId)
Gets the activity form for updating an existing activity.
|
CourseCatalog |
getCourseCatalog()
Gets the
CourseCatalog associated with this session. |
Id |
getCourseCatalogId()
Gets the
CourseCatalog Id associated
with this session. |
void |
removeSchedule(Id activityId,
Id scheduleId)
Removes a schedule from a given activity.
|
void |
updateActivity(ActivityForm activityForm)
Updates an existing activity.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getCourseCatalogId()
CourseCatalog
Id
associated
with this session. CourseCatalog Id
associated with this
sessionmandatory
- This method must be implemented. CourseCatalog getCourseCatalog() throws OperationFailedException, PermissionDeniedException
CourseCatalog
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateActivities()
Activities.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating an Activity
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 Activity
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateActivityWithRecordTypes(Type[] activityRecordTypes)
Activity
using
the desired record types. While
CourseManager.getActivityRecordTypes()
can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Activity.
Providing an
empty array tests if an Activity
can be created with no
records.activityRecordTypes
- array of activity record types true
if Activity
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- activityRecordTypes
is null
mandatory
- This method must be implemented. ActivityForm getActivityFormForCreate(Id activityUnitId, Id courseOfferingId, Id termId, Type[] activityRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityUnitId
- an activity unit Id
courseOfferingId
- a course offering Id
termId
- a term Id
activityRecordTypes
- array of activity record typesNotFoundException
- activityUnitId,
courseOfferingId,
or termId
is not
foundNullArgumentException
- activityUnitId,
courseOfferingId, termId
, or
activityRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Activity createActivity(ActivityForm activityForm) throws OperationFailedException, PermissionDeniedException
Activity.
activityForm
- the form for this Activity
Activity
IllegalStateException
- activityForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- activityForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- activityForm
did
not originate from getActivityFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateActivities()
Activities.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating an Activity
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 Activity
modification
is not authorized, true
otherwisemandatory
- This method must be implemented. ActivityForm getActivityFormForUpdate(Id activityId) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityId
- the Id
of the Activity
NotFoundException
- activityId
is not
foundNullArgumentException
- activityId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateActivity(ActivityForm activityForm) throws OperationFailedException, PermissionDeniedException
activityForm
- the form containing the elements to be updatedIllegalStateException
- activityForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- activityForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- activityForm
did
not originate from getActivityFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteActivities()
Activities.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting an Activity
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 Activity
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteActivity(Id activityId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Activity.
activityId
- the Id
of the Activity
to removeNotFoundException
- activityId
not foundNullArgumentException
- activityId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageActivityAliases()
Id
aliases for
Activities.
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 Activity
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasActivity(Id activityId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to an Activity
for the
purpose of creating compatibility. The primary Id
of
the Activity
is deactivityined by the provider. The new
Id
performs as an alias to the primary Id
. If the alias is a pointer to another activity, it is
reassigned to the given activity Id.
activityId
- the Id
of an Activity
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is in
use as a primary Id
NotFoundException
- activityId
not foundNullArgumentException
- activityId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canScheduleActivities()
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 activity scheduling is not authorized,
true
otherwisemandatory
- This method must be implemented. void addSchedule(Id activityId, Id scheduleId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
activityId
- an activity Id
scheduleId
- a schedule Id
AlreadyExistsException
- schedule is already part of
activityNotFoundException
- activityId
or
scheduleId
is not foundNullArgumentException
- activityId
or
scheduleId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void removeSchedule(Id activityId, Id scheduleId) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityId
- an activity Id
scheduleId
- the schedule Id
NotFoundException
- schedule not part of activityNullArgumentException
- activityId
or
scheduleId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void addMeetingTime(Id activityId, DateTime time, Id locationId) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityId
- an activity Id
time
- a timelocationId
- a location Id
NotFoundException
- activityId
or
locationId
is not foundNullArgumentException
- activityId, time, or
locationId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void clearMeetingTimes(Id activityId, DateTime from, DateTime to) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityId
- an activity Id
from
- start date inclusiveto
- end date inclusiveInvalidArgumentException
- from
is
greater than to
NotFoundException
- activityId
is not
foundNullArgumentException
- activityId, from
or to
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void addBlackout(Id activityId, DateTime from, DateTime to) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityId
- an activity Id
from
- start date inclusiveto
- end date inclusiveInvalidArgumentException
- from
is
greater than to
NotFoundException
- activityId
is not
foundNullArgumentException
- activityId, from
or to
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void clearBlackout(Id activityId, DateTime from, DateTime to) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityId
- an activity Id
from
- start date inclusiveto
- end date inclusiveInvalidArgumentException
- from
is
greater than to
NotFoundException
- activityId
is not
foundNullArgumentException
- activityId, from
or to
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.