Interface CourseEntryAdminSession

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

public interface CourseEntryAdminSession extends OsidSession

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

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

The delete operations delete CourseEntries . To unmap a CourseEntry from the current CourseCatalog , the CourseEntryCourseCatalogAssignmentSession should be used. These delete operations attempt to remove the CourseEntry 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.
    • canCreateCourseEntries

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

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

      CourseEntryForm getCourseEntryFormForCreate(Id courseId, Id resourceId, Type[] courseEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the course entry form for creating new course entries. A new form should be requested for each create transaction.
      Parameters:
      courseId - a course Id
      resourceId - a program Id
      courseEntryRecordTypes - array of course entry record types
      Returns:
      the course entry form
      Throws:
      NotFoundException - courseId or resourceId is not found
      NullArgumentException - courseId, resourceId , or courseEntryRecordTypes 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.
    • createCourseEntry

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

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

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

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

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

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

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

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