Interface AssessmentPartAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes AssessmentParts .
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 an
AssessmentPart , an AssessmentPartForm is requested using
getAssessmentPartFormForCreate() specifying the desired record
Types or none if no record Types are needed. The returned
AssessmentPartForm 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 AssessmentPartForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each AssessmentPartForm
corresponds to an attempted transaction.
For updates, AssessmentPartForms are requested to the
AssessmentPart Id that is to be updated using
getAssessmentPartFormForUpdate() . Similarly, the
AssessmentPartForm has metadata about the data that can be updated and it
can perform validation before submitting the update. The
AssessmentPartForm can only be used once for a successful update and
cannot be reused.
The delete operations delete AssessmentParts .
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasAssessmentPart(Id assessmentPartId, Id aliasId) Adds anIdto anAssessmentPartfor the purpose of creating compatibility.booleanTests if this user can create assessment parts.booleancanCreateAssessmentPartWithRecordTypes(Type[] assessmentPartRecordTypes) Tests if this user can create a singleAssessmentPartusing the desired record types.booleanTests if this user can deleteAssessmentParts.booleanTests if this user can manageIdaliases forAssessmentParts.booleanTests if this user can updateAssessmentParts.createAssessmentPartForAssessment(AssessmentPartForm assessmentPartForm) Creates a new assessment part.createAssessmentPartForAssessmentPart(AssessmentPartForm assessmentPartForm) Creates a new assessment part.voiddeleteAssessmentPart(Id assessmentPartId) Removes an asessment part and all mapped items.getAssessmentPartFormForCreateForAssessment(Id assessmentId, Type[] assessmentPartRecordTypes) Gets the assessment part form for creating new assessment parts for an assessment.getAssessmentPartFormForCreateForAssessmentPart(Id assessmentPartId, Type[] assessmentPartRecordTypes) Gets the assessment part form for creating new assessment parts under another assessment part.getAssessmentPartFormForUpdate(Id assessmentPartId) Gets the assessment part form for updating an existing assessment part.getBank()Gets theBankassociated with this session.Gets theBankIdassociated with this session.voidupdateAssessmentPart(AssessmentPartForm assessmentPartForm) Updates an existing assessment part.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
-
getBankId
Id getBankId()Gets theBankIdassociated with this session.- Returns:
- the
Bank Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getBank
Gets theBankassociated with this session.- Returns:
- the
Bankassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateAssessmentParts
boolean canCreateAssessmentParts()Tests if this user can create assessment parts. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to unauthorized users.- Returns:
falseifAssessmentPartcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateAssessmentPartWithRecordTypes
Tests if this user can create a singleAssessmentPartusing the desired record types. WhileAssessmentAuthoringManager.getAssessmentPartRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificAssessmentPart. Providing an empty array tests if anAssessmentPartcan be created with no records.- Parameters:
assessmentPartRecordTypes- array of assessment part record types- Returns:
trueifAssessmentPartcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-assessmentPartRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getAssessmentPartFormForCreateForAssessment
AssessmentPartForm getAssessmentPartFormForCreateForAssessment(Id assessmentId, Type[] assessmentPartRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the assessment part form for creating new assessment parts for an assessment. A new form should be requested for each create transaction.- Parameters:
assessmentId- an assessmentIdassessmentPartRecordTypes- array of assessment part record types to be included in the create operation or an empty list if none- Returns:
- the assessment part form
- Throws:
NotFoundException-assessmentIdis not foundNullArgumentException-assessmentIdorassessmentPartRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createAssessmentPartForAssessment
AssessmentPart createAssessmentPartForAssessment(AssessmentPartForm assessmentPartForm) throws OperationFailedException, PermissionDeniedException Creates a new assessment part.- Parameters:
assessmentPartForm- assessment part form- Returns:
- the new part
- Throws:
IllegalStateException-assessmentPartFormalready used in a create transactionInvalidArgumentException-assessmentPartFormis invalidNullArgumentException-assessmentPartFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException-assessmentPartFormdid not originate fromgetAssessmentPartFormForCreateForAssessment()- Compliance:
mandatory- This method must be implemented.
-
getAssessmentPartFormForCreateForAssessmentPart
AssessmentPartForm getAssessmentPartFormForCreateForAssessmentPart(Id assessmentPartId, Type[] assessmentPartRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the assessment part form for creating new assessment parts under another assessment part. A new form should be requested for each create transaction.- Parameters:
assessmentPartId- an assessment partIdassessmentPartRecordTypes- array of assessment part record types to be included in the create operation or an empty list if none- Returns:
- the assessment part form
- Throws:
NotFoundException-assessmentPartIdis not foundNullArgumentException-assessmentPartIdorassessmentPartRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createAssessmentPartForAssessmentPart
AssessmentPart createAssessmentPartForAssessmentPart(AssessmentPartForm assessmentPartForm) throws OperationFailedException, PermissionDeniedException Creates a new assessment part.- Parameters:
assessmentPartForm- assessment part form- Returns:
- the new part
- Throws:
IllegalStateException-assessmentPartFormalready used in a create transactionInvalidArgumentException-assessmentPartFormis invalidNullArgumentException-assessmentPartFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurredUnsupportedException-assessmentPartFormdid not originate fromgetAssessmentPartFormForCreateForAssessmentPart()- Compliance:
mandatory- This method must be implemented.
-
canUpdateAssessmentParts
boolean canUpdateAssessmentParts()Tests if this user can updateAssessmentParts. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anAssessmentPartwill 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:
falseif assessment part modification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getAssessmentPartFormForUpdate
AssessmentPartForm getAssessmentPartFormForUpdate(Id assessmentPartId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the assessment part form for updating an existing assessment part. A new assessment part form should be requested for each update transaction.- Parameters:
assessmentPartId- theIdof theAssessmentPart- Returns:
- the assessment part form
- Throws:
NotFoundException-assessmentPartIdis not foundNullArgumentException-assessmentPartIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
updateAssessmentPart
void updateAssessmentPart(AssessmentPartForm assessmentPartForm) throws OperationFailedException, PermissionDeniedException Updates an existing assessment part.- Parameters:
assessmentPartForm- the form containing the elements to be updated- Throws:
IllegalStateException-assessmentPartFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-assessmentPartFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-assessmentPartFormdid not originate fromgetAssessmentPartFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteAssessmentParts
boolean canDeleteAssessmentParts()Tests if this user can deleteAssessmentParts. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anAssessmentPartwill 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:
falseifAssessmentPartdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteAssessmentPart
void deleteAssessmentPart(Id assessmentPartId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes an asessment part and all mapped items.- Parameters:
assessmentPartId- theIdof theAssessmentPart- Throws:
NotFoundException-assessmentPartIdnot foundNullArgumentException-assessmentPartIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
canManageAssessmentPartAliases
boolean canManageAssessmentPartAliases()Tests if this user can manageIdaliases forAssessmentParts. 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:
falseifAssessmentPartaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasAssessmentPart
void aliasAssessmentPart(Id assessmentPartId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anAssessmentPartfor the purpose of creating compatibility. The primaryIdof theAssessmentPartis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another assessment part, it is reassigned to the given assessment partId.- Parameters:
assessmentPartId- theIdof anAssessmentPartaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis in use as a primaryIdNotFoundException-assessmentPartIdnot foundNullArgumentException-assessmentPartIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-