Objects

Resource

class dlkit.resource.objects.Resource

Bases: dlkit.osid.objects.OsidObject

A Resource represents an arbitrary entity.

Resources are used to define an object to accompany an OSID Id used in other OSIDs. A resource may be used to represent a meeting room in the Scheduling OSID, or a student in the Course OSID.

A Resource may also represent a group or organization. A provider may present such a group in an opaque manner through a single resource definition, or the provider may expose the resource collection for examination or manipulation. If such a resource collection is visible, is_group() is true and can be used in one of the group sessions available in this OSID.

is_group()

Tests if this resource is a group.

A resource that is a group can be used in the group sessions.

Returns:true if this resource is a group, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

is_demographic()

Tests if this resource is a demographic.

A resource that is a demographic can be used in the demographic service and the group sessions.

Returns:true if this resource is a demographic, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

has_avatar()

Tests if this resource has an avatar.

Returns:true if this resource has an avatar, false otherwise
Return type:boolean

compliance: mandatory – This method must be implemented.

avatar_id

Gets the asset Id.

Returns:the asset Id
Return type:osid.id.Id
Raise:IllegalStatehas_avatar() is false

compliance: mandatory – This method must be implemented.

avatar

Gets the asset.

Returns:the asset
Return type:osid.repository.Asset
Raise:IllegalStatehas_avatar() is false
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

get_resource_record(resource_record_type)

Gets the resource record corresponding to the given Resource record Type.

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

Parameters:resource_record_type (osid.type.Type) – the resource record type
Returns:the resource record
Return type:osid.resource.records.ResourceRecord
Raise:NullArgumentresource_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(resource_record_type) is false

compliance: mandatory – This method must be implemented.

Resource Form

class dlkit.resource.objects.ResourceForm

Bases: dlkit.osid.objects.OsidObjectForm

This is the form for creating and updating Resources.

Like all OsidForm objects, various data elements may be set here for use in the create and update methods in the ResourceAdminSession. For each data element that may be set, metadata may be examined to provide display hints or data constraints.

Resources can be designated as a group. The group metadata indicates if it is possible to convert a resource to a group and vice-versa.

group_metadata

Gets the metadata for a group.

Returns:metadata for the group
Return type:osid.Metadata

compliance: mandatory – This method must be implemented.

group
avatar_metadata

Gets the metadata for an asset.

Returns:metadata for the asset
Return type:osid.Metadata

compliance: mandatory – This method must be implemented.

avatar
get_resource_form_record(resource_record_type)

Gets the ResourceFormRecord corresponding to the given Resource record Type.

Parameters:resource_record_type (osid.type.Type) – the resource record type
Returns:the resource form record
Return type:osid.resource.records.ResourceFormRecord
Raise:NullArgumentresource_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(resource_record_type) is false

compliance: mandatory – This method must be implemented.

Resource List

class dlkit.resource.objects.ResourceList

Bases: dlkit.osid.objects.OsidList

Like all OsidLists, ResourceList provides a means for accessing Resource elements sequentially either one at a time or many at a time.

Examples: while (rl.hasNext()) { Resource resource = rl.getNextResource(); }

or
while (rl.hasNext()) {
Resource[] resources = rl.getNextResources(rl.available());

}

next_resource

Gets the next Resource in this list.

Returns:the next Resource in this list. The has_next() method should be used to test that a next Resource is available before calling this method.
Return type:osid.resource.Resource
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

get_next_resources(n)

Gets the next set of Resources in this list which must be less than or equal to the return from available().

Parameters:n (cardinal) – the number of Resource elements requested which must be less than or equal to available()
Returns:an array of Resource elements.The length of the array is less than or equal to the number specified.
Return type:osid.resource.Resource
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

Resource Node

class dlkit.resource.objects.ResourceNode

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 BinHierarchySession.

resource

Gets the Resource at this node.

Returns:the resource represented by this node
Return type:osid.resource.Resource

compliance: mandatory – This method must be implemented.

parent_resource_nodes

Gets the parents of this resource.

Returns:the parents of the resource
Return type:osid.resource.ResourceNodeList

compliance: mandatory – This method must be implemented.

child_resource_nodes

Gets the children of this resource.

Returns:the children of this resource
Return type:osid.resource.ResourceNodeList

compliance: mandatory – This method must be implemented.

Resource Node List

class dlkit.resource.objects.ResourceNodeList

Bases: dlkit.osid.objects.OsidList

Like all OsidLists, ResourceNodeList provides a means for accessing ResourceNode elements sequentially either one at a time or many at a time.

Examples: while (rnl.hasNext()) { ResourceNode node = rnl.getNextResourceNode(); }

or
while rnl.hasNext()) {
ResourceNode[] nodes = rnl.getNextResourceNodes(rnl.available());

}

next_resource_node

Gets the next ResourceNode in this list.

Returns:the next ResourceNode in this list. The has_next() method should be used to test that a next ResourceNode is available before calling this method.
Return type:osid.resource.ResourceNode
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

get_next_resource_nodes(n)

Gets the next set of ResourceNode elements in this list which must be less than or equal to the return from available().

Parameters:n (cardinal) – the number of ResourceNode elements requested which must be less than or equal to available()
Returns:an array of ResourceNode elements.The length of the array is less than or equal to the number specified.
Return type:osid.resource.ResourceNode
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

Bin

class dlkit.resource.objects.Bin(abc_resource_objects.Bin, osid_objects.OsidCatalog)
:noindex:
get_bin_record(bin_record_type)

Gets the bin record corresponding to the given Bin record Type.

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

Parameters:bin_record_type (osid.type.Type) – the bin record type
Returns:the bin record
Return type:osid.resource.records.BinRecord
Raise:NullArgumentbin_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(bin_record_type) is false

compliance: mandatory – This method must be implemented.

Bin Form

class dlkit.resource.objects.BinForm

Bases: dlkit.osid.objects.OsidCatalogForm

This is the form for creating and updating bins.

Like all OsidForm objects, various data elements may be set here for use in the create and update methods in the BinAdminSession. For each data element that may be set, metadata may be examined to provide display hints or data constraints.

get_bin_form_record(bin_record_type)

Gets the BinFormRecord corresponding to the given bin record Type.

Parameters:bin_record_type (osid.type.Type) – the bin record type
Returns:the bin form record
Return type:osid.resource.records.BinFormRecord
Raise:NullArgumentbin_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(bin_record_type) is false

compliance: mandatory – This method must be implemented.

Bin List

class dlkit.resource.objects.BinList

Bases: dlkit.osid.objects.OsidList

Like all OsidLists, BinList provides a means for accessing Bin elements sequentially either one at a time or many at a time.

Examples: while (bl.hasNext()) { Bin bin = bl.getNextBin(); }

or
while (bl.hasNext()) {
Bin[] bins = bl.getNextBins(bl.available());

}

next_bin

Gets the next Bin in this list.

Returns:the next Bin in this list. The has_next() method should be used to test that a next Bin is available before calling this method.
Return type:osid.resource.Bin
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

get_next_bins(n)

Gets the next set of Bin elements in this list which must be less than or equal to the return from available().

Parameters:n (cardinal) – the number of Bin elements requested which must be less than or equal to available()
Returns:an array of Bin elements.The length of the array is less than or equal to the number specified.
Return type:osid.resource.Bin
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

Bin Node

class dlkit.resource.objects.BinNode

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 BinHierarchySession.

bin

Gets the Bin at this node.

Returns:the bin represented by this node
Return type:osid.resource.Bin

compliance: mandatory – This method must be implemented.

parent_bin_nodes

Gets the parents of this bin.

Returns:the parents of the id
Return type:osid.resource.BinNodeList

compliance: mandatory – This method must be implemented.

child_bin_nodes

Gets the children of this bin.

Returns:the children of this bin
Return type:osid.resource.BinNodeList

compliance: mandatory – This method must be implemented.

Bin Node List

class dlkit.resource.objects.BinNodeList

Bases: dlkit.osid.objects.OsidList

Like all OsidLists, BinNodeList provides a means for accessing BinNode elements sequentially either one at a time or many at a time.

Examples: while (bnl.hasNext()) { BinNode node = bnl.getNextBinNode(); }

or
while (bnl.hasNext()) {
BinNode[] nodes = bnl.getNextBinNodes(bnl.available());

}

next_bin_node

Gets the next BinNode in this list.

Returns:the next BinNode in this list. The has_next() method should be used to test that a next BinNode is available before calling this method.
Return type:osid.resource.BinNode
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.

get_next_bin_nodes(n)

Gets the next set of BinNode elements in this list which must be less than or equal to the return from available().

Parameters:n (cardinal) – the number of BinNode elements requested which must be less than or equal to available()
Returns:an array of BinNode elements.The length of the array is less than or equal to the number specified.
Return type:osid.resource.BinNode
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

compliance: mandatory – This method must be implemented.