Interface GradebookColumnAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
GradebookColumnBatchAdminSession
This session creates, updates, and deletes GradebookColumns .
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
GradebookColumn , a GradebookColumnForm is requested using
getGradebookColumnFormForCreate() specifying the desired record
Types or none if no record Types are needed. The returned
GradebookColumnForm 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 GradebookColumnForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each GradebookColumnForm
corresponds to an attempted transaction.
For updates, GradebookColumnForms are requested to the
GradebookColumn Id that is to be updated using
getGradebookColumnFormForUpdate() . Similarly, the
GradebookColumnForm has metadata about the data that can be updated and
it can perform validation before submitting the update. The
GradebookColumnForm can only be used once for a successful update and
cannot be reused.
The delete operations delete GradebookColumns To unmap a
GradebookColumn from the current Gradebook , the
GradebookColumnGradebookAssignmentSession should be used. These delete
operations attempt to remove the GradebookColumnForm itself thus
removing it from all known Gradebook catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id .
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasGradebookColumn(Id gradebookColumnId, Id aliasId) Adds anIdto aGradebookColumnfor the purpose of creating compatibility.booleanTests if this user can create gradebook columns.booleancanCreateGradebookColumnWithRecordTypes(Type[] gradebookColumnRecordTypes) Tests if this user can create a singleGradebookColumnusing the desired record types.booleanTests if this user can delete gradebook columns.booleanTests if this user can manageIdaliases forGradebookColumns.booleanTests if this user can update gradebook columns.voidcopyGradebookColumnEntries(Id sourceGradebookColumnId, Id targetGradebookColumnId) Copies gradebook column entries from one column to another.createGradebookColumn(GradebookColumnForm gradebookColumnForm) Creates a newGradebookColumn.voiddeleteGradebookColumn(Id gradebookColumnId) Deletes theGradebookColumnidentified by the givenId.Gets theGradebookassociated with this session.getGradebookColumnFormForCreate(Type[] gradebookColumnRecordTypes) Gets the gradebook column form for creating new gradebook columns.getGradebookColumnFormForUpdate(Id gradebookColumnId) Gets the gradebook column form for updating an existing gradebook column.Gets theGradebookIdassociated with this session.voidmoveGradebookColumn(Id frontGradebookColumnId, Id backGradebookColumnId) Moves a gradebook column in front of another.voidsequenceGradebookColumns(IdList gradebookColumnIds) Resequences the gradebook columns.voidupdateGradebookColumn(GradebookColumnForm gradebookColumnForm) Updates an existing gradebook column.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
-
getGradebookId
Id getGradebookId()Gets theGradebookIdassociated with this session.- Returns:
- the
Gradebook Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getGradebook
Gets theGradebookassociated with this session.- Returns:
- the
Gradebookassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateGradebookColumns
boolean canCreateGradebookColumns()Tests if this user can create gradebook columns. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a gradebook column will 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:
falseifGradebookColumncreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateGradebookColumnWithRecordTypes
Tests if this user can create a singleGradebookColumnusing the desired record types. WhileGradingManager.getGradebookColumnRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificGradebookColumn. Providing an empty array tests if aGradebookColumncan be created with no records.- Parameters:
gradebookColumnRecordTypes- array of gradebook column record types- Returns:
trueifGradebookColumncreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-gradebookColumnRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getGradebookColumnFormForCreate
GradebookColumnForm getGradebookColumnFormForCreate(Type[] gradebookColumnRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the gradebook column form for creating new gradebook columns. A new form should be requested for each create transaction.- Parameters:
gradebookColumnRecordTypes- array of gradebook column record types- Returns:
- the gradebook column form
- Throws:
NullArgumentException-gradebookColumnRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createGradebookColumn
GradebookColumn createGradebookColumn(GradebookColumnForm gradebookColumnForm) throws OperationFailedException, PermissionDeniedException Creates a newGradebookColumn.- Parameters:
gradebookColumnForm- the form for thisGradebookColumn- Returns:
- the new
GradebookColumn - Throws:
IllegalStateException-gradebookColumnFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-gradebookColumnFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-gradebookColumnFormdid not originate fromgetGradebookColumnFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateGradebookColumns
boolean canUpdateGradebookColumns()Tests if this user can update gradebook columns. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aGradebookColumnwill 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 gradebook column modification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getGradebookColumnFormForUpdate
GradebookColumnForm getGradebookColumnFormForUpdate(Id gradebookColumnId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the gradebook column form for updating an existing gradebook column. A new gradebook column form should be requested for each update transaction.- Parameters:
gradebookColumnId- theIdof theGradebookColumn- Returns:
- the gradebook column form
- Throws:
NotFoundException-gradebookColumnIdis not foundNullArgumentException-gradebookColumnIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateGradebookColumn
void updateGradebookColumn(GradebookColumnForm gradebookColumnForm) throws OperationFailedException, PermissionDeniedException Updates an existing gradebook column.- Parameters:
gradebookColumnForm- the form containing the elements to be updated- Throws:
IllegalStateException-gradebookColumnFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-gradebookColumnFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-gradebookColumnFormdid not originate fromgetGradebookColumnFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
sequenceGradebookColumns
void sequenceGradebookColumns(IdList gradebookColumnIds) throws OperationFailedException, PermissionDeniedException Resequences the gradebook columns.- Parameters:
gradebookColumnIds- theIdsof theGradebookColumns- Throws:
NullArgumentException-gradebookColumnIdListisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
moveGradebookColumn
void moveGradebookColumn(Id frontGradebookColumnId, Id backGradebookColumnId) throws NotFoundException, OperationFailedException, PermissionDeniedException Moves a gradebook column in front of another.- Parameters:
frontGradebookColumnId- theIdof aGradebookColumnbackGradebookColumnId- theIdof aGradebookColumn- Throws:
NotFoundException-frontGradebookColumnId or backGradebookColumnIdis not foundNullArgumentException-frontGradebookColumnId or backGradebookColumnIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
copyGradebookColumnEntries
void copyGradebookColumnEntries(Id sourceGradebookColumnId, Id targetGradebookColumnId) throws NotFoundException, OperationFailedException, PermissionDeniedException Copies gradebook column entries from one column to another. If the target grade column grade system differs from the source, the grades in the entries are transformed to the new grade system.- Parameters:
sourceGradebookColumnId- theIdof aGradebookColumntargetGradebookColumnId- theIdof aGradebookColumn- Throws:
NotFoundException-sourceGradebookColumnId ortargetGradebookColumnIdis not foundNullArgumentException-sourceGradebookColumnId targetGradebookColumnIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canDeleteGradebookColumns
boolean canDeleteGradebookColumns()Tests if this user can delete gradebook columns. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aGradebookColumnwill 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:
falseifGradebookColumndeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteGradebookColumn
void deleteGradebookColumn(Id gradebookColumnId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes theGradebookColumnidentified by the givenId.- Parameters:
gradebookColumnId- theIdof theGradebookColumnto delete- Throws:
NotFoundException- aGradebookColumnwas not found identified by the givenIdNullArgumentException-gradebookColumnIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageGradebookColumnAliases
boolean canManageGradebookColumnAliases()Tests if this user can manageIdaliases forGradebookColumns. 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:
falseifGradebookColumnaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasGradebookColumn
void aliasGradebookColumn(Id gradebookColumnId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aGradebookColumnfor the purpose of creating compatibility. The primaryIdof theGradebookColumnis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another gradebook column, it is reassigned to the given gradebook columnId.- Parameters:
gradebookColumnId- theIdof aGradebookColumnaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-gradebookColumnIdnot foundNullArgumentException-gradebookColumnIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-