Interface SyllabusAdminSession

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

public interface SyllabusAdminSession extends OsidSession

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

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

The delete operations delete Syllabi . To unmap a Syllabus from the current CourseCatalog , the SyllabusCourseCatalogAssignmentSession should be used. These delete operations attempt to remove the SyllabusForm 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.
    • canCreateSyllabi

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

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

      SyllabusForm getSyllabusFormForCreate(Id courseId, Type[] syllabusRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the syllabus form for creating new syllabi. A new form should be requested for each create transaction.
      Parameters:
      courseId - the Id for the course
      syllabusRecordTypes - array of syllabus record types
      Returns:
      the syllabus form
      Throws:
      NotFoundException - courseId is not found
      NullArgumentException - courseId or syllabusRecordTypes 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.
    • createSyllabus

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

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

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

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

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

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

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

      Adds an Id to a Syllabus for the purpose of creating compatibility. The primary Id of the Syllabus is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another syllabus, it is reassigned to the given syllabus Id .
      Parameters:
      syllabusId - the Id of a Syllabus
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - syllabusId not found
      NullArgumentException - syllabusId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.