public interface ActivityBundleAdminSession extends OsidSession
This session creates, updates, and deletes ActivityBundles.
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
ActivityBundle,
an ActivityBundleForm
is
requested using getActivityBundleFormForCreate()
specifying
the desired record Types
or none if no record Types
are needed. The returned ActivityBundleForm
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
ActivityBundleForm
is submiited to a create operation, it cannot
be reused with another create operation unless the first operation was
unsuccessful. Each ActivityBundleForm
corresponds to an
attempted transaction.
For updates, ActivityBundleForms
are requested to the
ActivityBundle
Id
that is to be updated
using getActivityBundleFormForUpdate().
Similarly, the
ActivityBundleForm
has metadata about the data that can be
updated and it can perform validation before submitting the update. The
ActivityBundleForm
can only be used once for a successful
update and cannot be reused.
The delete operations delete ActivityBundles.
To unmap
an ActivityBundle
from the current CourseCatalog,
the ActivityBundleCourseCatalogAssignmentSession
should be used. These delete operations attempt to remove the
ActivityBundle
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 |
aliasActivityBundle(Id activityBundleId,
Id aliasId)
Adds an
Id to an ActivityBundle for the
purpose of creating compatibility. |
boolean |
canCreateActivityBundles()
Tests if this user can create
ActivityBundles. |
boolean |
canCreateActivityBundlesForCourseOffering(Id courseOfferingId)
Tests if this user can create a single
ActivityBundle
for a course offering. |
boolean |
canCreateActivityBundleWithRecordTypes(Type[] activityBundleRecordTypes)
Tests if this user can create a single
ActivityBundle
using the desired record types. |
boolean |
canDeleteActivityBundles()
Tests if this user can delete
ActivityBundles. |
boolean |
canManageActivityBundleAliases()
Tests if this user can manage
Id aliases for
ActivityBundles. |
boolean |
canUpdateActivityBundles()
Tests if this user can update
ActivityBundles. |
ActivityBundle |
createActivityBundle(ActivityBundleForm activityBundleForm)
Creates a new
ActivityBundle. |
void |
deleteActivityBundle(Id activityBundleId)
Deletes an
ActivityBundle. |
ActivityBundleForm |
getActivityBundleFormForCreate(Id courseOfferingId,
Type[] activityBundleRecordTypes)
Gets the course form for creating new activity bundles.
|
ActivityBundleForm |
getActivityBundleFormForUpdate(Id activityBundleId)
Gets the activity bundle form for updating an existing activity
bundle.
|
CourseCatalog |
getCourseCatalog()
Gets the
CourseCatalog associated with this session. |
Id |
getCourseCatalogId()
Gets the
CourseCatalog Id associated
with this session. |
void |
updateActivityBundle(ActivityBundleForm activityBundleForm)
Updates an existing activity bundle.
|
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 canCreateActivityBundles()
ActivityBundles.
A return
of true does not guarantee successful authorization. A return of false
indicates that it is known creating an ActivityBundle
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 ActivityBundle
creation
is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateActivityBundleWithRecordTypes(Type[] activityBundleRecordTypes)
ActivityBundle
using the desired record types. While
CourseRegistrationManager.getActivityBundleRecordTypes()
can
be used to examine which records are supported, this method tests
which record(s) are required for creating a specific
ActivityBundle.
Providing an empty array tests if an
ActivityBundle
can be created with no records.activityBundleRecordTypes
- array of types true
if ActivityBundle
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
-
activityBundleRecordTypes
is null
mandatory
- This method must be implemented. boolean canCreateActivityBundlesForCourseOffering(Id courseOfferingId)
ActivityBundle
for a course offering.courseOfferingId
- a course offering Id
true
if ActivityBundle
creation
for the specified CourseOffering
is supported,
false
otherwiseNullArgumentException
- courseOfferingId
is null
mandatory
- This method must be implemented. ActivityBundleForm getActivityBundleFormForCreate(Id courseOfferingId, Type[] activityBundleRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
courseOfferingId
- a course offering Id
activityBundleRecordTypes
- array of typesNotFoundException
- courseOfferingId
is
not foundNullArgumentException
- courseOfferingId
or activityBundleRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. ActivityBundle createActivityBundle(ActivityBundleForm activityBundleForm) throws OperationFailedException, PermissionDeniedException
ActivityBundle.
activityBundleForm
- the form for this ActivityBundle
ActivityBundle
IllegalStateException
- activityBundleForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- activityBundleForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- activityBundleForm
did not originate from
getActivityBundleFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateActivityBundles()
ActivityBundles.
A return
of true does not guarantee successful authorization. A return of false
indicates that it is known updating an ActivityBundle
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 ActivityBundle
modification is not authorized, true
otherwisemandatory
- This method must be implemented. ActivityBundleForm getActivityBundleFormForUpdate(Id activityBundleId) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityBundleId
- the Id
of the
ActivityBundle
NotFoundException
- activityBundleId
is
not foundNullArgumentException
- activityBundleId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateActivityBundle(ActivityBundleForm activityBundleForm) throws OperationFailedException, PermissionDeniedException
activityBundleForm
- the form containing the elements to be
updatedIllegalStateException
- activityBundleForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- activityBundleForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- activityBundleForm did
not originate from getActivityBundleFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteActivityBundles()
ActivityBundles.
A return
of true does not guarantee successful authorization. A return of false
indicates that it is known deleting an ActivityBundle
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 ActivityBundle
deletion
is not authorized, true
otherwisemandatory
- This method must be implemented. void deleteActivityBundle(Id activityBundleId) throws NotFoundException, OperationFailedException, PermissionDeniedException
ActivityBundle.
activityBundleId
- the Id
of the
ActivityBundle
to removeNotFoundException
- activityBundleId
not
foundNullArgumentException
- activityBundleId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageActivityBundleAliases()
Id
aliases for
ActivityBundles.
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 ActivityBundle
aliasing
is not authorized, true
otherwisemandatory
- This method must be implemented. void aliasActivityBundle(Id activityBundleId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to an ActivityBundle
for the
purpose of creating compatibility. The primary Id
of
the Course
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 bundle, it is
reassigned to the given activity bundle Id.
activityBundleId
- the Id
of an
ActivityBundle
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is in
use as a primary Id
NotFoundException
- activityBundleId
not
foundNullArgumentException
- activityBundleId
or aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.