public interface CourseEntryAdminSession extends OsidSession
This session creates, updates, and deletes CourseEntries.
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 a
CourseEntry, a CourseEntryForm is requested using
getCourseEntryFormForCreate() specifying the desired record
Types or none if no record Types are needed.
The returned CourseEntryForm 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 CourseEntryForm
is submiited to a create operation, it cannot be reused with another
create operation unless the first operation was unsuccessful. Each
CourseEntryForm corresponds to an attempted transaction.
For updates, CourseEntryForms are requested to the
CourseEntry Id that is to be updated using
getCourseEntryFormForUpdate(). Similarly, the
CourseEntryForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
CourseEntryForm can only be used once for a successful update and
cannot be reused.
The delete operations delete CourseEntries. To unmap a
CourseEntry from the current CourseCatalog,
the CourseEntryCourseCatalogAssignmentSession should be
used. These delete operations attempt to remove the CourseEntry
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 |
aliasCourseEntry(Id courseEntryId,
Id aliasId)
Adds an
Id to a CourseEntry for the
purpose of creating compatibility. |
boolean |
canCreateCourseEntries()
Tests if this user can create
CourseEntries. |
boolean |
canCreateCourseEntryWithRecordTypes(Type[] courseEntryRecordTypes)
Tests if this user can create a single
Porgram using
the desired record types. |
boolean |
canDeleteCourseEntries()
Tests if this user can delete
CourseEntries. |
boolean |
canManageCourseEntryAliases()
Tests if this user can manage
Id aliases for
CourseEntries. |
boolean |
canUpdateCourseEntries()
Tests if this user can update
CourseEntries. |
CourseEntry |
createCourseEntry(CourseEntryForm courseEntryForm)
Creates a new
CourseEntry. |
void |
deleteCourseEntry(Id courseEntryId)
Deletes a
CourseEntry. |
CourseCatalog |
getCourseCatalog()
Gets the
CourseCatalog associated with this session. |
Id |
getCourseCatalogId()
Gets the
CourseCatalog Id associated
with this session. |
CourseEntryForm |
getCourseEntryFormForCreate(Id courseId,
Id resourceId,
Type[] courseEntryRecordTypes)
Gets the course entry form for creating new course entries.
|
CourseEntryForm |
getCourseEntryFormForUpdate(Id courseEntryId)
Gets the course entry form for updating an existing course entry.
|
void |
updateCourseEntry(CourseEntryForm courseEntryForm)
Updates an existing course entry.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId 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 canCreateCourseEntries()
CourseEntries. A return
of true does not guarantee successful authorization. A return of false
indicates that it is known creating a CourseEntry 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 CourseEntry creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateCourseEntryWithRecordTypes(Type[] courseEntryRecordTypes)
Porgram using
the desired record types. While
CourseChronicleManager.getCourseEntryRecordTypes() can be used
to examine which records are supported, this method tests which
record(s) are required for creating a specific CourseEntry.
Providing an empty array tests if a CourseEntry
can be created with no records.courseEntryRecordTypes - array of course entry record types true if CourseEntry creation
using the specified record Types is supported,
false otherwiseNullArgumentException - courseEntryRecordTypes
is null mandatory - This method must be implemented. CourseEntryForm getCourseEntryFormForCreate(Id courseId, Id resourceId, Type[] courseEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
courseId - a course Id resourceId - a program Id courseEntryRecordTypes - array of course entry record typesNotFoundException - courseId or
resourceId is not foundNullArgumentException - courseId, resourceId
, or courseEntryRecordTypes is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. CourseEntry createCourseEntry(CourseEntryForm courseEntryForm) throws OperationFailedException, PermissionDeniedException
CourseEntry. courseEntryForm - the form for this CourseEntry CourseEntry IllegalStateException - courseEntryForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - courseEntryForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - courseEntryForm
did not originate from getCourseEntryFormForCreate()
mandatory - This method must be implemented. boolean canUpdateCourseEntries()
CourseEntries. A return
of true does not guarantee successful authorization. A return of false
indicates that it is known updating a CourseEntry 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 CourseEntry
modification is not authorized, true otherwisemandatory - This method must be implemented. CourseEntryForm getCourseEntryFormForUpdate(Id courseEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
courseEntryId - the Id of the CourseEntry
NotFoundException - courseEntryId is not
foundNullArgumentException - courseEntryId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateCourseEntry(CourseEntryForm courseEntryForm) throws OperationFailedException, PermissionDeniedException
courseEntryForm - the form containing the elements to be updatedIllegalStateException - courseEntryForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - courseEntryForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - courseEntryForm did not
originate from getCourseEntryFormForUpdate() mandatory - This method must be implemented. boolean canDeleteCourseEntries()
CourseEntries. A return
of true does not guarantee successful authorization. A return of false
indicates that it is known deleting a CourseEntry 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 CourseEntry deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteCourseEntry(Id courseEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
CourseEntry. courseEntryId - the Id of the CourseEntry
to removeNotFoundException - courseEntryId not
foundNullArgumentException - courseEntryId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageCourseEntryAliases()
Id aliases for
CourseEntries. 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 CourseEntry aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasCourseEntry(Id courseEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a CourseEntry for the
purpose of creating compatibility. The primary Id of
the CourseEntry is determined by the provider. The new
Id performs as an alias to the primary Id.
If the alias is a pointer to another course entry, it is
reassigned to the given course entry Id. courseEntryId - the Id of a CourseEntry
aliasId - the alias Id AlreadyExistsException - aliasId is in
use as a primary Id NotFoundException - courseEntryId not
foundNullArgumentException - courseEntryId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.