Interface ProgramOfferingAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ProgramOfferingAdminSession extends OsidSession

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

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

The delete operations delete ProgramEntries . To unmap a ProgramOffering from the current CourseCatalog , the ProgramOfferingCourseCatalogAssignmentSession should be used. These delete operations attempt to remove the ProgramOffering 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.
    • canCreateProgramOfferings

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

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

      ProgramOfferingForm getProgramOfferingFormForCreate(Id programId, Id termId, Type[] programOfferingRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the program offering form for creating new program offerings. A new form should be requested for each create transaction.
      Parameters:
      programId - the Id of the associated Program
      termId - the Id of the associated Term
      programOfferingRecordTypes - array of program offering record types
      Returns:
      the program offering form
      Throws:
      NotFoundException - programId or termId not found
      NullArgumentException - programId, termId or programOfferingRecordTypes 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.
    • createProgramOffering

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

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

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

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

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

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

      boolean canManageProgramOfferingAliases()
      Tests if this user can manage Id aliases for ProgramOfferings . 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 ProgramOffering aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasProgramOffering

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