Interface PostForumAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface PostForumAssignmentSession extends OsidSession

This session provides methods to re-assign Posts to Forums . A Post may map to multiple Forums and removing the last reference to a Post is the equivalent of deleting it. Each Forum may have its own authorizations governing who is allowed to operate on it.

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

  • Method Details

    • canAssignPosts

      boolean canAssignPosts()
      Tests if this user can alter post/forum 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 application that may opt not to offer assignment operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignPostsToForum

      boolean canAssignPostsToForum(Id forumId)
      Tests if this user can alter post/forum 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 application that may opt not to offer assignment operations to unauthorized users.
      Parameters:
      forumId - the Id of the Forum
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - forumId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableForumIds

      IdList getAssignableForumIds(Id forumId) throws OperationFailedException
      Gets a list of forums including and under the given forum node in which any post can be assigned.
      Parameters:
      forumId - the Id of the Forum
      Returns:
      list of assignable forum Ids
      Throws:
      NullArgumentException - forumId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableForumIdsForPost

      IdList getAssignableForumIdsForPost(Id forumId, Id postId) throws OperationFailedException
      Gets a list of forums including and under the given forum node in which a specific post can be assigned.
      Parameters:
      forumId - the Id of the Forum
      postId - the Id of the Post
      Returns:
      list of assignable forum Ids
      Throws:
      NullArgumentException - forumId or postId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignPostToForum

      Adds an existing Post to a Forum .
      Parameters:
      postId - the Id of the Post
      forumId - the Id of the Forum
      Throws:
      AlreadyExistsException - postId is already assigned to forumId
      NotFoundException - postId or forumId not found
      NullArgumentException - postId or forumId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignPostFromForum

      void unassignPostFromForum(Id postId, Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Post from a Forum .
      Parameters:
      postId - the Id of the Post
      forumId - the Id of the Forum
      Throws:
      NotFoundException - postId or forumId not found or postId not assigned to forumId
      NullArgumentException - postId or forumId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignPostToForum

      void reassignPostToForum(Id postId, Id fromForumId, Id toForumId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Post from one Forum to another. Mappings to other Forums are unaffected.
      Parameters:
      postId - the Id of the Post
      fromForumId - the Id of the current Forum
      toForumId - the Id of the destination Forum
      Throws:
      AlreadyExistsException - postId already assigned to toForumId
      NotFoundException - postId, fromForumId , or toForumId not found or postId not mapped to fromForumId
      NullArgumentException - postId, fromForumId , or toForumId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.