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.OsidProfileThe resource profile describes interoperability among resource services.
-
supports_resource_lookup()¶ Tests if resource lookup is supported.
Returns: trueif resource lookup is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_resource_query()¶ Tests if resource query is supported.
Returns: trueif resource query is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_resource_search()¶ Tests if resource search is supported.
Returns: trueif resource search is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_resource_admin()¶ Tests if resource administration is supported.
Returns: trueif resource administration is supported,falseotherwiseReturn type: booleancompliance: 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: trueif resource notification is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_resource_bin()¶ Tests if retrieving mappings of resource and bins is supported.
Returns: trueif resource bin mapping retrieval is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_resource_bin_assignment()¶ Tests if managing mappings of resource and bins is supported.
Returns: trueif resource bin assignment is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_resource_agent()¶ Tests if retrieving mappings of resource and agents is supported.
Returns: trueif resource agent mapping retrieval is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_resource_agent_assignment()¶ Tests if managing mappings of resources and agents is supported.
Returns: trueif resource agent assignment is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_bin_lookup()¶ Tests if bin lookup is supported.
Returns: trueif bin lookup is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_bin_query()¶ Tests if bin query is supported.
Returns: trueif bin query is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_bin_admin()¶ Tests if bin administration is supported.
Returns: trueif bin administration is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_bin_hierarchy()¶ Tests if a bin hierarchy traversal is supported.
Returns: trueif a bin hierarchy traversal is supported,falseotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
-
supports_bin_hierarchy_design()¶ Tests if a bin hierarchy design is supported.
Returns: trueif a bin hierarchy design is supported,falseotherwiseReturn type: booleancompliance: 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.TypeListcompliance: 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.TypeListcompliance: mandatory – This method must be implemented.
-
resource_relationship_record_types¶ Gets the supported
ResourceRelationshiprecord types.Returns: a list containing the supported ResourceRelationshiprecord typesReturn type: osid.type.TypeListcompliance: mandatory – This method must be implemented.
-
resource_relationship_search_record_types¶ Gets the supported
ResourceRelationshipsearch record types.Returns: a list containing the supported ResourceRelationshipsearch record typesReturn type: osid.type.TypeListcompliance: 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.TypeListcompliance: 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.TypeListcompliance: 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.ResourceProfileThe 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 retrieveResourceandAgentmappingsResourceAgentAssignmentSession:a session to manageResourceandAgentmappingsResourceRelationshipLookupSession: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: asession 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 ResourceBatchManagerReturn type: osid.resource.batch.ResourceBatchManagerRaise: OperationFailed– unable to complete requestRaise: Unimplemented–supports_resource_batch()isfalsecompliance: optional – This method must be implemented if ``supports_resource_batch()`` is ``true``.
-
resource_demographic_manager¶ Gets the
ResourceDemographicManager.Returns: a ResourceDemographicManagerReturn type: osid.resource.demographic.ResourceDemographicManagerRaise: OperationFailed– unable to complete requestRaise: Unimplemented–supports_resource_demographic()isfalsecompliance: 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
Binlookups.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: falseif lookup methods are not authorized,trueotherwiseReturn type: booleancompliance: 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
Binreturns 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
Binspecified by itsId.In plenary mode, the exact
Idis found or aNotFoundresults. Otherwise, the returnedBinmay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aBinand retained for compatibility.
Parameters: bin_id ( osid.id.Id) –Idof theBinReturns: the bin Return type: osid.resource.BinRaise: NotFound–bin_idnot foundRaise: NullArgument–bin_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method is must be implemented.
ResourceManager.get_bins_by_ids(bin_ids)¶Gets a
BinListcorresponding to the givenIdList.In plenary mode, the returned list contains all of the bins specified in the
Idlist, in the order of the list, including duplicates, or an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessibleBinsmay 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 ofIdsto retrieveReturns: the returned Bin listReturn type: osid.resource.BinListRaise: NotFound– anId wasnot foundRaise: NullArgument–bin_idsisnullRaise: 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
BinListcorresponding to the given bin genusTypewhich 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 listReturn type: osid.resource.BinListRaise: NullArgument–bin_genus_typeisnullRaise: 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
BinListcorresponding to the given bin genusTypeand 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 listReturn type: osid.resource.BinListRaise: NullArgument–bin_genus_typeisnullRaise: 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
BinListcontaining 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 listReturn type: osid.resource.BinListRaise: NullArgument–bin_record_typeisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
ResourceManager.get_bins_by_provider(resource_id)¶Gets a
BinListfrom 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 resourceIdReturns: the returned Bin listReturn type: osid.resource.BinListRaise: NullArgument–resource_idisnullRaise: 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 BinsReturn type: osid.resource.BinListRaise: 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
Binsearches.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: falseif search methods are not authorized,trueotherwiseReturn type: booleancompliance: 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.BinQuerycompliance: mandatory – This method must be implemented.
ResourceManager.get_bins_by_query(bin_query)¶Gets a list of
Binsmatching the given bin query.
Parameters: bin_query ( osid.resource.BinQuery) – the bin queryReturns: the returned BinListReturn type: osid.resource.BinListRaise: NullArgument–bin_queryisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported– abin_queryis 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
Binwill result in aPermissionDenied. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
Returns: falseifBincreation is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
ResourceManager.can_create_bin_with_record_types(bin_record_types)¶Tests if this user can create a single
Binusing 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 aBincan be created with no records.
Parameters: bin_record_types ( osid.type.Type[]) – array of bin record typesReturns: trueifBincreation using the specifiedTypesis supported,falseotherwiseReturn type: booleanRaise: NullArgument–bin_record_typesisnullcompliance: 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.BinFormRaise: NullArgument–bin_record_typesisnullRaise: 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 thisBinReturns: the new BinReturn type: osid.resource.BinRaise: IllegalState–bin_formalready used in a create transactionRaise: InvalidArgument– one or more of the form elements is invalidRaise: NullArgument–bin_formisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported–bin_formdid 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
Binwill result in aPermissionDenied. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
Returns: falseifBinmodification is not authorized,trueotherwiseReturn type: booleancompliance: 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) – theIdof theBinReturns: the bin form Return type: osid.resource.BinFormRaise: NotFound–bin_idis not foundRaise: NullArgument–bin_idisnullRaise: 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_formalready used in an update transactionRaise: InvalidArgument– the form contains an invalid valueRaise: NullArgument–bin_idorbin_formisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failureRaise: Unsupported–bin_formdid 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
Binwill result in aPermissionDenied. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.
Returns: falseifBindeletion is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
ResourceManager.delete_bin(bin_id)¶Deletes a
Bin.
Parameters: bin_id ( osid.id.Id) – theIdof theBinto removeRaise: NotFound–bin_idnot foundRaise: NullArgument–bin_idisnullRaise: 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
Idaliases 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: falseifBinaliasing is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
ResourceManager.alias_bin(bin_id, alias_id)¶Adds an
Idto aBinfor the purpose of creating compatibility.The primary
Idof theBinis determined by the provider. The newIdperforms 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) – theIdof aBin- alias_id (
osid.id.Id) – the aliasIdRaise:
AlreadyExists–alias_idis already assignedRaise:
NotFound–bin_idnot foundRaise:
NullArgument–bin_idoralias_idisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Bin Hierarchy Methods¶
ResourceManager.bin_hierarchy_id¶Gets the hierarchy
Idassociated with this session.
Returns: the hierarchy Idassociated with this sessionReturn type: osid.id.Idcompliance: 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.HierarchyRaise: 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: falseif hierarchy traversal methods are not authorized,trueotherwiseReturn type: booleancompliance: 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
Binreturns 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
Idsin this hierarchy.
Returns: the root bin IdsReturn type: osid.id.IdListRaise: 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
Idsare 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.BinListRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method is must be implemented.
ResourceManager.has_parent_bins(bin_id)¶Tests if the
Binhas any parents.
Parameters: bin_id ( osid.id.Id) – theIdof a binReturns: trueif the bin has parents,falseotherwiseReturn type: booleanRaise: NotFound–bin_idis not foundRaise: NullArgument–bin_idisnullRaise: 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
Idis a direct parent of a bin.
Parameters:
- id (
osid.id.Id) – anId- bin_id (
osid.id.Id) – theIdof a binReturns:
trueif thisidis a parent ofbin_id,falseotherwiseReturn type:
booleanRaise:
NotFound–bin_idis not foundRaise:
NullArgument–idorbin_idisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented. implementation notes: If
idnot found returnfalse.
ResourceManager.get_parent_bin_ids(bin_id)¶Gets the parent
Idsof the given bin.
Parameters: bin_id ( osid.id.Id) – theIdof a binReturns: the parent Idsof the binReturn type: osid.id.IdListRaise: NotFound–bin_idis not foundRaise: NullArgument–bin_idisnullRaise: 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) – theIdto queryReturns: the parents of the bin Return type: osid.resource.BinListRaise: NotFound–bin_idnot foundRaise: NullArgument–bin_idisnullRaise: 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
Idis an ancestor of a bin.
Parameters:
- id (
osid.id.Id) – anId- bin_id (
osid.id.Id) – theIdof a binReturns:
trueif thisidis an ancestor ofbin_id,falseotherwiseReturn type:
booleanRaise:
NotFound–bin_idis not foundRaise:
NullArgument–idorbin_idisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented. implementation notes: If
idnot found returnfalse.
ResourceManager.has_child_bins(bin_id)¶Tests if a bin has any children.
Parameters: bin_id ( osid.id.Id) – theIdof a binReturns: trueif thebin_idhas children,falseotherwiseReturn type: booleanRaise: NotFound–bin_idnot foundRaise: NullArgument–bin_idisnullRaise: 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) – theIdof a binReturns:
trueif theidis a child ofbin_id,falseotherwiseReturn type:
booleanRaise:
NotFound–bin_idis not foundRaise:
NullArgument–idorbin_idisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented. implementation notes: If
idnot found returnfalse.
ResourceManager.get_child_bin_ids(bin_id)¶Gets the child
Idsof the given bin.
Parameters: bin_id ( osid.id.Id) – theIdto queryReturns: the children of the bin Return type: osid.id.IdListRaise: NotFound–bin_idnot foundRaise: NullArgument–bin_idisnullRaise: 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) – theIdto queryReturns: the children of the bin Return type: osid.resource.BinListRaise: NotFound–bin_idnot foundRaise: NullArgument–bin_idisnullRaise: 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
Idis a descendant of a bin.
Parameters:
- id (
osid.id.Id) – anId- bin_id (
osid.id.Id) – theIdof a binReturns:
trueif theidis a descendant of thebin_id,falseotherwiseReturn type:
booleanRaise:
NotFound–bin_idis not foundRaise:
NullArgument–idorbin_idisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented. implementation notes: If
idis 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) – theIdto 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) –trueto include the siblings of the given node,falseto omit the siblingsReturns: a bin node
Return type:
osid.hierarchy.NodeRaise:
NotFound–bin_idnot foundRaise:
NullArgument–bin_idisnullRaise:
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) – theIdto 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) –trueto include the siblings of the given node,falseto omit the siblingsReturns: a bin node
Return type:
osid.resource.BinNodeRaise:
NotFound–bin_idnot foundRaise:
NullArgument–bin_idisnullRaise:
OperationFailed– unable to complete requestRaise:
PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.
Bin Hierarchy Design Methods¶
ResourceManager.bin_hierarchy_idGets the hierarchy
Idassociated with this session.
Returns: the hierarchy Idassociated with this sessionReturn type: osid.id.Idcompliance: mandatory – This method must be implemented.
ResourceManager.bin_hierarchyGets the hierarchy associated with this session.
Returns: the hierarchy associated with this session Return type: osid.hierarchy.HierarchyRaise: 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: falseif changing this hierarchy is not authorized,trueotherwiseReturn type: booleancompliance: mandatory – This method must be implemented.
ResourceManager.add_root_bin(bin_id)¶Adds a root bin.
Parameters: bin_id ( osid.id.Id) – theIdof a binRaise: AlreadyExists–bin_idis already in hierarchyRaise: NotFound–bin_idnot foundRaise: NullArgument–bin_idisnullRaise: 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) – theIdof a binRaise: NotFound–bin_idnot a rootRaise: NullArgument–bin_idisnullRaise: 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) – theIdof a bin- child_id (
osid.id.Id) – theIdof the new childRaise:
AlreadyExists–bin_idis already a parent ofchild_idRaise:
NotFound–bin_idorchild_idnot foundRaise:
NullArgument–bin_idorchild_idisnullRaise:
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) – theIdof a bin- child_id (
osid.id.Id) – theIdof the new childRaise:
NotFound–bin_idnot a parent ofchild_idRaise:
NullArgument–bin_idorchild_idisnullRaise:
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) – theIdof a binRaise: NotFound–bin_idnot in hierarchyRaise: NullArgument–bin_idisnullRaise: OperationFailed– unable to complete requestRaise: PermissionDenied– authorization failurecompliance: mandatory – This method must be implemented.