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()
istrue
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
otherwiseReturn 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
otherwiseReturn 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
otherwiseReturn 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: IllegalState
–has_avatar()
isfalse
compliance: mandatory – This method must be implemented.
-
avatar
¶ Gets the asset.
Returns: the asset Return type: osid.repository.Asset
Raise: IllegalState
–has_avatar()
isfalse
Raise: OperationFailed
– unable to complete requestcompliance: mandatory – This method must be implemented.
-
get_resource_record
(resource_record_type)¶ Gets the resource record corresponding to the given
Resource
recordType
.This method is used to retrieve an object implementing the requested record. The
resource_record_type
may be theType
returned inget_record_types()
or any of its parents in aType
hierarchy wherehas_record_type(resource_record_type)
istrue
.Parameters: resource_record_type ( osid.type.Type
) – the resource record typeReturns: the resource record Return type: osid.resource.records.ResourceRecord
Raise: NullArgument
–resource_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(resource_record_type)
isfalse
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 theResourceAdminSession
. 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 givenResource
recordType
.Parameters: resource_record_type ( osid.type.Type
) – the resource record typeReturns: the resource form record Return type: osid.resource.records.ResourceFormRecord
Raise: NullArgument
–resource_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(resource_record_type)
isfalse
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 accessingResource
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. Thehas_next()
method should be used to test that a nextResource
is available before calling this method.Return type: osid.resource.Resource
Raise: IllegalState
– no more elements available in this listRaise: OperationFailed
– unable to complete requestcompliance: 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 fromavailable()
.Parameters: n ( cardinal
) – the number ofResource
elements requested which must be less than or equal toavailable()
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 listRaise: OperationFailed
– unable to complete requestcompliance: 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 accessingResourceNode
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. Thehas_next()
method should be used to test that a nextResourceNode
is available before calling this method.Return type: osid.resource.ResourceNode
Raise: IllegalState
– no more elements available in this listRaise: OperationFailed
– unable to complete requestcompliance: 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 fromavailable()
.Parameters: n ( cardinal
) – the number ofResourceNode
elements requested which must be less than or equal toavailable()
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 listRaise: OperationFailed
– unable to complete requestcompliance: 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
recordType
.This method is used to retrieve an object implementing the requested record. The
bin_record_type
may be theType
returned inget_record_types()
or any of its parents in aType
hierarchy wherehas_record_type(bin_record_type)
istrue
.Parameters: bin_record_type ( osid.type.Type
) – the bin record typeReturns: the bin record Return type: osid.resource.records.BinRecord
Raise: NullArgument
–bin_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(bin_record_type)
isfalse
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 theBinAdminSession
. 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 recordType
.Parameters: bin_record_type ( osid.type.Type
) – the bin record typeReturns: the bin form record Return type: osid.resource.records.BinFormRecord
Raise: NullArgument
–bin_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(bin_record_type)
isfalse
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 accessingBin
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. Thehas_next()
method should be used to test that a nextBin
is available before calling this method.Return type: osid.resource.Bin
Raise: IllegalState
– no more elements available in this listRaise: OperationFailed
– unable to complete requestcompliance: 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 fromavailable()
.Parameters: n ( cardinal
) – the number ofBin
elements requested which must be less than or equal toavailable()
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 listRaise: OperationFailed
– unable to complete requestcompliance: 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 accessingBinNode
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. Thehas_next()
method should be used to test that a nextBinNode
is available before calling this method.Return type: osid.resource.BinNode
Raise: IllegalState
– no more elements available in this listRaise: OperationFailed
– unable to complete requestcompliance: 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 fromavailable()
.Parameters: n ( cardinal
) – the number ofBinNode
elements requested which must be less than or equal toavailable()
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 listRaise: OperationFailed
– unable to complete requestcompliance: mandatory – This method must be implemented.