public interface TodoHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of Todo
objects. Each todo in the hierarchy is a unique Todo.
The hierarchy may be traversed recursively to establish the tree
structure through getParentTodos()
and
getChildTodos().
To relate these Ids
to another
OSID, getTodoNodes()
can be used for retrievals that can be
used for bulk lookups in other OSIDs. Any Todo
available in
the Course 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 getParentTodos()
or getChildTodos()
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 |
canAccessTodoHierarchy()
Tests if this user can perform hierarchy queries.
|
IdList |
getChildTodoIds(Id todoId)
Gets the child
Ids of the given todo. |
TodoList |
getChildTodos(Id todoId)
Gets the children of the given todo.
|
IdList |
getParentTodoIds(Id todoId)
Gets the parent
Ids of the given todo. |
TodoList |
getParentTodos(Id todoId)
Gets the parents of the given todo.
|
IdList |
getRootTodoIds()
Gets the root todo
Ids in this hierarchy. |
TodoList |
getRootTodos()
Gets the root todos in the todo hierarchy.
|
Hierarchy |
getTodoHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getTodoHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getTodoNodeIds(Id todoId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given todo.
|
TodoNode |
getTodoNodes(Id todoId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given todo.
|
boolean |
hasChildTodos(Id todoId)
Tests if a todo has any children.
|
boolean |
hasParentTodos(Id todoId)
Tests if the
Todo has any parents. |
boolean |
isAncestorOfTodo(Id id,
Id todoId)
Tests if an
Id is an ancestor of a todo. |
boolean |
isChildOfTodo(Id id,
Id todoId)
Tests if a node is a direct child of another.
|
boolean |
isDescendantOfTodo(Id id,
Id todoId)
Tests if an
Id is a descendant of a todo. |
boolean |
isParentOfTodo(Id id,
Id todoId)
Tests if an
Id is a direct parent of todo. |
void |
useComparativeTodoView()
The returns from the todo methods may omit or translate elements based
on this session, such as authorization, and not result in an error.
|
void |
usePlenaryTodoView()
A complete view of the
Todos returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getTodoHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getTodoHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessTodoHierarchy()
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 useComparativeTodoView()
mandatory
- This method is must be implemented. void usePlenaryTodoView()
Todos
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 getRootTodoIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. TodoList getRootTodos() 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 hasParentTodos(Id todoId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Todo
has any parents.todoId
- a todo Id
true
if the todo has parents, false
otherwiseNotFoundException
- todoId
is not foundNullArgumentException
- todoId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfTodo(Id id, Id todoId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of todo.id
- an Id
todoId
- the Id
of a todo true
if this id
is a parent of
todoId,
false
otherwiseNotFoundException
- todoId
is not foundNullArgumentException
- id
or
todoId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentTodoIds(Id todoId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given todo.todoId
- a todo Id
Ids
of the todoNotFoundException
- todoId
is not foundNullArgumentException
- todoId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. TodoList getParentTodos(Id todoId) throws NotFoundException, OperationFailedException, PermissionDeniedException
todoId
- the Id
to queryNotFoundException
- todoId
not foundNullArgumentException
- todoId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfTodo(Id id, Id todoId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of a todo.id
- an Id
todoId
- the Id
of a todo true
if this id
is an ancestor
of todoId,
false
otherwiseNotFoundException
- todoId
not foundNullArgumentException
- id
or
todoId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildTodos(Id todoId) throws NotFoundException, OperationFailedException, PermissionDeniedException
todoId
- a todo Id
true
if the todoId
has children,
false
otherwiseNotFoundException
- todoId
not foundNullArgumentException
- todoId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfTodo(Id id, Id todoId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
todoId
- the Id
of a todo true
if the id
is a child of
todoId,
false
otherwiseNotFoundException
- todoId
not foundNullArgumentException
- todoId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildTodoIds(Id todoId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given todo.todoId
- a todo Id
Ids
of the todoNotFoundException
- todoId
is not foundNullArgumentException
- todoId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. TodoList getChildTodos(Id todoId) throws NotFoundException, OperationFailedException, PermissionDeniedException
todoId
- the Id
to queryNotFoundException
- todoId
not foundNullArgumentException
- todoId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfTodo(Id id, Id todoId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of a todo.id
- an Id
todoId
- the Id
of a todo true
if the id
is a descendant
of the todoId,
false
otherwiseNotFoundException
- todoId
not foundNullArgumentException
- todoId
or
id
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getTodoNodeIds(Id todoId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
todoId
- 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
- todoId
not foundNullArgumentException
- todoId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. TodoNode getTodoNodes(Id todoId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
todoId
- 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
- todoId
not foundNullArgumentException
- todoId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.