Repository Open Service Interface Definitions repository version 3.0.0
The Repository OSID provides the service of finding and managing digital assets.
Assets
An Asset
represents a unit of content, whether it be an image, a
video, an application document or some text. The Asset defines a core
set of definitions applicable to digital content, such as copyright and
publisher, and allows for a type specification to be appended as with
other OsidObjects
.
Asset content, such as a document, is defined such that there may be multiple formats contained with the same asset. A document may be accessible in both PDF and MS Word, but is the same document, for example. An image may have both a large size and a thumbnail version. Generally, an asset contains more than one version of content when it is left to the application to decide which is most appropriate.
The Asset
Type
may define methods in common throughout the
content variations. An example asset is one whose content Types
are
“Quicktime” and “MPEG”, but the Asset
Type
is “movie” and
defines methods that describe the move aside from the formats. This
“double” Type hierarchy stemming from the asset requires more care in
defining interfaces.
Assets
also have “credits” which define the authors, editors,
creators, performers, producers or any other “role”, identified with a
role Type,
with the production of the asset. These are managed
externally to the asset through another OsidSession
.
Through additional optional OsidSessions,
the Asset
can be
“extended” to offer temporal information. An asset may pertain to a
date, a period of time, or a series of dates and periods. This mechanism
is to offer the ability to search for assets pertaining to a desired
date range without requiring understanding of a Type
.
Similarly, the Asset
can also map to spatial information. A
photograph may be “geotagged” with the GPS coordinates where it was
taken, a conical shape in stellar coordinates could be described for an
astronimocal image, or there may be a desire to may a historical book to
the spatial coordinates of Boston and Philadelphia. Unlike temporal
mappings, the definition of the spatial coordinate is left to a spatial
Type to define. The Repository OSID simply manages spatial mappings to
the Asset.
Asset Tagging
Assets
may also relate to Ontology OSID Subjects
. The
Subject
provides the ability to normalize information related to
subject matter across the Assets
to simplify management and provide
a more robust searching mechanism. For example, with a photograph of the
Empire State Building, one may wish to describe that it was designed by
Shreve, Lamb and Harmon and completed in 1931. The information about the
building itself can be described using a Subject
and related to the
photograph, and any other photograph that captures the building. The
Asset
Type
for the photograph may simply be “photograph” and
doesn’t attempt to describe a building, while the AssetContent
Type
is “image/jpeg”.
An application performing a search for Empire State Building can be
execute the search over the Subjects,
and once the user has narrowed
the subject area, then the related Assets can be retrieved, and from
there negotiate the content.
A provider wishing to construct a simple inventory database of buildings
in New York may decide to do so using the Resource OSID. The
Resource
Type
may describe the construction dates, height,
location, style and architects of buildings. The Type
may also
include a means of getting a reference image using the Asset
interface. Since there is no explicit relationship between Subject
and Resource,
the Resource
can be adapted to the Subject
interface (mapping a building_resource_type
to a
building_subject_type
) to use the same data for Subject
to
Asset
mappings and searching.
Asset Compositions
Asset compositions can be created using the Composition
interface. A
Composition
is a group of Assets
and compositions may be
structured into a hierarchy for the purpose of “building” larger
content. A content management system may make use of this interface to
construct a web page. The Composition
hierarchy may map into an
XHTML structure and each Asset
represent an image or a link in the
document. However, the produced web page at a given URL may be
represented by another single Asset
that whose content has both the
URL and the XHTML stream.
Another example is an IMS Common Cartridge. The Composition
may be
used to produce the zip file cartridge, but consumers may access the zip
file via an Asset
.
Repository Cataloging
Finally, Assets
and Compositions
may be categorized into
Repository
objects. A Repository
is a catalog-like interface to
help organize assets and subject matter. Repositories may be organized
into hierarchies for organization or federation purposes.
This number of service aspects to this Repository OSID produce a large
number of definitions. It is recommended to use the
RepositoryManager
definition to select a single OsidSession
of
interest, and work that definition through its dependencies before
tackling another aspect.
Sub Packages
The Repository OSID includes a rules subpackage for managing dynamic compositions.
Service Managers¶
Repository Profile¶
-
class
dlkit.services.repository.
RepositoryProfile
¶ Bases:
dlkit.osid.managers.OsidProfile
The repository profile describes interoperability among repository services.
-
supports_asset_lookup
()¶ Tests if asset lookup is supported.
Returns: true
if asset lookup is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_asset_query
()¶ Tests if asset query is supported.
Returns: true
if asset query is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_asset_search
()¶ Tests if asset search is supported.
Returns: true
if asset search is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_asset_admin
()¶ Tests if asset administration is supported.
Returns: true
if asset administration is supported,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_asset_notification
()¶ Tests if asset notification is supported.
A repository may send messages when assets are created, modified, or deleted.
Returns: true
if asset notification is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_asset_repository
()¶ Tests if retrieving mappings of assets and repositories is supported.
Returns: true
if asset repository mapping retrieval is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_asset_repository_assignment
()¶ Tests if managing mappings of assets and repositories is supported.
Returns: true
if asset repository assignment is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_asset_composition
()¶ Tests if assets are included in compositions.
Returns: true
if asset composition supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_asset_composition_design
()¶ Tests if mapping assets to compositions is supported.
Returns: true
if designing asset compositions is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_composition_lookup
()¶ Tests if composition lookup is supported.
Returns: true
if composition lookup is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_composition_query
()¶ Tests if composition query is supported.
Returns: true
if composition query is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_composition_search
()¶ Tests if composition search is supported.
Returns: true
if composition search is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_composition_admin
()¶ Tests if composition administration is supported.
Returns: true
if composition administration is supported,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_composition_repository
()¶ Tests if retrieval of composition to repository mappings is supported.
Returns: true
if composition to repository mapping is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_composition_repository_assignment
()¶ Tests if assigning composition to repository mappings is supported.
Returns: true
if composition to repository assignment is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_repository_lookup
()¶ Tests if repository lookup is supported.
Returns: true
if repository lookup is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_repository_query
()¶ Tests if repository query is supported.
Returns: true
if repository query is supported,
false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_repository_admin
()¶ Tests if repository administration is supported.
Returns: true
if repository administration is supported,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_repository_hierarchy
()¶ Tests if a repository hierarchy traversal is supported.
Returns: true
if a repository hierarchy traversal is supported,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
supports_repository_hierarchy_design
()¶ Tests if a repository hierarchy design is supported.
Returns: true
if a repository hierarchy design is supported,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
asset_record_types
¶ Gets all the asset record types supported.
Returns: the list of supported asset record types Return type: osid.type.TypeList
compliance: mandatory – This method must be implemented.
-
asset_search_record_types
¶ Gets all the asset search record types supported.
Returns: the list of supported asset search record types Return type: osid.type.TypeList
compliance: mandatory – This method must be implemented.
-
asset_content_record_types
¶ Gets all the asset content record types supported.
Returns: the list of supported asset content record types Return type: osid.type.TypeList
compliance: mandatory – This method must be implemented.
-
composition_record_types
¶ Gets all the composition record types supported.
Returns: the list of supported composition record types Return type: osid.type.TypeList
compliance: mandatory – This method must be implemented.
-
composition_search_record_types
¶ Gets all the composition search record types supported.
Returns: the list of supported composition search record types Return type: osid.type.TypeList
compliance: mandatory – This method must be implemented.
-
repository_record_types
¶ Gets all the repository record types supported.
Returns: the list of supported repository record types Return type: osid.type.TypeList
compliance: mandatory – This method must be implemented.
-
repository_search_record_types
¶ Gets all the repository search record types supported.
Returns: the list of supported repository search record types Return type: osid.type.TypeList
compliance: mandatory – This method must be implemented.
-
spatial_unit_record_types
¶ Gets all the spatial unit record types supported.
Returns: the list of supported spatial unit record types Return type: osid.type.TypeList
compliance: mandatory – This method must be implemented.
-
coordinate_types
¶ Gets all the coordinate types supported.
Returns: the list of supported coordinate types Return type: osid.type.TypeList
compliance: mandatory – This method must be implemented.
-
Repository Manager¶
-
class
dlkit.services.repository.
RepositoryManager
(proxy=None)¶ Bases:
dlkit.osid.managers.OsidManager
,dlkit.osid.sessions.OsidSession
,dlkit.services.repository.RepositoryProfile
The repository manager provides access to asset lookup and creation session and provides interoperability tests for various aspects of this service.
The sessions included in this manager are:
AssetLookupSession:
a session to retrieve assetsAssetQuerySession:
a session to query assetsAssetSearchSession:
a session to search for assetsAssetAdminSession:
a session to create and delete assetsAssetNotificationSession:
a session to receive notifications pertaining to asset changesAssetRepositorySession:
a session to look up asset to repository mappingsAssetRepositoryAssignmentSession:
a session to manage asset to repository mappingsAssetSmartRepositorySession:
a session to manage dynamic repositories of assetsAssetTemporalSession:
a session to access the temporal coverage of an assetAssetTemporalAssignmentSession:
a session to manage the temporal coverage of an assetAssetSpatialSession:
a session to access the spatial coverage of an assetAssetSpatialAssignmentSession:
a session to manage the spatial coverage of an assetAssetCompositionSession:
a session to look up asset composition mappingsAssetCompositionDesignSession:
a session to map assets to compositionsCompositionLookupSession: a
session to retrieve compositionsCompositionQuerySession:
a session to query compositionsCompositionSearchSession:
a session to search for compositionsCompositionAdminSession:
a session to create, update and delete compositionsCompositionNotificationSession:
a session to receive notifications pertaining to changes in compositionsCompositionRepositorySession:
a session to retrieve composition repository mappingsCompositionRepositoryAssignmentSession:
a session to manage composition repository mappingsCompositionSmartRepositorySession:
a session to manage dynamic repositories of compositionsRepositoryLookupSession: a
session to retrieve repositoriesRepositoryQuerySession:
a session to query repositoriesRepositorySearchSession:
a session to search for repositoriesRepositoryAdminSession:
a session to create, update and delete repositoriesRepositoryNotificationSession:
a session to receive notifications pertaining to changes in repositoriesRepositoryHierarchySession:
a session to traverse repository hierarchiesRepositoryHierarchyDesignSession:
a session to manage repository hierarchies
-
repository_batch_manager
¶ Gets a
RepositoryBatchManager
.Returns: a RepostoryBatchManager
Return type: osid.repository.batch.RepositoryBatchManager
Raise: OperationFailed
– unable to complete requestRaise: Unimplemented
–supports_repository_batch()
isfalse
compliance: optional – This method must be implemented if ``supports_repository_batch()`` is ``true``.
-
repository_rules_manager
¶ Gets a
RepositoryRulesManager
.Returns: a RepostoryRulesManager
Return type: osid.repository.rules.RepositoryRulesManager
Raise: OperationFailed
– unable to complete requestRaise: Unimplemented
–supports_repository_rules()
isfalse
compliance: optional – This method must be implemented if ``supports_repository_rules()`` is ``true``.
Repository Lookup Methods¶
RepositoryManager.
can_lookup_repositories
()¶Tests if this user can perform
Repository
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.
RepositoryManager.
use_comparative_repository_view
()¶The returns from the repository 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.
RepositoryManager.
use_plenary_repository_view
()¶A complete view of the
Repository
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.
RepositoryManager.
get_repository
(repository_id)¶Gets the
Repository
specified by itsId
.In plenary mode, the exact
Id
is found or aNotFound
results. Otherwise, the returnedRepository
may have a differentId
than requested, such as the case where a duplicateId
was assigned to aRepository
and retained for compatibility.
Parameters: repository_id ( osid.id.Id
) –Id
of theRepository
Returns: the repository Return type: osid.repository.Repository
Raise: NotFound
–repository_id
not foundRaise: NullArgument
–repository_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method is must be implemented.
RepositoryManager.
get_repositories_by_ids
(repository_ids)¶Gets a
RepositoryList
corresponding to the givenIdList
.In plenary mode, the returned list contains all of the repositories 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, inaccessibleRepositories
may be omitted from the list and may present the elements in any order including returning a unique set.
Parameters: repository_ids ( osid.id.IdList
) – the list ofIds
to retrieveReturns: the returned Repository list
Return type: osid.repository.RepositoryList
Raise: NotFound
– anId
was not foundRaise: NullArgument
–repository_ids
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
get_repositories_by_genus_type
(repository_genus_type)¶Gets a
RepositoryList
corresponding to the given repository genusType
which does not include repositories of types derived from the specifiedType
.In plenary mode, the returned list contains all known repositories or an error results. Otherwise, the returned list may contain only those repositories that are accessible through this session.
Parameters: repository_genus_type ( osid.type.Type
) – a repository genus typeReturns: the returned Repository list
Return type: osid.repository.RepositoryList
Raise: NullArgument
–repository_genus_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
get_repositories_by_parent_genus_type
(repository_genus_type)¶Gets a
RepositoryList
corresponding to the given repository genusType
and include any additional repositories with genus types derived from the specifiedType
.In plenary mode, the returned list contains all known repositories or an error results. Otherwise, the returned list may contain only those repositories that are accessible through this session.
Parameters: repository_genus_type ( osid.type.Type
) – a repository genus typeReturns: the returned Repository list
Return type: osid.repository.RepositoryList
Raise: NullArgument
–repository_genus_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
get_repositories_by_record_type
(repository_record_type)¶Gets a
RepositoryList
containing the given repository recordType
.In plenary mode, the returned list contains all known repositories or an error results. Otherwise, the returned list may contain only those repositories that are accessible through this session.
Parameters: repository_record_type ( osid.type.Type
) – a repository record typeReturns: the returned Repository list
Return type: osid.repository.RepositoryList
Raise: NullArgument
–repository_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
get_repositories_by_provider
(resource_id)¶Gets a
RepositoryList
from the given provider ````.In plenary mode, the returned list contains all known repositories or an error results. Otherwise, the returned list may contain only those repositories that are accessible through this session.
Parameters: resource_id ( osid.id.Id
) – a resourceId
Returns: the returned Repository list
Return type: osid.repository.RepositoryList
Raise: NullArgument
–resource_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
repositories
¶Gets all
Repositories
.In plenary mode, the returned list contains all known repositories or an error results. Otherwise, the returned list may contain only those repositories that are accessible through this session.
Returns: a list of Repositories
Return type: osid.repository.RepositoryList
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository Query Methods¶
RepositoryManager.
can_search_repositories
()¶Tests if this user can perform
Repository
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.
RepositoryManager.
repository_query
¶Gets a repository query.
Returns: the repository query Return type: osid.repository.RepositoryQuery
compliance: mandatory – This method must be implemented.
RepositoryManager.
get_repositories_by_query
(repository_query)¶Gets a list of
Repositories
matching the given repository query.
Parameters: repository_query ( osid.repository.RepositoryQuery
) – the repository queryReturns: the returned RepositoryList
Return type: osid.repository.RepositoryList
Raise: NullArgument
–repository_query
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–repository_query
is not of this servicecompliance: mandatory – This method must be implemented.
Repository Admin Methods¶
RepositoryManager.
can_create_repositories
()¶Tests if this user can create
Repositories
.A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a
Repository
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
ifRepository
creation is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
RepositoryManager.
can_create_repository_with_record_types
(repository_record_types)¶Tests if this user can create a single
Repository
using the desired record types.While
RepositoryManager.getRepositoryRecordTypes()
can be used to examine which records are supported, this method tests which record(s) are required for creating a specificRepository
. Providing an empty array tests if aRepository
can be created with no records.
Parameters: repository_record_types ( osid.type.Type[]
) – array of repository record typesReturns: true
ifRepository
creation using the specifiedTypes
is supported,false
otherwiseReturn type: boolean
Raise: NullArgument
–repository_record_types
isnull
compliance: mandatory – This method must be implemented.
RepositoryManager.
get_repository_form_for_create
(repository_record_types)¶Gets the repository form for creating new repositories.
A new form should be requested for each create transaction.
Parameters: repository_record_types ( osid.type.Type[]
) – array of repository record typesReturns: the repository form Return type: osid.repository.RepositoryForm
Raise: NullArgument
–repository_record_types
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
– unable to get form for requested record typescompliance: mandatory – This method must be implemented.
RepositoryManager.
create_repository
(repository_form)¶Creates a new
Repository
.
Parameters: repository_form ( osid.repository.RepositoryForm
) – the form for thisRepository
Returns: the new Repository
Return type: osid.repository.Repository
Raise: IllegalState
–repository_form
already used in a create transactionRaise: InvalidArgument
– one or more of the form elements is invalidRaise: NullArgument
–repository_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–repository_form
did not originate fromget_repository_form_for_create()
compliance: mandatory – This method must be implemented.
RepositoryManager.
can_update_repositories
()¶Tests if this user can update
Repositories
.A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a
Repository
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
ifRepository
modification is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
RepositoryManager.
get_repository_form_for_update
(repository_id)¶Gets the repository form for updating an existing repository.
A new repository form should be requested for each update transaction.
Parameters: repository_id ( osid.id.Id
) – theId
of theRepository
Returns: the repository form Return type: osid.repository.RepositoryForm
Raise: NotFound
–repository_id
is not foundRaise: NullArgument
–repository_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
update_repository
(repository_form)¶Updates an existing repository.
Parameters: repository_form ( osid.repository.RepositoryForm
) – the form containing the elements to be updatedRaise: IllegalState
–repository_form
already used in an update transactionRaise: InvalidArgument
– the form contains an invalid valueRaise: NullArgument
–repository_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–repository_form
did not originate fromget_repository_form_for_update()
compliance: mandatory – This method must be implemented.
RepositoryManager.
can_delete_repositories
()¶Tests if this user can delete
Repositories
.A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a
Repository
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
ifRepository
deletion is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
RepositoryManager.
delete_repository
(repository_id)¶Deletes a
Repository
.
Parameters: repository_id ( osid.id.Id
) – theId
of theRepository
to removeRaise: NotFound
–repository_id
not foundRaise: NullArgument
–repository_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
can_manage_repository_aliases
()¶Tests if this user can manage
Id
aliases for repositories.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
ifRepository
aliasing is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
RepositoryManager.
alias_repository
(repository_id, alias_id)¶Adds an
Id
to aRepository
for the purpose of creating compatibility.The primary
Id
of theRepository
is determined by the provider. The newId
is an alias to the primaryId
. If the alias is a pointer to another repository, it is reassigned to the given repositoryId
.
Parameters:
- repository_id (
osid.id.Id
) – theId
of aRepository
- alias_id (
osid.id.Id
) – the aliasId
Raise:
AlreadyExists
–alias_id
is in use as a primaryId
Raise:
NotFound
–repository_id
not foundRaise:
NullArgument
–repository_id
oralias_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository Hierarchy Methods¶
RepositoryManager.
repository_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.
RepositoryManager.
repository_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.
RepositoryManager.
can_access_repository_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 application that may opt not to offer lookup operations.
Returns: false
if hierarchy traversal methods are not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
RepositoryManager.
use_comparative_repository_view
()The returns from the repository 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.
RepositoryManager.
use_plenary_repository_view
()A complete view of the
Repository
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.
RepositoryManager.
root_repository_ids
¶Gets the root repository
Ids
in this hierarchy.
Returns: the root repository Ids
Return type: osid.id.IdList
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
root_repositories
¶Gets the root repositories in the repository hierarchy.
A node with no parents is an orphan. While all repository
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 repositories Return type: osid.repository.RepositoryList
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method is must be implemented.
RepositoryManager.
has_parent_repositories
(repository_id)¶Tests if the
Repository
has any parents.
Parameters: repository_id ( osid.id.Id
) – a repositoryId
Returns: true
if the repository has parents,false
otherwiseReturn type: boolean
Raise: NotFound
–repository_id
is not foundRaise: NullArgument
–repository_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
is_parent_of_repository
(id_, repository_id)¶Tests if an
Id
is a direct parent of a repository.
Parameters:
- id (
osid.id.Id
) – anId
- repository_id (
osid.id.Id
) – theId
of a repositoryReturns:
true
if thisid
is a parent ofrepository_id,
false
otherwiseReturn type:
boolean
Raise:
NotFound
–repository_id
is not foundRaise:
NullArgument
–id
orrepository_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented. implementation notes: If
id
not found returnfalse
.
RepositoryManager.
get_parent_repository_ids
(repository_id)¶Gets the parent
Ids
of the given repository.
Parameters: repository_id ( osid.id.Id
) – a repositoryId
Returns: the parent Ids
of the repositoryReturn type: osid.id.IdList
Raise: NotFound
–repository_id
is not foundRaise: NullArgument
–repository_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
get_parent_repositories
(repository_id)¶Gets the parents of the given repository.
Parameters: repository_id ( osid.id.Id
) – theId
to queryReturns: the parents of the repository Return type: osid.repository.RepositoryList
Raise: NotFound
–repository_id
not foundRaise: NullArgument
–repository_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
is_ancestor_of_repository
(id_, repository_id)¶Tests if an
Id
is an ancestor of a repository.
Parameters:
- id (
osid.id.Id
) – anId
- repository_id (
osid.id.Id
) – the Id of a repositoryReturns:
true
if thisid
is an ancestor ofrepository_id,
false
otherwiseReturn type:
boolean
Raise:
NotFound
–repository_id
not foundRaise:
NullArgument
–repository_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented. implementation notes: If
id
not found returnfalse
.
RepositoryManager.
has_child_repositories
(repository_id)¶Tests if a repository has any children.
Parameters: repository_id ( osid.id.Id
) – a repositoryId
Returns: true
if therepository_id
has children,false
otherwiseReturn type: boolean
Raise: NotFound
–repository_id
not foundRaise: NullArgument
–repository_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
is_child_of_repository
(id_, repository_id)¶Tests if a node is a direct child of another.
Parameters:
- id (
osid.id.Id
) – anId
- repository_id (
osid.id.Id
) – theId
of a repositoryReturns:
true
if theid
is a child ofrepository_id,
false
otherwiseReturn type:
boolean
Raise:
NotFound
–repository_id
not foundRaise:
NullArgument
–repository_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented. implementation notes: If
id
not found returnfalse
.
RepositoryManager.
get_child_repository_ids
(repository_id)¶Gets the
Ids
of the children of the given repository.
Parameters: repository_id ( osid.id.Id
) – theId
to queryReturns: the children of the repository Return type: osid.id.IdList
Raise: NotFound
–repository_id
not foundRaise: NullArgument
–repository_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
get_child_repositories
(repository_id)¶Gets the children of the given repository.
Parameters: repository_id ( osid.id.Id
) – theId
to queryReturns: the children of the repository Return type: osid.repository.RepositoryList
Raise: NotFound
–repository_id
not foundRaise: NullArgument
–repository_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
is_descendant_of_repository
(id_, repository_id)¶Tests if an
Id
is a descendant of a repository.
Parameters:
- id (
osid.id.Id
) – anId
- repository_id (
osid.id.Id
) – theId
of a repositoryReturns:
true
if theid
is a descendant of therepository_id,
false
otherwiseReturn type:
boolean
Raise:
NotFound
–repository_id
not foundRaise:
NullArgument
–repository_id
orid
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented. implementation notes: If
id
is not found returnfalse
.
RepositoryManager.
get_repository_node_ids
(repository_id, ancestor_levels, descendant_levels, include_siblings)¶Gets a portion of the hierarchy for the given repository.
Parameters:
- repository_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: the specified repository node
Return type:
osid.hierarchy.Node
Raise:
NotFound
–repository_id
not foundRaise:
NullArgument
–repository_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
get_repository_nodes
(repository_id, ancestor_levels, descendant_levels, include_siblings)¶Gets a portion of the hierarchy for the given repository.
Parameters:
- repository_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: the specified repository node
Return type:
osid.repository.RepositoryNode
Raise:
NotFound
–repository_id
not foundRaise:
NullArgument
–repository_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository Hierarchy Design Methods¶
RepositoryManager.
repository_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.
RepositoryManager.
repository_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.
RepositoryManager.
can_modify_repository_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.
RepositoryManager.
add_root_repository
(repository_id)¶Adds a root repository.
Parameters: repository_id ( osid.id.Id
) – theId
of a repositoryRaise: AlreadyExists
–repository_id
is already in hierarchyRaise: NotFound
–repository_id
not foundRaise: NullArgument
–repository_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
remove_root_repository
(repository_id)¶Removes a root repository.
Parameters: repository_id ( osid.id.Id
) – theId
of a repositoryRaise: NotFound
–repository_id
not a rootRaise: NullArgument
–repository_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
add_child_repository
(repository_id, child_id)¶Adds a child to a repository.
Parameters:
- repository_id (
osid.id.Id
) – theId
of a repository- child_id (
osid.id.Id
) – theId
of the new childRaise:
AlreadyExists
–repository_id
is already a parent ofchild_id
Raise:
NotFound
–repository_id
orchild_id
not foundRaise:
NullArgument
–repository_id
orchild_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
remove_child_repository
(repository_id, child_id)¶Removes a child from a repository.
Parameters:
- repository_id (
osid.id.Id
) – theId
of a repository- child_id (
osid.id.Id
) – theId
of the new childRaise:
NotFound
–repository_id
not a parent ofchild_id
Raise:
NullArgument
–repository_id
orchild_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
RepositoryManager.
remove_child_repositories
(repository_id)¶Removes all children from a repository.
Parameters: repository_id ( osid.id.Id
) – theId
of a repositoryRaise: NotFound
–repository_id
not in hierarchyRaise: NullArgument
–repository_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.