Interface CourseEntryAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
CourseEntryBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasCourseEntry(Id courseEntryId, Id aliasId) Adds anIdto aCourseEntryfor the purpose of creating compatibility.booleanTests if this user can createCourseEntries.booleancanCreateCourseEntryWithRecordTypes(Type[] courseEntryRecordTypes) Tests if this user can create a singlePorgramusing the desired record types.booleanTests if this user can deleteCourseEntries.booleanTests if this user can manageIdaliases forCourseEntries.booleanTests if this user can updateCourseEntries.createCourseEntry(CourseEntryForm courseEntryForm) Creates a newCourseEntry.voiddeleteCourseEntry(Id courseEntryId) Deletes aCourseEntry.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getCourseEntryFormForCreate(Id courseId, Id resourceId, Type[] courseEntryRecordTypes) Gets the course entry form for creating new course entries.getCourseEntryFormForUpdate(Id courseEntryId) Gets the course entry form for updating an existing course entry.voidupdateCourseEntry(CourseEntryForm courseEntryForm) Updates an existing course entry.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
-
getCourseCatalogId
Id getCourseCatalogId()Gets theCourseCatalogIdassociated with this session.- Returns:
- the
CourseCatalog Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getCourseCatalog
Gets theCourseCatalogassociated with this session.- Returns:
- the course catalog
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateCourseEntries
boolean canCreateCourseEntries()Tests if this user can createCourseEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aCourseEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifCourseEntrycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateCourseEntryWithRecordTypes
Tests if this user can create a singlePorgramusing the desired record types. WhileCourseChronicleManager.getCourseEntryRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificCourseEntry. Providing an empty array tests if aCourseEntrycan be created with no records.- Parameters:
courseEntryRecordTypes- array of course entry record types- Returns:
trueifCourseEntrycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-courseEntryRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getCourseEntryFormForCreate
CourseEntryForm getCourseEntryFormForCreate(Id courseId, Id resourceId, Type[] courseEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the course entry form for creating new course entries. A new form should be requested for each create transaction.- Parameters:
courseId- a courseIdresourceId- a programIdcourseEntryRecordTypes- array of course entry record types- Returns:
- the course entry form
- Throws:
NotFoundException-courseIdorresourceIdis not foundNullArgumentException-courseId, resourceId, orcourseEntryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createCourseEntry
CourseEntry createCourseEntry(CourseEntryForm courseEntryForm) throws OperationFailedException, PermissionDeniedException Creates a newCourseEntry.- Parameters:
courseEntryForm- the form for thisCourseEntry- Returns:
- the new
CourseEntry - Throws:
IllegalStateException-courseEntryFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-courseEntryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-courseEntryFormdid not originate fromgetCourseEntryFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateCourseEntries
boolean canUpdateCourseEntries()Tests if this user can updateCourseEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aCourseEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifCourseEntrymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getCourseEntryFormForUpdate
CourseEntryForm getCourseEntryFormForUpdate(Id courseEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the course entry form for updating an existing course entry. A new course entry form should be requested for each update transaction.- Parameters:
courseEntryId- theIdof theCourseEntry- Returns:
- the course entry form
- Throws:
NotFoundException-courseEntryIdis not foundNullArgumentException-courseEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCourseEntry
void updateCourseEntry(CourseEntryForm courseEntryForm) throws OperationFailedException, PermissionDeniedException Updates an existing course entry.- Parameters:
courseEntryForm- the form containing the elements to be updated- Throws:
IllegalStateException-courseEntryFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-courseEntryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-courseEntryForm did not originate from getCourseEntryFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteCourseEntries
boolean canDeleteCourseEntries()Tests if this user can deleteCourseEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aCourseEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifCourseEntrydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteCourseEntry
void deleteCourseEntry(Id courseEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aCourseEntry.- Parameters:
courseEntryId- theIdof theCourseEntryto remove- Throws:
NotFoundException-courseEntryIdnot foundNullArgumentException-courseEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageCourseEntryAliases
boolean canManageCourseEntryAliases()Tests if this user can manageIdaliases forCourseEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifCourseEntryaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasCourseEntry
void aliasCourseEntry(Id courseEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aCourseEntryfor the purpose of creating compatibility. The primaryIdof theCourseEntryis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another course entry, it is reassigned to the given course entryId.- Parameters:
courseEntryId- theIdof aCourseEntryaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-courseEntryIdnot foundNullArgumentException-courseEntryIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-