Interface ProgramAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
ProgramBatchAdminSession, ProgramOfferingBatchAdminSession

public interface ProgramAdminSession extends OsidSession

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

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

The delete operations delete Programs . To unmap a Program from the current CourseCatalog , the ProgramCourseCatalogAssignmentSession should be used. These delete operations attempt to remove the Program 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.
    • canCreatePrograms

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

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

      ProgramForm getProgramFormForCreate(Type[] programRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the program form for creating new programs. A new form should be requested for each create transaction.
      Parameters:
      programRecordTypes - array of program record types
      Returns:
      the program form
      Throws:
      NullArgumentException - programRecordTypes 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.
    • createProgram

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

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

      Gets the program form for updating an existing course. A new program form should be requested for each update transaction.
      Parameters:
      programId - the Id of the Program
      Returns:
      the program form
      Throws:
      NotFoundException - programId is not found
      NullArgumentException - programId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateProgram

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

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

      Deletes a Program .
      Parameters:
      programId - the Id of the Program to remove
      Throws:
      NotFoundException - programId not found
      NullArgumentException - programId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageProgramAliases

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

      Adds an Id to a Program 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, it is reassigned to the given program Id .
      Parameters:
      programId - the Id of a Program
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is in use as a primary Id
      NotFoundException - programId not found
      NullArgumentException - programId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.