Interface CourseOfferingAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
CourseOfferingBatchAdminSession

public interface CourseOfferingAdminSession extends OsidSession

This session creates, updates, and deletes CourseOfferings . The data for create and update is provided by the consumer via the form. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a CourseOffering , a CourseOfferingForm is requested using getCourseOfferingFormForCreate() specifying the desired course, term, and record Types or none if no record Types are needed. The returned CourseOfferingForm 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 CourseOfferingForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each CourseOfferingForm corresponds to an attempted transaction.

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

The delete operations delete CourseOfferings . To unmap a CourseOffering from the current CourseCatalog , the CourseOfferingCourseCatalogAssignmentSession should be used. These delete operations attempt to remove the CourseOffering 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 Details

    • getCourseCatalogId

      Id getCourseCatalogId()
      Gets the CourseCatalog Id associated with this session.
      Returns:
      the CourseCatalog Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getCourseCatalog

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

      boolean canCreateCourseOfferings()
      Tests if this user can create CourseOfferings . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a CourseOffering 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 CourseOffering creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateCourseOfferingWithRecordTypes

      boolean canCreateCourseOfferingWithRecordTypes(Type[] courseOfferingRecordTypes)
      Tests if this user can create a single CourseOffering using the desired record types. While CourseManager.getCourseOfferingRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific CourseOffering . Providing an empty array tests if a CourseOffering can be created with no records.
      Parameters:
      courseOfferingRecordTypes - array of course offering record types
      Returns:
      true if CourseOffering creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - courseOfferingRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getCourseOfferingFormForCreate

      CourseOfferingForm getCourseOfferingFormForCreate(Id courseId, Id termId, Type[] courseOfferingRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the course form for creating new course offerings. A new form should be requested for each create transaction.
      Parameters:
      courseId - the Id of the associated Course
      termId - the Id of the associated Term
      courseOfferingRecordTypes - array of course offering record types
      Returns:
      the course offering form
      Throws:
      NotFoundException - courseId or termId not found
      NullArgumentException - courseId, termId or courseOfferingRecordTypes 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.
    • createCourseOffering

      CourseOffering createCourseOffering(CourseOfferingForm courseOfferingForm) throws OperationFailedException, PermissionDeniedException
      Creates a new CourseOffering .
      Parameters:
      courseOfferingForm - the form for this CourseOffering
      Returns:
      the new CourseOffering
      Throws:
      IllegalStateException - courseOfferingForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - courseOfferingForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - activityForm did not originate from getCourseOfferingFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateCourseOfferings

      boolean canUpdateCourseOfferings()
      Tests if this user can update CourseOfferings . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a CourseOffering 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 CourseOffering modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getCourseOfferingFormForUpdate

      CourseOfferingForm getCourseOfferingFormForUpdate(Id courseOfferingId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the course offering form for updating an existing course offering. A new course offering form should be requested for each update transaction.
      Parameters:
      courseOfferingId - the Id of the CourseOffering
      Returns:
      the course offering form
      Throws:
      NotFoundException - courseOfferingId is not found
      NullArgumentException - courseOfferingId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateCourseOffering

      void updateCourseOffering(CourseOfferingForm courseOfferingForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing course offering.
      Parameters:
      courseOfferingForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - courseOfferingForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - courseOfferingForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - activityForm did not originate from getCourseOfferingFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteCourseOfferings

      boolean canDeleteCourseOfferings()
      Tests if this user can delete CourseOfferings . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a CourseOffering 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 CourseOffering deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteCourseOffering

      void deleteCourseOffering(Id courseOfferingId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a CourseOffering .
      Parameters:
      courseOfferingId - the Id of the CourseOffering to remove
      Throws:
      NotFoundException - courseOfferingId not found
      NullArgumentException - courseOfferingId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageCourseOfferingAliases

      boolean canManageCourseOfferingAliases()
      Tests if this user can manage Id aliases for CourseOfferings . A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
      Returns:
      false if CourseOffering aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasCourseOffering

      void aliasCourseOffering(Id courseOfferingId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an Id to a CourseOffering for the purpose of creating compatibility. The primary Id of the Course is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another course offering, it is reassigned to the given course offering Id .
      Parameters:
      courseOfferingId - the Id of a CourseOffering
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is in use as a primary Id
      NotFoundException - courseOfferingId not found
      NullArgumentException - courseOfferingId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.