public interface ForumHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of Forum
objects. Each node in the hierarchy is a unique Forum.
The hierarchy may be traversed recursively to establish the tree
structure through getParentForums() and
getChildForums(). To relate these Ids to another
OSID, getForumNodes() can be used for retrievals that can
be used for bulk lookups in other OSIDs. Any Forum
available in the Reply OSID is known to this hierarchy but does not appear
in the hierarchy traversal until added as a root node or a child of
another node.
A user may not be authorized to traverse the entire hierarchy. Parts
of the hierarchy may be made invisible through omission from the returns
of getParentForums() or getChildForums() in
lieu of a PERMISSION_DENIED error that may disrupt the
traversal through authorized pathways.
This session defines views that offer differing behaviors when retrieving multiple objects.
| Modifier and Type | Method and Description |
|---|---|
boolean |
canAccessForumHierarchy()
Tests if this user can perform hierarchy queries.
|
IdList |
getChildForumIds(Id forumId)
Gets the child
Ids of the given forum. |
ForumList |
getChildForums(Id forumId)
Gets the child forums of the given
id. |
Hierarchy |
getForumHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getForumHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getForumNodeIds(Id forumId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given forum.
|
ForumNode |
getForumNodes(Id forumId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given forum.
|
IdList |
getParentForumIds(Id forumId)
Gets the parent
Ids of the given forum. |
ForumList |
getParentForums(Id forumId)
Gets the parent forums of the given
id. |
IdList |
getRootForumIds()
Gets the root forum
Ids in this hierarchy. |
ForumList |
getRootForums()
Gets the root forums in the forum hierarchy.
|
boolean |
hasChildForums(Id forumId)
Tests if a forum has any children.
|
boolean |
hasParentForums(Id forumId)
Tests if the
Forum has any parents. |
boolean |
isAncestorOfForum(Id id,
Id forumId)
Tests if an
Id is an ancestor of a forum. |
boolean |
isChildOfForum(Id id,
Id forumId)
Tests if a forum is a direct child of another.
|
boolean |
isDescendantOfForum(Id id,
Id forumId)
Tests if an
Id is a descendant of a forum. |
boolean |
isParentOfForum(Id id,
Id forumId)
Tests if an
Id is a direct parent of forum. |
void |
useComparativeForumView()
The returns from the forum methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryForumView()
A complete view of the
Forum returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getForumHierarchyId()
Id associated with this session. Id associated with this sessionmandatory - This method must be implemented. Hierarchy getForumHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canAccessForumHierarchy()
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer lookup operations. false if hierarchy traversal methods are not
authorized, true otherwisemandatory - This method must be implemented. void useComparativeForumView()
mandatory - This method is must be implemented. void usePlenaryForumView()
Forum returns is desired.
Methods will return what is requested or result in an error. This view
is used when greater precision is desired at the expense of
interoperability.mandatory - This method is must be implemented. IdList getRootForumIds() throws OperationFailedException, PermissionDeniedException
Ids in this hierarchy. Ids OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. ForumList getRootForums() throws OperationFailedException, PermissionDeniedException
Ids are known to the
hierarchy, an orphan does not appear in the hierarchy unless
explicitly added as a root node or child of another node.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method is must be implemented. boolean hasParentForums(Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Forum has any parents.forumId - a forum Id true if the forum has parents, f alse
otherwiseNotFoundException - forumId is not foundNullArgumentException - forumId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isParentOfForum(Id id, Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is a direct parent of forum.id - an Id forumId - the Id of a forum true if this id is a parent of
forumId, f alse otherwiseNotFoundException - forumId is not foundNullArgumentException - id or
forumId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. IdList getParentForumIds(Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids of the given forum.forumId - a forum Id Ids of the forumNotFoundException - forumId is not foundNullArgumentException - forumId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. ForumList getParentForums(Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id. forumId - the Id of the Forum to
query id NotFoundException - a Forum identified
by Id is not foundNullArgumentException - forumId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isAncestorOfForum(Id id, Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is an ancestor of a forum.id - an Id forumId - the Id of a forum tru e if this id is an ancestor
of forumId, false otherwiseNotFoundException - forumId is not foundNullArgumentException - id or
forumId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. boolean hasChildForums(Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException
forumId - a forum Id true if the forumId has
children, false otherwiseNotFoundException - forumId is not foundNullArgumentException - forumId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isChildOfForum(Id id, Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id - an Id forumId - the Id of a forum true if the id is a child of
forumId, false otherwiseNotFoundException - forumId is not foundNullArgumentException - id or
forumId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. IdList getChildForumIds(Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids of the given forum.forumId - the Id to queryNotFoundException - forumId is not foundNullArgumentException - forumId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. ForumList getChildForums(Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id. forumId - the Id of the Forum to
query id NotFoundException - a Forum identified
by Id is not foundNullArgumentException - forumId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isDescendantOfForum(Id id, Id forumId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is a descendant of a forum.id - an Id forumId - the Id of a forum true if the id is a descendant
of the forumId, false otherwiseNotFoundException - forumId is not foundNullArgumentException - id or
forumId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id is not found return false. Node getForumNodeIds(Id forumId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
forumId - the Id to queryancestorLevels - the maximum number of ancestor levels to
include. A value of 0 returns no parents in the node.descendantLevels - the maximum number of descendant levels to
include. A value of 0 returns no children in the node.includeSiblings - true to include the siblings of
the given node, false to omit the siblingsNotFoundException - forumId is not foundNullArgumentException - forumId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. ForumNode getForumNodes(Id forumId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
forumId - the Id to queryancestorLevels - the maximum number of ancestor levels to
include. A value of 0 returns no parents in the node.descendantLevels - the maximum number of descendant levels to
include. A value of 0 returns no children in the node.includeSiblings - true to include the siblings of
the given node, false to omit the siblingsNotFoundException - forumId is not foundNullArgumentException - forumId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.