Interface IdiomAdminSession

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

public interface IdiomAdminSession extends OsidSession

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

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

The delete operations delete Idioms . To unmap an Idiom from the current Press , the IdiomPressAssignmentSession should be used. These delete operations attempt to remove the Idiom itself thus removing it from all known Press catalogs.

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

  • Method Details

    • getPressId

      Id getPressId()
      Gets the Press Id associated with this session.
      Returns:
      the Press Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getPress

      Gets the Press associated with this session.
      Returns:
      the press
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateIdioms

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

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

      IdiomForm getIdiomFormForCreate(Id textId, Type[] idiomRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the idiom form for creating new idioms. A new form should be requested for each create transidiom.
      Parameters:
      textId - a text Id
      idiomRecordTypes - array of idiom record types
      Returns:
      the idiom form
      Throws:
      NotFoundException - textId is not found
      NullArgumentException - textId or idiomRecordTypes 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.
    • createIdiom

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

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

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

      void updateIdiom(IdiomForm idiomForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing idiom.
      Parameters:
      idiomForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - idiomForm already used in an update transidiom
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - idiomForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - idiomForm did not originate from getIdiomFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteIdioms

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

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

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

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