Interface DocetAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
DocetBatchAdminSession
This session creates, updates, and deletes Docets . 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
Docet , a DocetForm is requested using
getDocetFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned DocetForm
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
DocetForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each DocetForm corresponds to an attempted transaction.
For updates, DocetForms are requested to the DocetForm
Id that is to be updated using geDocetFormForUpdate() .
Similarly, the DocetForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
DocetForm can only be used once for a successful update and cannot
be reused.
The delete operations delete Docet . To unmap a Docet
from the current CourseCatalog , the
DocetCourseCatalogAssignmentSession should be used. These delete
operations attempt to remove the Docet 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 TypeMethodDescriptionvoidaliasDocet(Id docetId, Id aliasId) Adds anIdto aDocetfor the purpose of creating compatibility.booleanTests if this user can createDocets.booleancanCreateDocetWithRecordTypes(Type[] docetRecordTypes) Tests if this user can create a singleDocetusing the desired record types.booleanTests if this user can deleteDocetsA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forDocets.booleanTests if this user can orderDocets.booleanTests if this user can updateDocets.createDocet(DocetForm docetForm) Creates a newDocet.voiddeleteDocet(Id docetId) Deletes aDocet.Gets theCourseCatalogassociated with this session.Gets theCourseCatalogIdassociated with this session.getDocetFormForCreate(Id moduleId, Id activityUnitId, Type[] docetRecordTypes) Gets the docet form for creating new docets.getDocetFormForUpdate(Id docetId) Gets the docet form for updating an existing docet.voidmoveDocetAhead(Id docetId, Id moduleId, Id referenceId) Reorders docets in a module by moving the specified docet in front of a reference docet.voidmoveDocetBehind(Id docetId, Id moduleId, Id referenceId) Reorders docets in a module by moving the specified docet behind a reference docet.voidorderDocets(Id[] docetIds, Id moduleId) Reorders a set of docets in a module.voidupdateDocet(DocetForm docetForm) Updates an existing docet.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.
-
canCreateDocets
boolean canCreateDocets()Tests if this user can createDocets. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aDocetwill 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:
falseifDocetcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateDocetWithRecordTypes
Tests if this user can create a singleDocetusing the desired record types. WhileCourseSyllabusManager.getDocetRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificDocet. Providing an empty array tests if aDocetcan be created with no records.- Parameters:
docetRecordTypes- array of docet record types- Returns:
trueifDocetcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-docetRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getDocetFormForCreate
DocetForm getDocetFormForCreate(Id moduleId, Id activityUnitId, Type[] docetRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the docet form for creating new docets. A new form should be requested for each create transaction.- Parameters:
moduleId- a moduleIdactivityUnitId- an activity unitIddocetRecordTypes- array of docet record types- Returns:
- the docet form
- Throws:
NotFoundException-moduleIdoractivityUnitIdis not foundNullArgumentException-moduleId, acticvtyUnitId, ordocetRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createDocet
Creates a newDocet.- Parameters:
docetForm- the form for thisDocet- Returns:
- the new
Docet - Throws:
IllegalStateException-docetFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-docetFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-docetFormdid not originate fromgetDocetFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateDocets
boolean canUpdateDocets()Tests if this user can updateDocets. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aDocetwill 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:
falseifDocetmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getDocetFormForUpdate
DocetForm getDocetFormForUpdate(Id docetId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the docet form for updating an existing docet. A new docet form should be requested for each update transaction.- Parameters:
docetId- theIdof theDocet- Returns:
- the docet form
- Throws:
NotFoundException-docetIdis not foundNullArgumentException-docetIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDocet
Updates an existing docet.- Parameters:
docetForm- the form containing the elements to be updated- Throws:
IllegalStateException-docetFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-docetFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-docetFormdid not originate fromgetDocetFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteDocets
boolean canDeleteDocets()Tests if this user can deleteDocetsA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aDocetwill 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:
falseifDocetdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteDocet
void deleteDocet(Id docetId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aDocet.- Parameters:
docetId- theIdof theDocetto remove- Throws:
NotFoundException-docetIdnot foundNullArgumentException-docetIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageDocetAliases
boolean canManageDocetAliases()Tests if this user can manageIdaliases forDocets. 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:
falseifDocetaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasDocet
void aliasDocet(Id docetId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aDocetfor the purpose of creating compatibility. The primaryIdof theDocetis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another docet, it is reassigned to the given docetId.- Parameters:
docetId- theIdof aDocetaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-docetIdnot foundNullArgumentException-docetIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canSequenceDocets
boolean canSequenceDocets()Tests if this user can orderDocets. 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 sequencing operations to an unauthorized user.- Returns:
falseifDocetordering is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
moveDocetAhead
void moveDocetAhead(Id docetId, Id moduleId, Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException Reorders docets in a module by moving the specified docet in front of a reference docet.- Parameters:
docetId- theIdof aDocetmoduleId- theIdof aModulereferenceId- the reference docetId- Throws:
NotFoundException-docetId, moduleId, orreferenceIdnot found or,docetIdorreferenceIdnot related tomoduleIdNullArgumentException-docetId, moduleId, orreferenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
moveDocetBehind
void moveDocetBehind(Id docetId, Id moduleId, Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException Reorders docets in a module by moving the specified docet behind a reference docet.- Parameters:
docetId- theIdof aDocetmoduleId- theIdof aModulereferenceId- the reference docetId- Throws:
NotFoundException-docetId, moduleId, orreferenceIdnot found or,docetIdorreferenceIdnot related tomoduleIdNullArgumentException-docetId, moduleIdorreferenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
orderDocets
void orderDocets(Id[] docetIds, Id moduleId) throws NotFoundException, OperationFailedException, PermissionDeniedException Reorders a set of docets in a module.- Parameters:
docetIds- theIdsfor a set ofDocetsmoduleId- theIdof aModule- Throws:
NotFoundException-docetIdnot found or, adocetIdnot related tomoduleIdNullArgumentException-docetIdsormoduleIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-