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 record Type.

This method is used to retrieve an object implementing the requested record. The hierarchy_record_type may be the Type returned in get_record_types() or any of its parents in a Type hierarchy where has_record_type(hierarchy_record_type) is true .

Parameters:hierarchy_record_type (osid.type.Type) – the type of the record to retrieve
Returns:the hierarchy record
Return type:osid.hierarchy.records.HierarchyRecord
Raise:NullArgumenthierarchy_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(hierarchyrecord_type) is false

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 the HierarchyAdminSession. 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 record Type.

Parameters:hierarchy_record_type (osid.type.Type) – the hierarchy record type
Returns:the hierarchy form record
Return type:osid.hierarchy.records.HierarchyFormRecord
Raise:NullArgumenthierarchy_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(hierarchy_record_type) is false

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 accessing Id 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. The has_next() method should be used to test that a next Hierarchy is available before calling this method.
Return type:osid.hierarchy.Hierarchy
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: 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 of Hierarchy elements requested which must be less than or equal to available()
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 list
Raise:OperationFailed – unable to complete request

compliance: 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 accessing Id 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. The has_next() method should be used to test that a next Node is available before calling this method.
Return type:osid.hierarchy.Node
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: 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 of Node elements requested which must be less than or equal to available()
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 list
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.