Interface CourseCatalogAdminSession

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

public interface CourseCatalogAdminSession extends OsidSession

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

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

The delete operations delete CourseCatalogs . It is safer to remove all mappings to the CourseCatalog catalogs before deletion.

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

  • Method Details

    • canCreateCourseCatalogs

      boolean canCreateCourseCatalogs()
      Tests if this user can create CourseCatalogs . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a CourseCatalog . will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
      Returns:
      false if CourseCatalog creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateCourseCatalogWithRecordTypes

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

      CourseCatalogForm getCourseCatalogFormForCreate(Type[] courseCatalogRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the course catalog form for creating new course catalogs. A new form should be requested for each create transaction.
      Parameters:
      courseCatalogRecordTypes - array of course catalog record types
      Returns:
      the course catalog form
      Throws:
      NullArgumentException - courseCatalogRecordTypes 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.
    • createCourseCatalog

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

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

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

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

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

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

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

      void aliasCourseCatalog(Id courseCatalogId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an Id to a CourseCatalog for the purpose of creating compatibility. The primary Id of the CourseCatalog 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 catalog, it is reassigned to the given course catalog Id .
      Parameters:
      courseCatalogId - the Id of a CourseCatalog
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - aliasId is in use as a primary Id
      NullArgumentException - courseCatalogId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.