Interface TermAdminSession

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

public interface TermAdminSession extends OsidSession

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

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

The delete operations delete Terms . To unmap a Term from the current CourseCatalog , the TermCourseCatalogAssignmentSession should be used. These delete operations attempt to remove the Term 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.
    • canCreateTerms

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

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

      TermForm getTermFormForCreate(Type[] termRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the term form for creating new terms. A new form should be requested for each create transaction.
      Parameters:
      termRecordTypes - array of term record types
      Returns:
      the term form
      Throws:
      NullArgumentException - termRecordTypes 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.
    • createTerm

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

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

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

      void updateTerm(TermForm termForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing term.
      Parameters:
      termForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - termForm already used in anjupdate transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - termId or termForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - termForm did not originate from getTermFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteTerms

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

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

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

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