Interface CourseCatalogAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
CourseCatalogBatchAdminSession
This session creates, updates, and deletes CourseCatalogs . 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
CourseCatalog , a CourseCatalogForm is requested using
getCourseCatalogFormForCreate() specifying the desired record
Types or none if no record Types are needed. The returned
CourseCatalogForm 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 CourseCatalogForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each CourseCatalogForm
corresponds to an attempted transaction.
For updates, CourseCatalogForms are requested to the
CourseCatalog Id that is to be updated using
getCourseCatalogFormForUpdate() . Similarly, the
CourseCatalogForm has metadata about the data that can be updated and it
can perform validation before submitting the update. The
CourseCatalogForm can only be used once for a successful update and
cannot be reused.
The delete operations delete CourseCatalogs . It is safer to
remove all mappings to the CourseCatalog catalogs before deletion.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasCourseCatalog(Id courseCatalogId, Id aliasId) Adds anIdto aCourseCatalogfor the purpose of creating compatibility.booleanTests if this user can createCourseCatalogs.booleancanCreateCourseCatalogWithRecordTypes(Type[] courseCatalogRecordTypes) Tests if this user can create a singleCourseCatalogusing the desired record types.booleanTests if this user can deleteCourseCatalogs.booleanTests if this user can manageIdaliases forCourseCatalogs.booleanTests if this user can updateCourseCatalogs.createCourseCatalog(CourseCatalogForm courseCatalogForm) Creates a newCourseCatalog.voiddeleteCourseCatalog(Id courseCatalogId) Deletes aCourseCatalog.getCourseCatalogFormForCreate(Type[] courseCatalogRecordTypes) Gets the course catalog form for creating new course catalogs.getCourseCatalogFormForUpdate(Id courseCatalogId) Gets the course catalog form for updating an existing course catalog.voidupdateCourseCatalog(CourseCatalogForm courseCatalogForm) Updates an existing course catalog.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
-
canCreateCourseCatalogs
boolean canCreateCourseCatalogs()Tests if this user can createCourseCatalogs. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aCourseCatalog. will result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifCourseCatalogcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateCourseCatalogWithRecordTypes
Tests if this user can create a singleCourseCatalogusing the desired record types. WhileCourseManager.getCourseCatalogRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificCourseCatalog. Providing an empty array tests if aCourseCatalogcan be created with no records.- Parameters:
courseCatalogRecordTypes- array of course catalog record types- Returns:
trueifCourseCatalogcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-courseCatalogRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getCourseCatalogFormForCreate
CourseCatalogForm getCourseCatalogFormForCreate(Type[] courseCatalogRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the course catalog form for creating new course catalogs. A new form should be requested for each create transaction.- Parameters:
courseCatalogRecordTypes- array of course catalog record types- Returns:
- the course catalog form
- Throws:
NullArgumentException-courseCatalogRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createCourseCatalog
CourseCatalog createCourseCatalog(CourseCatalogForm courseCatalogForm) throws OperationFailedException, PermissionDeniedException Creates a newCourseCatalog.- Parameters:
courseCatalogForm- the form for thisCourseCatalog- Returns:
- the new
CourseCatalog - Throws:
IllegalStateException-courseCatalogFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-courseCatalogFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-courseCatalogFormdid not originate fromgetCourseCatalogFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateCourseCatalogs
boolean canUpdateCourseCatalogs()Tests if this user can updateCourseCatalogs. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aCourseCatalogwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifCourseCatalogmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getCourseCatalogFormForUpdate
CourseCatalogForm getCourseCatalogFormForUpdate(Id courseCatalogId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the course catalog form for updating an existing course catalog. A new course catalog form should be requested for each update transaction.- Parameters:
courseCatalogId- theIdof theCourseCatalog- Returns:
- the course catalog form
- Throws:
NotFoundException-courseCatalogIdis not foundNullArgumentException-courseCatalogIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCourseCatalog
void updateCourseCatalog(CourseCatalogForm courseCatalogForm) throws OperationFailedException, PermissionDeniedException Updates an existing course catalog.- Parameters:
courseCatalogForm- the form containing the elements to be updated- Throws:
IllegalStateException-courseCatalogFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-courseCatalogFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-courseCatalogFormdid not originate fromgetCourseCatalogFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteCourseCatalogs
boolean canDeleteCourseCatalogs()Tests if this user can deleteCourseCatalogs. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aCourseCatalogwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifCourseCatalogdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteCourseCatalog
void deleteCourseCatalog(Id courseCatalogId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aCourseCatalog.- Parameters:
courseCatalogId- theIdof theCourseCatalogto remove- Throws:
NotFoundException-courseCatalogIdnot foundNullArgumentException-courseCatalogIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageCourseCatalogAliases
boolean canManageCourseCatalogAliases()Tests if this user can manageIdaliases forCourseCatalogs. 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:
falseifCourseCatalogaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasCourseCatalog
void aliasCourseCatalog(Id courseCatalogId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aCourseCatalogfor the purpose of creating compatibility. The primaryIdof theCourseCatalogis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another course catalog, it is reassigned to the given course catalogId.- Parameters:
courseCatalogId- theIdof aCourseCatalogaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-aliasIdis in use as a primaryIdNullArgumentException-courseCatalogIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-