Interface ProgramOfferingAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes ProgramOfferings .
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
ProgramOffering , a ProgramOfferingForm is requested using
getProgramOfferingFormForCreate() specifying the desired canonical
program, term, and record Types or none if no record Types
are needed. The returned ProgramOfferingForm 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 ProgramOfferingForm
is submiited to a create operation, it cannot be reused with another
create operation unless the first operation was unsuccessful. Each
ProgramOfferingForm corresponds to an attempted transaction.
For updates, ProgramOfferingForms are requested to the
ProgramOffering Id that is to be updated using
getProgramOfferingFormForUpdate() . Similarly, the
ProgramOfferingForm has metadata about the data that can be updated and
it can perform validation before submitting the update. The
ProgramOfferingForm can only be used once for a successful update and
cannot be reused.
The delete operations delete ProgramEntries . To unmap a
ProgramOffering from the current CourseCatalog , the
ProgramOfferingCourseCatalogAssignmentSession should be used.
These delete operations attempt to remove the ProgramOffering
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 TypeMethodDescriptionvoidaliasProgramOffering(Id programOfferingId, Id aliasId) Adds anIdto aProgramOfferingfor the purpose of creating compatibility.booleanTests if this user can createProgramOfferings.booleancanCreateProgramOfferingWithRecordTypes(Type[] programOfferingRecordTypes) Tests if this user can create a singleProgramOfferingusing the desired record types.booleanTests if this user can deleteProgramOfferings.booleanTests if this user can manageIdaliases forProgramOfferings.booleanTests if this user can updateProgramOfferings.createProgramOffering(ProgramOfferingForm programOfferingForm) Creates a newProgramOffering.voiddeleteProgramOffering(Id programOfferingId) Deletes aProgramOffering.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getProgramOfferingFormForCreate(Id programId, Id termId, Type[] programOfferingRecordTypes) Gets the program offering form for creating new program offerings.getProgramOfferingFormForUpdate(Id programOfferingId) Gets the program offering form for updating an existing program offering.voidupdateProgramOffering(ProgramOfferingForm programOfferingForm) Updates an existing program 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.
-
canCreateProgramOfferings
boolean canCreateProgramOfferings()Tests if this user can createProgramOfferings. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aProgramOfferingwill 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:
falseifProgramOfferingcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateProgramOfferingWithRecordTypes
Tests if this user can create a singleProgramOfferingusing the desired record types. WhileCourseProgramManager.getProgramOfferingRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificProgramOffering. Providing an empty array tests if aProgramOfferingcan be created with no records.- Parameters:
programOfferingRecordTypes- array of program offering record types- Returns:
trueifProgramOfferingcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-programOfferingRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getProgramOfferingFormForCreate
ProgramOfferingForm getProgramOfferingFormForCreate(Id programId, Id termId, Type[] programOfferingRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the program offering form for creating new program offerings. A new form should be requested for each create transaction.- Parameters:
programId- theIdof the associatedProgramtermId- theIdof the associatedTermprogramOfferingRecordTypes- array of program offering record types- Returns:
- the program offering form
- Throws:
NotFoundException-programIdortermIdnot foundNullArgumentException-programId, termIdorprogramOfferingRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createProgramOffering
ProgramOffering createProgramOffering(ProgramOfferingForm programOfferingForm) throws OperationFailedException, PermissionDeniedException Creates a newProgramOffering.- Parameters:
programOfferingForm- the form for thisProgramOffering- Returns:
- the new
ProgramOffering - Throws:
IllegalStateException-programOfferingFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-programOfferingFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-programOfferingFormdid not originate fromgetProramOfferingFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateProgramOfferings
boolean canUpdateProgramOfferings()Tests if this user can updateProgramOfferings. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aProgramOfferingwill 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:
falseifProgramOfferingmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getProgramOfferingFormForUpdate
ProgramOfferingForm getProgramOfferingFormForUpdate(Id programOfferingId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the program offering form for updating an existing program offering. A new program offering form should be requested for each update transaction.- Parameters:
programOfferingId- theIdof theProgramOffering- Returns:
- the program offering form
- Throws:
NotFoundException-programOfferingIdis not foundNullArgumentException-programOfferingIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateProgramOffering
void updateProgramOffering(ProgramOfferingForm programOfferingForm) throws OperationFailedException, PermissionDeniedException Updates an existing program offering.- Parameters:
programOfferingForm- the form containing the elements to be updated- Throws:
IllegalStateException-programOfferingFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-programOfferingFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-programOfferingFormdid not originate fromgetProramOfferingFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteProgramOfferings
boolean canDeleteProgramOfferings()Tests if this user can deleteProgramOfferings. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aProgramOfferingwill 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:
falseifProgramOfferingdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteProgramOffering
void deleteProgramOffering(Id programOfferingId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aProgramOffering.- Parameters:
programOfferingId- theIdof theProgramOfferingto remove- Throws:
NotFoundException-programOfferingIdnot foundNullArgumentException-programOfferingIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageProgramOfferingAliases
boolean canManageProgramOfferingAliases()Tests if this user can manageIdaliases forProgramOfferings. 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:
falseifProgramOfferingaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasProgramOffering
void aliasProgramOffering(Id programOfferingId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aProgramOfferingfor the purpose of creating compatibility. The primaryIdof theprogramis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another program offering, it is reassigned to the given program offeringId.- Parameters:
programOfferingId- theIdof aProgramOfferingaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-programOfferingIdnot foundNullArgumentException-programOfferingIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-