Interface TextPressAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface TextPressAssignmentSession extends OsidSession

This session provides methods to re-assign Texts to Press mappings. A Text may appear in multiple Press objects and removing the last reference to a Text is the equivalent of deleting it. Each Press may have its own authorizations governing who is allowed to operate on it.

Adding a reference of a Text to another Press is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignTexts

      boolean canAssignTexts()
      Tests if this user can alter text/press mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an press that may opt not to offer assignment operations to unauthorized users.
      Returns:
      false if lexicon is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignTextsToPress

      boolean canAssignTextsToPress(Id pressId)
      Tests if this user can alter text/press mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an press that may opt not to offer assignment operations to unauthorized users.
      Parameters:
      pressId - the Id of the Press
      Returns:
      false if lexicon is not authorized, true otherwise
      Throws:
      NullArgumentException - pressId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignablePressIds

      IdList getAssignablePressIds(Id pressId) throws OperationFailedException
      Gets a list of presses including and under the given press node in which any text can be assigned.
      Parameters:
      pressId - the Id of the Press
      Returns:
      list of assignable press Ids
      Throws:
      NullArgumentException - pressId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignablePressIdsForText

      IdList getAssignablePressIdsForText(Id pressId, Id textId) throws OperationFailedException
      Gets a list of presses including and under the given press node in which a specific text can be assigned.
      Parameters:
      pressId - the Id of the Press
      textId - the Id of the Text
      Returns:
      list of assignable press Ids
      Throws:
      NullArgumentException - pressId or textId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignTextToPress

      Adds an existing Text to a Press .
      Parameters:
      textId - the Id of the Text
      pressId - the Id of the Press
      Throws:
      AlreadyExistsException - textId is slready assigned to pressId
      NotFoundException - textId or pressId not found
      NullArgumentException - textId or pressId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignTextFromPress

      void unassignTextFromPress(Id textId, Id pressId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Text from a Press .
      Parameters:
      textId - the Id of the Text
      pressId - the Id of the Press
      Throws:
      NotFoundException - textId or pressId not found or textId not assigned to pressId
      NullArgumentException - textId or pressId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignTextToPress

      void reassignTextToPress(Id textId, Id fromPressId, Id toPressId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Text from one Press to another. Mappings to other Presses are unaffected.
      Parameters:
      textId - the Id of the Text
      fromPressId - the Id of the current Press
      toPressId - the Id of the destination Press
      Throws:
      NotFoundException - textId, fromPressId , or toPressId not found or textId not mapped to fromPressId
      NullArgumentException - textId, fromPressId , or toPressId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.