Objects¶
Hierarchy¶
-
class
dlkit.hierarchy.objects.
Hierarchy
(abc_hierarchy_objects.Hierarchy, osid_objects.OsidCatalog)¶ -
:noindex:
-
get_hierarchy_record
(hierarchy_record_type)¶ Gets the hierarchy record corresponding to the given
Hierarchy
recordType
.This method is used to retrieve an object implementing the requested record. The
hierarchy_record_type
may be theType
returned inget_record_types()
or any of its parents in aType
hierarchy wherehas_record_type(hierarchy_record_type)
istrue
.Parameters: hierarchy_record_type ( osid.type.Type
) – the type of the record to retrieveReturns: the hierarchy record Return type: osid.hierarchy.records.HierarchyRecord
Raise: NullArgument
–hierarchy_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(hierarchyrecord_type)
isfalse
compliance: mandatory – This method must be implemented.
-
Hierarchy Form¶
-
class
dlkit.hierarchy.objects.
HierarchyForm
¶ Bases:
dlkit.osid.objects.OsidCatalogForm
This is the form for creating and updating
Hierarchy
objects.Like all
OsidForm
objects, various data elements may be set here for use in the create and update methods in theHierarchyAdminSession
. For each data element that may be set, metadata may be examined to provide display hints or data constraints.-
get_hierarchy_form_record
(hierarchy_record_type)¶ Gets the
HierarchyFormRecord
corresponding to the given hierarchy recordType
.Parameters: hierarchy_record_type ( osid.type.Type
) – the hierarchy record typeReturns: the hierarchy form record Return type: osid.hierarchy.records.HierarchyFormRecord
Raise: NullArgument
–hierarchy_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(hierarchy_record_type)
isfalse
compliance: mandatory – This method must be implemented.
-
Hierarchy List¶
-
class
dlkit.hierarchy.objects.
HierarchyList
¶ Bases:
dlkit.osid.objects.OsidList
Like all
OsidLists,
HierarchyList
provides a means for accessingId
elements sequentially either one at a time or many at a time.Examples: while (hl.hasNext()) { Hierarchy hierarchy = hl.getNextHierarchy(); }
- or
- while (hl.hasNext()) {
- Hierarchy[] hierarchies = hl.getNextHierarchies(hl.available());
}
-
next_hierarchy
¶ Gets the next
Hierarchy
in this list.Returns: the next Hierarchy
in this list. Thehas_next()
method should be used to test that a nextHierarchy
is available before calling this method.Return type: osid.hierarchy.Hierarchy
Raise: IllegalState
– no more elements available in this listRaise: OperationFailed
– unable to complete requestcompliance: mandatory – This method must be implemented.
-
get_next_hierarchies
(n)¶ Gets the next set of
Hierarchy
objects in this list.The specified amount must be less than or equal to the return from
available()
.Parameters: n ( cardinal
) – the number ofHierarchy
elements requested which must be less than or equal toavailable()
Returns: an array of Hierarchy
elements.The length of the array is less than or equal to the number specified.Return type: osid.hierarchy.Hierarchy
Raise: IllegalState
– no more elements available in this listRaise: OperationFailed
– unable to complete requestcompliance: mandatory – This method must be implemented.
Node¶
-
class
dlkit.hierarchy.objects.
Node
¶ Bases:
dlkit.osid.objects.OsidNode
This interface is a container for a partial hierarchy retrieval.
The number of hierarchy levels traversable through this interface depend on the number of levels requested in the hierarchy traversal session.
-
parents
¶ Gets the parents of this node.
Returns: the parents of this node Return type: osid.hierarchy.NodeList
compliance: mandatory – This method must be implemented.
-
children
¶ Gets the children of this node.
Returns: the children of this node Return type: osid.hierarchy.NodeList
compliance: mandatory – This method must be implemented.
-
Node List¶
-
class
dlkit.hierarchy.objects.
NodeList
¶ Bases:
dlkit.osid.objects.OsidList
Like all
OsidLists,
NodeList
provides a means for accessingId
elements sequentially either one at a time or many at a time.Examples: while (nl.hasNext()) { Node node = nl.getNextNode(); }
- or
- while (nl.hasNext()) {
- Node[] nodes = nl.getNextNodes(nl.available());
}
-
next_node
¶ Gets the next
Node
in this list.Returns: the next Node
in this list. Thehas_next()
method should be used to test that a nextNode
is available before calling this method.Return type: osid.hierarchy.Node
Raise: IllegalState
– no more elements available in this listRaise: OperationFailed
– unable to complete requestcompliance: mandatory – This method must be implemented.
-
get_next_nodes
(n)¶ Gets the next set of
Node
objects in this list.The specified amount must be less than or equal to the return from
available()
.Parameters: n ( cardinal
) – the number ofNode
elements requested which must be less than or equal toavailable()
Returns: an array of Node
elements.The length of the array is less than or equal to the number specified.Return type: osid.hierarchy.Node
Raise: IllegalState
– no more elements available in this listRaise: OperationFailed
– unable to complete requestcompliance: mandatory – This method must be implemented.