Interface ChecklistAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ChecklistBatchAdminSession
This session creates, updates, and deletes Checklists . 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
Checklist , a ChecklistForm is requested using
geChecklistFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned
ChecklistForm 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 ChecklistForm is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each ChecklistForm corresponds to an attempted
transaction.
For updates, ChecklistForms are requested to the
Checklist Id that is to be updated using
getChecklistFormForUpdate() . Similarly, the ChecklistForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The ChecklistForm can only be used
once for a successful update and cannot be reused.
The delete operations delete Checklists .
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasChecklist(Id checklistId, Id aliasId) Adds anIdto aChecklistfor the purpose of creating compatibility.booleanTests if this user can createChecklists.booleancanCreateChecklistWithRecordTypes(Type[] checklistRecordTypes) Tests if this user can create a singleChecklistusing the desired record types.booleanTests if this user can deleteChecklistsA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forChecklists.booleanTests if this user can updateChecklists.createChecklist(ChecklistForm checklistForm) Creates a newChecklist.voiddeleteChecklist(Id checklistId) Deletes aChecklist.getChecklistFormForCreate(Type[] checklistRecordTypes) Gets the checklist form for creating new checklists.getChecklistFormForUpdate(Id checklistId) Gets the checklist form for updating an existing checklist.voidupdateChecklist(ChecklistForm checklistForm) Updates an existing checklist.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
-
canCreateChecklists
boolean canCreateChecklists()Tests if this user can createChecklists. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aChecklistwill 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:
falseifChecklistcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateChecklistWithRecordTypes
Tests if this user can create a singleChecklistusing the desired record types. WhileChecklistManager.getChecklistRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificChecklist. Providing an empty array tests if aChecklistcan be created with no records.- Parameters:
checklistRecordTypes- array of checklist record types- Returns:
trueifChecklistcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-checklistRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getChecklistFormForCreate
ChecklistForm getChecklistFormForCreate(Type[] checklistRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the checklist form for creating new checklists. A new form should be requested for each create transaction.- Parameters:
checklistRecordTypes- array of checklist record types- Returns:
- the checklist form
- Throws:
NullArgumentException-checklistRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createChecklist
Checklist createChecklist(ChecklistForm checklistForm) throws OperationFailedException, PermissionDeniedException Creates a newChecklist.- Parameters:
checklistForm- the form for thisChecklist- Returns:
- the new
Checklist - Throws:
IllegalStateException-checklistFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-checklistFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-checklistFormdid not originate fromgetChecklistFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateChecklists
boolean canUpdateChecklists()Tests if this user can updateChecklists. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aChecklistwill 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:
falseifChecklistmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getChecklistFormForUpdate
ChecklistForm getChecklistFormForUpdate(Id checklistId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the checklist form for updating an existing checklist. A new checklist form should be requested for each update transaction.- Parameters:
checklistId- theIdof theChecklist- Returns:
- the checklist form
- Throws:
NotFoundException-checklistIdis not foundNullArgumentException-checklistIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateChecklist
void updateChecklist(ChecklistForm checklistForm) throws OperationFailedException, PermissionDeniedException Updates an existing checklist.- Parameters:
checklistForm- the form containing the elements to be updated- Throws:
IllegalStateException-checklistFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-checklistFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-checklistFormdid not originate fromgetChecklistFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteChecklists
boolean canDeleteChecklists()Tests if this user can deleteChecklistsA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aChecklistwill 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:
falseifChecklistdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteChecklist
void deleteChecklist(Id checklistId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aChecklist.- Parameters:
checklistId- theIdof theChecklistto remove- Throws:
NotFoundException-checklistIdnot foundNullArgumentException-checklistIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageChecklistAliases
boolean canManageChecklistAliases()Tests if this user can manageIdaliases forChecklists. 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:
falseifChecklistaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasChecklist
void aliasChecklist(Id checklistId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aChecklistfor the purpose of creating compatibility. The primaryIdof theChecklistis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another checklist, it is reassigned to the given checklistId.- Parameters:
checklistId- theIdof aChecklistaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-checklistIdnot foundNullArgumentException-checklistIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-