Interface CourseOfferingAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
CourseOfferingBatchAdminSession
This session creates, updates, and deletes CourseOfferings .
The data for create and update is provided by the consumer via the form.
OsidForms are requested for each create or update and may not be
reused.
Create and update operations differ in their usage. To create a
CourseOffering , a CourseOfferingForm is requested using
getCourseOfferingFormForCreate() specifying the desired course, term, and
record Types or none if no record Types are needed. The
returned CourseOfferingForm 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 CourseOfferingForm is submiited
to a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each
CourseOfferingForm corresponds to an attempted transaction.
For updates, CourseOfferingForms are requested to the
CourseOffering Id that is to be updated using
getCourseOfferingFormForUpdate() . Similarly, the
CourseOfferingForm has metadata about the data that can be updated and it
can perform validation before submitting the update. The
CourseOfferingForm can only be used once for a successful update and
cannot be reused.
The delete operations delete CourseOfferings . To unmap a
CourseOffering from the current CourseCatalog , the
CourseOfferingCourseCatalogAssignmentSession should be used. These delete
operations attempt to remove the CourseOffering 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 TypeMethodDescriptionvoidaliasCourseOffering(Id courseOfferingId, Id aliasId) Adds anIdto aCourseOfferingfor the purpose of creating compatibility.booleanTests if this user can createCourseOfferings.booleancanCreateCourseOfferingWithRecordTypes(Type[] courseOfferingRecordTypes) Tests if this user can create a singleCourseOfferingusing the desired record types.booleanTests if this user can deleteCourseOfferings.booleanTests if this user can manageIdaliases forCourseOfferings.booleanTests if this user can updateCourseOfferings.createCourseOffering(CourseOfferingForm courseOfferingForm) Creates a newCourseOffering.voiddeleteCourseOffering(Id courseOfferingId) Deletes aCourseOffering.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getCourseOfferingFormForCreate(Id courseId, Id termId, Type[] courseOfferingRecordTypes) Gets the course form for creating new course offerings.getCourseOfferingFormForUpdate(Id courseOfferingId) Gets the course offering form for updating an existing course offering.voidupdateCourseOffering(CourseOfferingForm courseOfferingForm) Updates an existing course offering.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.
-
canCreateCourseOfferings
boolean canCreateCourseOfferings()Tests if this user can createCourseOfferings. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aCourseOfferingwill 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:
falseifCourseOfferingcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateCourseOfferingWithRecordTypes
Tests if this user can create a singleCourseOfferingusing the desired record types. WhileCourseManager.getCourseOfferingRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificCourseOffering. Providing an empty array tests if aCourseOfferingcan be created with no records.- Parameters:
courseOfferingRecordTypes- array of course offering record types- Returns:
trueifCourseOfferingcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-courseOfferingRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getCourseOfferingFormForCreate
CourseOfferingForm getCourseOfferingFormForCreate(Id courseId, Id termId, Type[] courseOfferingRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the course form for creating new course offerings. A new form should be requested for each create transaction.- Parameters:
courseId- the Id of the associated CoursetermId- the Id of the associated TermcourseOfferingRecordTypes- array of course offering record types- Returns:
- the course offering form
- Throws:
NotFoundException-courseIdortermIdnot foundNullArgumentException-courseId, termIdorcourseOfferingRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createCourseOffering
CourseOffering createCourseOffering(CourseOfferingForm courseOfferingForm) throws OperationFailedException, PermissionDeniedException Creates a newCourseOffering.- Parameters:
courseOfferingForm- the form for thisCourseOffering- Returns:
- the new
CourseOffering - Throws:
IllegalStateException-courseOfferingFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-courseOfferingFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-activityForm did not originate from getCourseOfferingFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateCourseOfferings
boolean canUpdateCourseOfferings()Tests if this user can updateCourseOfferings. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aCourseOfferingwill 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:
falseifCourseOfferingmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getCourseOfferingFormForUpdate
CourseOfferingForm getCourseOfferingFormForUpdate(Id courseOfferingId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the course offering form for updating an existing course offering. A new course offering form should be requested for each update transaction.- Parameters:
courseOfferingId- theIdof theCourseOffering- Returns:
- the course offering form
- Throws:
NotFoundException-courseOfferingIdis not foundNullArgumentException-courseOfferingIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCourseOffering
void updateCourseOffering(CourseOfferingForm courseOfferingForm) throws OperationFailedException, PermissionDeniedException Updates an existing course offering.- Parameters:
courseOfferingForm- the form containing the elements to be updated- Throws:
IllegalStateException-courseOfferingFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-courseOfferingFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-activityForm did not originate from getCourseOfferingFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteCourseOfferings
boolean canDeleteCourseOfferings()Tests if this user can deleteCourseOfferings. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aCourseOfferingwill 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:
falseifCourseOfferingdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteCourseOffering
void deleteCourseOffering(Id courseOfferingId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aCourseOffering.- Parameters:
courseOfferingId- theIdof theCourseOfferingto remove- Throws:
NotFoundException-courseOfferingIdnot foundNullArgumentException-courseOfferingIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageCourseOfferingAliases
boolean canManageCourseOfferingAliases()Tests if this user can manageIdaliases forCourseOfferings. 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:
falseifCourseOfferingaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasCourseOffering
void aliasCourseOffering(Id courseOfferingId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aCourseOfferingfor the purpose of creating compatibility. The primaryIdof theCourseis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another course offering, it is reassigned to the given course offeringId.- Parameters:
courseOfferingId- theIdof aCourseOfferingaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-courseOfferingIdnot foundNullArgumentException-courseOfferingIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-