Interface PostForumAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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 Summary
Modifier and TypeMethodDescriptionvoidassignPostToForum(Id postId, Id forumId) Adds an existingPostto aForum.booleanTests if this user can alter post/forum mappings.booleancanAssignPostsToForum(Id forumId) Tests if this user can alter post/forum mappings.getAssignableForumIds(Id forumId) Gets a list of forums including and under the given forum node in which any post can be assigned.getAssignableForumIdsForPost(Id forumId, Id postId) Gets a list of forums including and under the given forum node in which a specific post can be assigned.voidreassignPostToForum(Id postId, Id fromForumId, Id toForumId) Moves aPostfrom oneForumto another.voidunassignPostFromForum(Id postId, Id forumId) Removes aPostfrom aForum.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignPostsToForum
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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Parameters:
forumId- theIdof theForum- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-forumIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableForumIds
Gets a list of forums including and under the given forum node in which any post can be assigned.- Parameters:
forumId- theIdof theForum- Returns:
- list of assignable forum
Ids - Throws:
NullArgumentException-forumIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableForumIdsForPost
Gets a list of forums including and under the given forum node in which a specific post can be assigned.- Parameters:
forumId- theIdof theForumpostId- theIdof thePost- Returns:
- list of assignable forum
Ids - Throws:
NullArgumentException-forumIdorpostIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignPostToForum
void assignPostToForum(Id postId, Id forumId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingPostto aForum.- Parameters:
postId- theIdof thePostforumId- theIdof theForum- Throws:
AlreadyExistsException-postIdis already assigned toforumIdNotFoundException-postIdorforumIdnot foundNullArgumentException-postIdorforumIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignPostFromForum
void unassignPostFromForum(Id postId, Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aPostfrom aForum.- Parameters:
postId- theIdof thePostforumId- theIdof theForum- Throws:
NotFoundException-postIdorforumIdnot found orpostIdnot assigned toforumIdNullArgumentException-postIdorforumIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignPostToForum
void reassignPostToForum(Id postId, Id fromForumId, Id toForumId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aPostfrom oneForumto another. Mappings to otherForumsare unaffected.- Parameters:
postId- theIdof thePostfromForumId- theIdof the currentForumtoForumId- theIdof the destinationForum- Throws:
AlreadyExistsException-postIdalready assigned totoForumIdNotFoundException-postId, fromForumId, ortoForumIdnot found orpostIdnot mapped tofromForumIdNullArgumentException-postId, fromForumId, ortoForumIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-