Interface GradebookColumnCalculationAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface GradebookColumnCalculationAdminSession extends OsidSession

This session creates, updates, and deletes GradebookColumnCalculations . 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 GradebookColumnCalculation , a GradebookColumnCalculationForm is requested using getGradebookColumnCalculationFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned GradebookColumnCalculationForm 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 GradebookColumnCalculationForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each GradebookColumnCalculationForm corresponds to an attempted transaction.

For updates, GradebookColumnCalculationForms are requested to the GradebookColumnCalculation Id that is to be updated using getGradebookColumnCalculationFormForUpdate() . Similarly, the GradebookColumnCalculationForm has metadata about the data that can be updated and it can perform validation before submitting the update. The GradebookColumnCalculationForm can only be used once for a successful update and cannot be reused.

The delete operations delete GradebookColumnCalculations .

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • getGradebookId

      Id getGradebookId()
      Gets the Gradebook Id associated with this session.
      Returns:
      the Gradebook Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getGradebook

      Gets the Gradebook associated with this session.
      Returns:
      the Gradebook associated with this session
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateGradebookColumnCalculations

      boolean canCreateGradebookColumnCalculations()
      Tests if this user can create gradebook column calculationss. 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 a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
      Returns:
      false if GradebookColumnCalculation creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateGradebookColumnCalculationWithRecordTypes

      boolean canCreateGradebookColumnCalculationWithRecordTypes(Type[] gradebookColumnRecordCalculationTypes)
      Tests if this user can create a single GradebookColumnCalculation using the desired record types. While GradingCalculationManager.getGradebookColumnCalculationRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific GradebookColumnCalculation . Providing an empty array tests if a GradebookColumnCalculation can be created with no records.
      Parameters:
      gradebookColumnRecordCalculationTypes - array of gradebook column calculation record types
      Returns:
      true if GradebookColumnCalculation creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - gradebookColumnRecordCalculationTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getGradebookColumnCalculationFormForCreate

      GradebookColumnCalculationForm getGradebookColumnCalculationFormForCreate(Id gradebookColumnId, Type[] gradebookColumnRecordCalculationTypes) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the gradebook column calculation form for creating new gradebook columns. A new form should be requested for each create transaction.
      Parameters:
      gradebookColumnId - the Id for the GradebookColumn
      gradebookColumnRecordCalculationTypes - array of gradebook column calculation record types
      Returns:
      the gradebook column calculation form
      Throws:
      AlreadyExistsException - gradebookColumnId already has a calculation
      NotFoundException - gradebookColumnId is not found
      NullArgumentException - gradebokColumnId or gradebookColumnRecordCalculationTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createGradebookColumnCalculation

      GradebookColumnCalculation createGradebookColumnCalculation(GradebookColumnCalculationForm gradebookColumnCalculationForm) throws OperationFailedException, PermissionDeniedException
      Creates a new GradebookColumnCalculation .
      Parameters:
      gradebookColumnCalculationForm - the form containing the elements to be updated
      Returns:
      the new GradebookColumnCalculation
      Throws:
      IllegalStateException - gradebookColumnCalculationForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - gradebookColumnCalculationForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - gradebookColumnCalculationForm did not originate from getGradebookColumnCalculationFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateGradebookColumnCalculations

      boolean canUpdateGradebookColumnCalculations()
      Tests if this user can update gradebook column calculations. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a GradebookColumnCalculation will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
      Returns:
      false if gradebook column calculation modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getGradebookColumnCalculationFormForUpdate

      GradebookColumnCalculationForm getGradebookColumnCalculationFormForUpdate(Id gradebookColumnCalculationId) throws NotFoundException, OperationFailedException
      Gets the gradebook column calculation form for updating an existing gradebook column. A new gradebook column form should be requested for each update transaction.
      Parameters:
      gradebookColumnCalculationId - the Id of the GradebookColumnCalculation
      Returns:
      the gradebook column calculation form
      Throws:
      NotFoundException - gradebookColumnCalculationId is not found
      NullArgumentException - gradebookColumnCalculationId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • updateGradebookColumnCalculation

      void updateGradebookColumnCalculation(GradebookColumnCalculationForm gradebookColumnCalculationForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing gradebook column calculation.
      Parameters:
      gradebookColumnCalculationForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - gradebookColumnCalculationForm already used in a update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - gradebookColumnCalculationForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - gradebookColumnCalculationForm did not originate from getGradebookColumnCalculationFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteGradebookColumnCalculations

      boolean canDeleteGradebookColumnCalculations()
      Tests if this user can delete gradebook column calculations. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a GradebookColumnCalculation will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
      Returns:
      false if GradebookColumnCalculation deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteGradebookColumnCalculation

      void deleteGradebookColumnCalculation(Id gradebookColumnCalculationId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes the GradebookColumnCalculation identified by the given Id .
      Parameters:
      gradebookColumnCalculationId - the Id of the GradebookColumnCalculation to delete
      Throws:
      NotFoundException - a GradebookColumnCalculation was not found identified by the given Id
      NullArgumentException - gradebookColumnCalculationId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.