Resource Open Service Interface Definitions resource version 3.0.0
The Resource OSID defines a service to access and manage a directory of objects.
Resources
Resources
may represent people, places or a set or arbitrary
entities that are used throughout the OSIDs as references to indirect
objects. In core OSID, Resources
have no other meaning other than to
provide an identifier and a relation to an authentication principal.
Resource
Types
may define extra data to define an employee,
organizational unit or an inventory item.
Resources
are referenced throughout the OSIDs to and the abstraction
level of this service provides a consistent interface with which to
access and manage object references not directly pertinent to the
service in play. For example, a Repository OSID may reference
Resources
as authors or a Course OSID may reference Resources
for students and instructors. Each of these OSIDs may orchestrate a
Resource OSID to provide management of the set of referenced resources.
A Resource
genus Type may be used to provide a label the kind of
resource. This service offers the flexibility that the producer of a
film may be a person, a production company, or a fire hydrant. While
genus Types
may be used to constrain the kinds of Resources
that
may be related to various OsidObjects
if necessary ,
OSID
Consumers are expected to simply use the Resource as a reference. If an
OSID Consumer wishes to provide a mechanism for updating a Resource
referenced, the OSID Consumer should use an orchestrated Resource OSID.
Agents
A Resource
also provides the mapping between an authentication
Agent
and the entity on whose behalf the agent is acting. An
Agent
can only map to a single Resource
while a Resource
can
have multiple Agents
. An agent that represents the unix login of
“vijay” on server due.mit.edu can map to a Resource
representing
Vijay Kumar, who may also have a campus agent of “vkumar@mit.edu.”
Group
When a Resource
is referenced in another OSID, it is a singular
entity. To provide groupings of multiple people or things, a
Resource
can also be defined as a hierarchical group of other
resources. Whether a resource is a single entity or a group is an
attribute of the Resource
itself. If a Resource
is a group, then
its membership can be queried or managed in one of the group sessions.
This overloading of the object definition serves to keep the nature of
the resource separate from the other OSIDs such that a message to a
“group”, for example, is referenced as a single resource receipient.
Other OSIDs are blind to whether or not a referenced Resource
is a
group or a singular entity..
Resource Relationships
For kicks, Resources
may have arbitrrary relationships to other
Resources
using the ResourceRelationship
interface. Resource
relationships may also be used to provide a place to describe in more
detail, or hang data, on a member to group relationship.
Bin Cataloging
Resources
may be mapped into hierarchial Bins
for the purpose of
cataloging or federation.
Sub Packages
The Resource OSID includes a Resource Demographic OSID for managing
dynamically generated populations of Resources
and a Resource Batch
OSID for managing Resources
in bulk.
Service Managers¶
Resource Profile¶
-
class
dlkit.services.resource.
ResourceProfile
¶ Bases:
dlkit.osid.managers.OsidProfile
The resource profile describes interoperability among resource services.
-
supports_resource_lookup
()¶ Tests if resource lookup is supported.
Returns: true
if resource lookup is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_resource_query
()¶ Tests if resource query is supported.
Returns: true
if resource query is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_resource_search
()¶ Tests if resource search is supported.
Returns: true
if resource search is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_resource_admin
()¶ Tests if resource administration is supported.
Returns: true
if resource administration is supported,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_resource_notification
()¶ Tests if resource notification is supported.
Messages may be sent when resources are created, modified, or deleted.
Returns: true
if resource notification is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_resource_bin
()¶ Tests if retrieving mappings of resource and bins is supported.
Returns: true
if resource bin mapping retrieval is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_resource_bin_assignment
()¶ Tests if managing mappings of resource and bins is supported.
Returns: true
if resource bin assignment is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_resource_agent
()¶ Tests if retrieving mappings of resource and agents is supported.
Returns: true
if resource agent mapping retrieval is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_resource_agent_assignment
()¶ Tests if managing mappings of resources and agents is supported.
Returns: true
if resource agent assignment is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_bin_lookup
()¶ Tests if bin lookup is supported.
Returns: true
if bin lookup is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_bin_query
()¶ Tests if bin query is supported.
Returns: true
if bin query is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_bin_admin
()¶ Tests if bin administration is supported.
Returns: true
if bin administration is supported,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_bin_hierarchy
()¶ Tests if a bin hierarchy traversal is supported.
Returns: true
if a bin hierarchy traversal is supported,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_bin_hierarchy_design
()¶ Tests if a bin hierarchy design is supported.
Returns: true
if a bin hierarchy design is supported,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
resource_record_types
¶ Gets all the resource record types supported.
Returns: the list of supported resource record types Return type: osid.type.TypeList
compliance: mandatory – This method must be implemented.
-
resource_search_record_types
¶ Gets all the resource search record types supported.
Returns: the list of supported resource search record types Return type: osid.type.TypeList
compliance: mandatory – This method must be implemented.
-
resource_relationship_record_types
¶ Gets the supported
ResourceRelationship
record types.Returns: a list containing the supported ResourceRelationship
record typesReturn type: osid.type.TypeList
compliance: mandatory – This method must be implemented.
-
resource_relationship_search_record_types
¶ Gets the supported
ResourceRelationship
search record types.Returns: a list containing the supported ResourceRelationship
search record typesReturn type: osid.type.TypeList
compliance: mandatory – This method must be implemented.
-
bin_record_types
¶ Gets all the bin record types supported.
Returns: the list of supported bin record types Return type: osid.type.TypeList
compliance: mandatory – This method must be implemented.
-
bin_search_record_types
¶ Gets all the bin search record types supported.
Returns: the list of supported bin search record types Return type: osid.type.TypeList
compliance: mandatory – This method must be implemented.
-
Resource Manager¶
-
class
dlkit.services.resource.
ResourceManager
(proxy=None)¶ Bases:
dlkit.osid.managers.OsidManager
,dlkit.osid.sessions.OsidSession
,dlkit.services.resource.ResourceProfile
The resource manager provides access to resource lookup and creation sessions and provides interoperability tests for various aspects of this service.
The sessions included in this manager are:
ResourceLookupSession:
a session to retrieve resourcesResourceQuerySession:
a session to query resourcesResourceSearchSession:
a session to search for resourcesResourceAdminSession:
a session to create and delete resourcesResourceNotificationSession:
a session to receive notifications pertaining to resource changesResourceBinSession:
a session to look up resource to bin mappingsResourceBinAssignmentSession:
a session to manage resource to bin mappingsResourceSmartBinSession:
a session to manage smart resource binsMembershipSession:
a session to query membershipsGroupSession:
a session to retrieve group membershipsGroupAssignmentSession:
a session to manage groupsGroupNotificationSession:
a session to retrieve notifications on changes to group membershipGroupHierarchySession:
a session to view a group hierarchyRsourceAgentSession:
a session to retrieveResource
andAgent
mappingsResourceAgentAssignmentSession:
a session to manageResource
andAgent
mappingsResourceRelationshipLookupSession:
a session to retrieve resource relationshipsResourceRelationshipQuerySession:
a session to query for resource relationshipsResourceRelationshipSearchSession:
a session to search for resource relationshipsResourceRelationshipAdminSession:
a session to create and delete resource relationshipsResourceRelationshipNotificationSession:
a session to receive notifications pertaining to resource relationshipchangesResourceRelationshipBinSession:
a session to look up resource relationship to bin mappingsResourceRelationshipBinAssignmentSession:
a session to manage resource relationship to bin mappingsResourceRelationshipSmartBinSession:
a session to manage smart resource relationship binsBinLookupSession: a
session to retrieve binsBinQuerySession:
a session to query binsBinSearchSession:
a session to search for binsBinAdminSession:
a session to create, update and delete binsBinNotificationSession:
a session to receive notifications pertaining to changes in binsBinHierarchySession:
a session to traverse bin hierarchiesBinHierarchyDesignSession:
a session to manage bin hierarchies
-
resource_batch_manager
¶ Gets the
ResourceBatchManager
.Returns: a ResourceBatchManager
Return type: osid.resource.batch.ResourceBatchManager
Raise: OperationFailed
– unable to complete requestRaise: Unimplemented
–supports_resource_batch()
isfalse
compliance: optional – This method must be implemented if ``supports_resource_batch()`` is ``true``.
-
resource_demographic_manager
¶ Gets the
ResourceDemographicManager
.Returns: a ResourceDemographicManager
Return type: osid.resource.demographic.ResourceDemographicManager
Raise: OperationFailed
– unable to complete requestRaise: Unimplemented
–supports_resource_demographic()
isfalse
compliance: optional – This method must be implemented if ``supports_resource_demographic()`` is ``true``.
Bin Lookup Methods¶
ResourceManager.
can_lookup_bins
()¶Tests if this user can perform
Bin
lookups.A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a
PermissionDenied
. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.
Returns: false
if lookup methods are not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
ResourceManager.
use_comparative_bin_view
()¶The returns from the bin methods may omit or translate elements based on this session, such as authorization, and not result in an error.
This view is used when greater interoperability is desired at the expense of precision.
compliance: mandatory – This method is must be implemented.
ResourceManager.
use_plenary_bin_view
()¶A complete view of the
Bin
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.
compliance: mandatory – This method is must be implemented.
ResourceManager.
get_bin
(bin_id)¶Gets the
Bin
specified by itsId
.In plenary mode, the exact
Id
is found or aNotFound
results. Otherwise, the returnedBin
may have a differentId
than requested, such as the case where a duplicateId
was assigned to aBin
and retained for compatibility.
Parameters: bin_id ( osid.id.Id
) –Id
of theBin
Returns: the bin Return type: osid.resource.Bin
Raise: NotFound
–bin_id
not foundRaise: NullArgument
–bin_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method is must be implemented.
ResourceManager.
get_bins_by_ids
(bin_ids)¶Gets a
BinList
corresponding to the givenIdList
.In plenary mode, the returned list contains all of the bins specified in the
Id
list, in the order of the list, including duplicates, or an error results if anId
in the supplied list is not found or inaccessible. Otherwise, inaccessibleBins
may be omitted from the list and may present the elements in any order including returning a unique set.
Parameters: bin_ids ( osid.id.IdList
) – the list ofIds
to retrieveReturns: the returned Bin list
Return type: osid.resource.BinList
Raise: NotFound
– anId was
not foundRaise: NullArgument
–bin_ids
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
get_bins_by_genus_type
(bin_genus_type)¶Gets a
BinList
corresponding to the given bin genusType
which does not include bins of types derived from the specifiedType
.In plenary mode, the returned list contains all known bins or an error results. Otherwise, the returned list may contain only those bins that are accessible through this session.
Parameters: bin_genus_type ( osid.type.Type
) – a bin genus typeReturns: the returned Bin list
Return type: osid.resource.BinList
Raise: NullArgument
–bin_genus_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
get_bins_by_parent_genus_type
(bin_genus_type)¶Gets a
BinList
corresponding to the given bin genusType
and include any additional bins with genus types derived from the specifiedType
.In plenary mode, the returned list contains all known bins or an error results. Otherwise, the returned list may contain only those bins that are accessible through this session.
Parameters: bin_genus_type ( osid.type.Type
) – a bin genus typeReturns: the returned Bin list
Return type: osid.resource.BinList
Raise: NullArgument
–bin_genus_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
get_bins_by_record_type
(bin_record_type)¶Gets a
BinList
containing the given bin recordType
.In plenary mode, the returned list contains all known bins or an error results. Otherwise, the returned list may contain only those bins that are accessible through this session.
Parameters: bin_record_type ( osid.type.Type
) – a bin record typeReturns: the returned Bin list
Return type: osid.resource.BinList
Raise: NullArgument
–bin_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
get_bins_by_provider
(resource_id)¶Gets a
BinList
from the given provider.In plenary mode, the returned list contains all known bins or an error results. Otherwise, the returned list may contain only those bins that are accessible through this session.
Parameters: resource_id ( osid.id.Id
) – a resourceId
Returns: the returned Bin list
Return type: osid.resource.BinList
Raise: NullArgument
–resource_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
bins
¶Gets all
Bins
.In plenary mode, the returned list contains all known bins or an error results. Otherwise, the returned list may contain only those bins that are accessible through this session.
Returns: a list of Bins
Return type: osid.resource.BinList
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin Query Methods¶
ResourceManager.
can_search_bins
()¶Tests if this user can perform
Bin
searches.A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a
PermissionDenied
. This is intended as a hint to an application that may opt not to offer search operations to unauthorized users.
Returns: false
if search methods are not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
ResourceManager.
bin_query
¶Gets a bin query.
The returned query will not have an extension query.
Returns: the bin query Return type: osid.resource.BinQuery
compliance: mandatory – This method must be implemented.
ResourceManager.
get_bins_by_query
(bin_query)¶Gets a list of
Bins
matching the given bin query.
Parameters: bin_query ( osid.resource.BinQuery
) – the bin queryReturns: the returned BinList
Return type: osid.resource.BinList
Raise: NullArgument
–bin_query
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
– abin_query
is not of this servicecompliance: mandatory – This method must be implemented.
Bin Admin Methods¶
ResourceManager.
can_create_bins
()¶Tests if this user can create
Bins
.A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a
Bin
will result in aPermissionDenied
. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
Returns: false
ifBin
creation is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
ResourceManager.
can_create_bin_with_record_types
(bin_record_types)¶Tests if this user can create a single
Bin
using the desired record types.While
ResourceManager.getBinRecordTypes()
can be used to examine which records are supported, this method tests which record(s) are required for creating a specificBin
. Providing an empty array tests if aBin
can be created with no records.
Parameters: bin_record_types ( osid.type.Type[]
) – array of bin record typesReturns: true
ifBin
creation using the specifiedTypes
is supported,false
otherwiseReturn type: boolean
Raise: NullArgument
–bin_record_types
isnull
compliance: mandatory – This method must be implemented.
ResourceManager.
get_bin_form_for_create
(bin_record_types)¶Gets the bin form for creating new bins.
Parameters: bin_record_types ( osid.type.Type[]
) – array of bin record typesReturns: the bin form Return type: osid.resource.BinForm
Raise: NullArgument
–bin_record_types
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
– unable to get form with requested record typescompliance: mandatory – This method must be implemented.
ResourceManager.
create_bin
(bin_form)¶Creates a new
Bin
.
Parameters: bin_form ( osid.resource.BinForm
) – the form for thisBin
Returns: the new Bin
Return type: osid.resource.Bin
Raise: IllegalState
–bin_form
already used in a create transactionRaise: InvalidArgument
– one or more of the form elements is invalidRaise: NullArgument
–bin_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–bin_form
did not originate fromget_bin_form_for_create()
compliance: mandatory – This method must be implemented.
ResourceManager.
can_update_bins
()¶Tests if this user can update
Bins
.A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a
Bin
will result in aPermissionDenied
. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
Returns: false
ifBin
modification is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
ResourceManager.
get_bin_form_for_update
(bin_id)¶Gets the bin form for updating an existing bin.
A new bin form should be requested for each update transaction.
Parameters: bin_id ( osid.id.Id
) – theId
of theBin
Returns: the bin form Return type: osid.resource.BinForm
Raise: NotFound
–bin_id
is not foundRaise: NullArgument
–bin_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
update_bin
(bin_form)¶Updates an existing bin.
Parameters: bin_form ( osid.resource.BinForm
) – the form containing the elements to be updatedRaise: IllegalState
–bin_form
already used in an update transactionRaise: InvalidArgument
– the form contains an invalid valueRaise: NullArgument
–bin_id
orbin_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–bin_form
did not originate fromget_bin_form_for_update()
compliance: mandatory – This method must be implemented.
ResourceManager.
can_delete_bins
()¶Tests if this user can delete
Bins
.A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a
Bin
will result in aPermissionDenied
. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.
Returns: false
ifBin
deletion is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
ResourceManager.
delete_bin
(bin_id)¶Deletes a
Bin
.
Parameters: bin_id ( osid.id.Id
) – theId
of theBin
to removeRaise: NotFound
–bin_id
not foundRaise: NullArgument
–bin_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
can_manage_bin_aliases
()¶Tests if this user can manage
Id
aliases forBins
.A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a
PermissionDenied
. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
Returns: false
ifBin
aliasing is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
ResourceManager.
alias_bin
(bin_id, alias_id)¶Adds an
Id
to aBin
for the purpose of creating compatibility.The primary
Id
of theBin
is determined by the provider. The newId
performs as an alias to the primaryId
. If the alias is a pointer to another bin, it is reassigned to the given binId
.
Parameters:
- bin_id (
osid.id.Id
) – theId
of aBin
- alias_id (
osid.id.Id
) – the aliasId
Raise:
AlreadyExists
–alias_id
is already assignedRaise:
NotFound
–bin_id
not foundRaise:
NullArgument
–bin_id
oralias_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin Hierarchy Methods¶
ResourceManager.
bin_hierarchy_id
¶Gets the hierarchy
Id
associated with this session.
Returns: the hierarchy Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
ResourceManager.
bin_hierarchy
¶Gets the hierarchy associated with this session.
Returns: the hierarchy associated with this session Return type: osid.hierarchy.Hierarchy
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
can_access_bin_hierarchy
()¶Tests if this user can perform hierarchy queries.
A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a
PermissionDenied
. This is intended as a hint to an an application that may not offer traversal functions to unauthorized users.
Returns: false
if hierarchy traversal methods are not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
ResourceManager.
use_comparative_bin_view
()The returns from the bin methods may omit or translate elements based on this session, such as authorization, and not result in an error.
This view is used when greater interoperability is desired at the expense of precision.
compliance: mandatory – This method is must be implemented.
ResourceManager.
use_plenary_bin_view
()A complete view of the
Bin
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.
compliance: mandatory – This method is must be implemented.
ResourceManager.
root_bin_ids
¶Gets the root bin
Ids
in this hierarchy.
Returns: the root bin Ids
Return type: osid.id.IdList
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
root_bins
¶Gets the root bins in the bin hierarchy.
A node with no parents is an orphan. While all bin
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.
Returns: the root bins Return type: osid.resource.BinList
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method is must be implemented.
ResourceManager.
has_parent_bins
(bin_id)¶Tests if the
Bin
has any parents.
Parameters: bin_id ( osid.id.Id
) – theId
of a binReturns: true
if the bin has parents,false
otherwiseReturn type: boolean
Raise: NotFound
–bin_id
is not foundRaise: NullArgument
–bin_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
is_parent_of_bin
(id_, bin_id)¶Tests if an
Id
is a direct parent of a bin.
Parameters:
- id (
osid.id.Id
) – anId
- bin_id (
osid.id.Id
) – theId
of a binReturns:
true
if thisid
is a parent ofbin_id,
false
otherwiseReturn type:
boolean
Raise:
NotFound
–bin_id
is not foundRaise:
NullArgument
–id
orbin_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented. implementation notes: If
id
not found returnfalse
.
ResourceManager.
get_parent_bin_ids
(bin_id)¶Gets the parent
Ids
of the given bin.
Parameters: bin_id ( osid.id.Id
) – theId
of a binReturns: the parent Ids
of the binReturn type: osid.id.IdList
Raise: NotFound
–bin_id
is not foundRaise: NullArgument
–bin_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
get_parent_bins
(bin_id)¶Gets the parents of the given bin.
Parameters: bin_id ( osid.id.Id
) – theId
to queryReturns: the parents of the bin Return type: osid.resource.BinList
Raise: NotFound
–bin_id
not foundRaise: NullArgument
–bin_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
is_ancestor_of_bin
(id_, bin_id)¶Tests if an
Id
is an ancestor of a bin.
Parameters:
- id (
osid.id.Id
) – anId
- bin_id (
osid.id.Id
) – theId
of a binReturns:
true
if thisid
is an ancestor ofbin_id,
false
otherwiseReturn type:
boolean
Raise:
NotFound
–bin_id
is not foundRaise:
NullArgument
–id
orbin_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented. implementation notes: If
id
not found returnfalse
.
ResourceManager.
has_child_bins
(bin_id)¶Tests if a bin has any children.
Parameters: bin_id ( osid.id.Id
) – theId
of a binReturns: true
if thebin_id
has children,false
otherwiseReturn type: boolean
Raise: NotFound
–bin_id
not foundRaise: NullArgument
–bin_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
is_child_of_bin
(id_, bin_id)¶Tests if a bin is a direct child of another.
Parameters:
- id (
osid.id.Id
) – anId
- bin_id (
osid.id.Id
) – theId
of a binReturns:
true
if theid
is a child ofbin_id,
false
otherwiseReturn type:
boolean
Raise:
NotFound
–bin_id
is not foundRaise:
NullArgument
–id
orbin_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented. implementation notes: If
id
not found returnfalse
.
ResourceManager.
get_child_bin_ids
(bin_id)¶Gets the child
Ids
of the given bin.
Parameters: bin_id ( osid.id.Id
) – theId
to queryReturns: the children of the bin Return type: osid.id.IdList
Raise: NotFound
–bin_id
not foundRaise: NullArgument
–bin_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
get_child_bins
(bin_id)¶Gets the children of the given bin.
Parameters: bin_id ( osid.id.Id
) – theId
to queryReturns: the children of the bin Return type: osid.resource.BinList
Raise: NotFound
–bin_id
not foundRaise: NullArgument
–bin_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
is_descendant_of_bin
(id_, bin_id)¶Tests if an
Id
is a descendant of a bin.
Parameters:
- id (
osid.id.Id
) – anId
- bin_id (
osid.id.Id
) – theId
of a binReturns:
true
if theid
is a descendant of thebin_id,
false
otherwiseReturn type:
boolean
Raise:
NotFound
–bin_id
is not foundRaise:
NullArgument
–id
orbin_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented. implementation notes: If
id
is not found returnfalse
.
ResourceManager.
get_bin_node_ids
(bin_id, ancestor_levels, descendant_levels, include_siblings)¶Gets a portion of the hierarchy for the given bin.
Parameters:
- bin_id (
osid.id.Id
) – theId
to query- ancestor_levels (
cardinal
) – the maximum number of ancestor levels to include. A value of 0 returns no parents in the node.- descendant_levels (
cardinal
) – the maximum number of descendant levels to include. A value of 0 returns no children in the node.- include_siblings (
boolean
) –true
to include the siblings of the given node,false
to omit the siblingsReturns: a bin node
Return type:
osid.hierarchy.Node
Raise:
NotFound
–bin_id
not foundRaise:
NullArgument
–bin_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
get_bin_nodes
(bin_id, ancestor_levels, descendant_levels, include_siblings)¶Gets a portion of the hierarchy for the given bin.
Parameters:
- bin_id (
osid.id.Id
) – theId
to query- ancestor_levels (
cardinal
) – the maximum number of ancestor levels to include. A value of 0 returns no parents in the node.- descendant_levels (
cardinal
) – the maximum number of descendant levels to include. A value of 0 returns no children in the node.- include_siblings (
boolean
) –true
to include the siblings of the given node,false
to omit the siblingsReturns: a bin node
Return type:
osid.resource.BinNode
Raise:
NotFound
–bin_id
not foundRaise:
NullArgument
–bin_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Bin Hierarchy Design Methods¶
ResourceManager.
bin_hierarchy_id
Gets the hierarchy
Id
associated with this session.
Returns: the hierarchy Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
ResourceManager.
bin_hierarchy
Gets the hierarchy associated with this session.
Returns: the hierarchy associated with this session Return type: osid.hierarchy.Hierarchy
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
can_modify_bin_hierarchy
()¶Tests if this user can change the hierarchy.
A return of true does not guarantee successful authorization. A return of false indicates that it is known performing any update will result in a
PermissionDenied
. This is intended as a hint to an application that may opt not to offer these operations to an unauthorized user.
Returns: false
if changing this hierarchy is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
ResourceManager.
add_root_bin
(bin_id)¶Adds a root bin.
Parameters: bin_id ( osid.id.Id
) – theId
of a binRaise: AlreadyExists
–bin_id
is already in hierarchyRaise: NotFound
–bin_id
not foundRaise: NullArgument
–bin_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
remove_root_bin
(bin_id)¶Removes a root bin.
Parameters: bin_id ( osid.id.Id
) – theId
of a binRaise: NotFound
–bin_id
not a rootRaise: NullArgument
–bin_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
add_child_bin
(bin_id, child_id)¶Adds a child to a bin.
Parameters:
- bin_id (
osid.id.Id
) – theId
of a bin- child_id (
osid.id.Id
) – theId
of the new childRaise:
AlreadyExists
–bin_id
is already a parent ofchild_id
Raise:
NotFound
–bin_id
orchild_id
not foundRaise:
NullArgument
–bin_id
orchild_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
remove_child_bin
(bin_id, child_id)¶Removes a child from a bin.
Parameters:
- bin_id (
osid.id.Id
) – theId
of a bin- child_id (
osid.id.Id
) – theId
of the new childRaise:
NotFound
–bin_id
not a parent ofchild_id
Raise:
NullArgument
–bin_id
orchild_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.
remove_child_bins
(bin_id)¶Removes all children from a bin.
Parameters: bin_id ( osid.id.Id
) – theId
of a binRaise: NotFound
–bin_id
not in hierarchyRaise: NullArgument
–bin_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.