Repository¶
Repository¶
-
class
dlkit.services.repository.
Repository
(provider_manager, catalog, runtime, proxy, **kwargs)¶ Bases:
dlkit.osid.objects.OsidCatalog
,dlkit.osid.sessions.OsidSession
A repository defines a collection of assets.
-
get_repository_record
(repository_record_type)¶ Gets the record corresponding to the given
Repository
recordType
.This method is used to retrieve an object implementing the requested record. The
repository_record_type
may be theType
returned inget_record_types()
or any of its parents in aType
hierarchy wherehas_record_type(repository_record_type)
istrue
.Parameters: repository_record_type ( osid.type.Type
) – a repository record typeReturns: the repository record Return type: osid.repository.records.RepositoryRecord
Raise: NullArgument
–repository_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(repository_record_type)
isfalse
compliance: mandatory – This method must be implemented.
-
Asset Lookup Methods¶
Repository.
repository_id
¶Gets the
Repository
Id
associated with this session.
Returns: the Repository Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
Repository.
repository
¶Gets the
Repository
associated with this session.
Returns: the Repository
associated with this sessionReturn type: osid.repository.Repository
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
can_lookup_assets
()¶Tests if this user can perform
Asset
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.
Returns: false
if lookup methods are not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
use_comparative_asset_view
()¶The returns from the lookup 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.
Repository.
use_plenary_asset_view
()¶A complete view of the
Asset
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.
Repository.
use_federated_repository_view
()¶Federates the view for methods in this session.
A federated view will include compositions in repositories which are children of this repository in the repository hierarchy.
compliance: mandatory – This method is must be implemented.
Repository.
use_isolated_repository_view
()¶Isolates the view for methods in this session.
An isolated view restricts lookups to this repository only.
compliance: mandatory – This method is must be implemented.
Repository.
get_asset
(asset_id)¶Gets the
Asset
specified by itsId
.In plenary mode, the exact
Id
is found or aNotFound
results. Otherwise, the returnedAsset
may have a differentId
than requested, such as the case where a duplicateId
was assigned to anAsset
and retained for compatibility.
Parameters: asset_id ( osid.id.Id
) – theId
of theAsset
to retrieveReturns: the returned Asset
Return type: osid.repository.Asset
Raise: NotFound
– noAsset
found with the givenId
Raise: NullArgument
–asset_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
get_assets_by_ids
(asset_ids)¶Gets an
AssetList
corresponding to the givenIdList
.In plenary mode, the returned list contains all of the assets 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, inaccessibleAssets
may be omitted from the list and may present the elements in any order including returning a unique set.
Parameters: asset_ids ( osid.id.IdList
) – the list ofIds
to retrieveReturns: the returned Asset list
Return type: osid.repository.AssetList
Raise: NotFound
– anId
was not foundRaise: NullArgument
–asset_ids
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
get_assets_by_genus_type
(asset_genus_type)¶Gets an
AssetList
corresponding to the given asset genusType
which does not include assets of types derived from the specifiedType
.In plenary mode, the returned list contains all known assets or an error results. Otherwise, the returned list may contain only those assets that are accessible through this session.
Parameters: asset_genus_type ( osid.type.Type
) – an asset genus typeReturns: the returned Asset list
Return type: osid.repository.AssetList
Raise: NullArgument
–asset_genus_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
get_assets_by_parent_genus_type
(asset_genus_type)¶Gets an
AssetList
corresponding to the given asset genusType
and include any additional assets with genus types derived from the specifiedType
.In plenary mode, the returned list contains all known assets or an error results. Otherwise, the returned list may contain only those assets that are accessible through this session.
Parameters: asset_genus_type ( osid.type.Type
) – an asset genus typeReturns: the returned Asset list
Return type: osid.repository.AssetList
Raise: NullArgument
–asset_genus_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
get_assets_by_record_type
(asset_record_type)¶Gets an
AssetList
containing the given asset recordType
.In plenary mode, the returned list contains all known assets or an error results. Otherwise, the returned list may contain only those assets that are accessible through this session.
Parameters: asset_record_type ( osid.type.Type
) – an asset record typeReturns: the returned Asset list
Return type: osid.repository.AssetList
Raise: NullArgument
–asset_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
get_assets_by_provider
(resource_id)¶Gets an
AssetList
from the given provider.In plenary mode, the returned list contains all known assets or an error results. Otherwise, the returned list may contain only those assets that are accessible through this session.
Parameters: resource_id ( osid.id.Id
) – a resourceId
Returns: the returned Asset list
Return type: osid.repository.AssetList
Raise: NullArgument
–resource_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
assets
¶Gets all
Assets
.In plenary mode, the returned list contains all known assets or an error results. Otherwise, the returned list may contain only those assets that are accessible through this session.
Returns: a list of Assets
Return type: osid.repository.AssetList
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Asset Query Methods¶
Repository.
repository_id
Gets the
Repository
Id
associated with this session.
Returns: the Repository Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
Repository.
repository
Gets the
Repository
associated with this session.
Returns: the Repository
associated with this sessionReturn type: osid.repository.Repository
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
can_search_assets
()¶Tests if this user can perform
Asset
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.
Repository.
use_federated_repository_view
()Federates the view for methods in this session.
A federated view will include compositions in repositories which are children of this repository in the repository hierarchy.
compliance: mandatory – This method is must be implemented.
Repository.
use_isolated_repository_view
()Isolates the view for methods in this session.
An isolated view restricts lookups to this repository only.
compliance: mandatory – This method is must be implemented.
Repository.
asset_query
¶Gets an asset query.
Returns: the asset query Return type: osid.repository.AssetQuery
compliance: mandatory – This method must be implemented.
Repository.
get_assets_by_query
(asset_query)¶Gets a list of
Assets
matching the given asset query.
Parameters: asset_query ( osid.repository.AssetQuery
) – the asset queryReturns: the returned AssetList
Return type: osid.repository.AssetList
Raise: NullArgument
–asset_query
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
– theasset_query
is not of this servicecompliance: mandatory – This method must be implemented.
Asset Search Methods¶
Repository.
asset_search
¶Gets an asset search.
Returns: the asset search Return type: osid.repository.AssetSearch
compliance: mandatory – This method must be implemented.
Repository.
asset_search_order
¶Gets an asset search order.
The
AssetSearchOrder
is supplied to anAssetSearch
to specify the ordering of results.
Returns: the asset search order Return type: osid.repository.AssetSearchOrder
compliance: mandatory – This method must be implemented.
Repository.
get_assets_by_search
(asset_query, asset_search)¶Gets the search results matching the given search query using the given search.
Parameters:
- asset_query (
osid.repository.AssetQuery
) – the asset query- asset_search (
osid.repository.AssetSearch
) – the asset searchReturns: the asset search results
Return type:
osid.repository.AssetSearchResults
Raise:
NullArgument
–asset_query
orasset_search
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failureRaise:
Unsupported
–asset_query
orasset_search
is not of this servicecompliance: mandatory – This method must be implemented.
Repository.
get_asset_query_from_inspector
(asset_query_inspector)¶Gets an asset query from an inspector.
The inspector is available from a
AssetSearchResults
.
Parameters: asset_query_inspector ( osid.repository.AssetQueryInspector
) – an asset query inspectorReturns: the asset query Return type: osid.repository.AssetQuery
Raise: NullArgument
–asset_query_inspector
isnull
Raise: Unsupported
–asset_query_inspector
is not of this servicecompliance: mandatory – This method must be implemented.
Asset Admin Methods¶
Repository.
repository_id
Gets the
Repository
Id
associated with this session.
Returns: the Repository Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
Repository.
repository
Gets the
Repository
associated with this session.
Returns: the Repository
associated with this sessionReturn type: osid.repository.Repository
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
can_create_assets
()¶Tests if this user can create
Assets
.A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an
Asset
will result in aPermissionDenied
. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
Returns: false
ifAsset
creation is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
can_create_asset_with_record_types
(asset_record_types)¶Tests if this user can create a single
Asset
using the desired record types.While
RepositoryManager.getAssetRecordTypes()
can be used to examine which records are supported, this method tests which record(s) are required for creating a specificAsset
. Providing an empty array tests if anAsset
can be created with no records.
Parameters: asset_record_types ( osid.type.Type[]
) – array of asset record typesReturns: true
ifAsset
creation using the specified recordTypes
is supported,false
otherwiseReturn type: boolean
Raise: NullArgument
–asset_record_types
isnull
compliance: mandatory – This method must be implemented.
Repository.
get_asset_form_for_create
(asset_record_types)¶Gets the asset form for creating new assets.
A new form should be requested for each create transaction.
Parameters: asset_record_types ( osid.type.Type[]
) – array of asset record typesReturns: the asset form Return type: osid.repository.AssetForm
Raise: NullArgument
–asset_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.
Repository.
create_asset
(asset_form)¶Creates a new
Asset
.
Parameters: asset_form ( osid.repository.AssetForm
) – the form for thisAsset
Returns: the new Asset
Return type: osid.repository.Asset
Raise: IllegalState
–asset_form
already used in a create transactionRaise: InvalidArgument
– one or more of the form elements is invalidRaise: NullArgument
–asset_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–asset_form
did not originate fromget_asset_form_for_create()
compliance: mandatory – This method must be implemented.
Repository.
can_update_assets
()¶Tests if this user can update
Assets
.A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an
Asset
will result in aPermissionDenied
. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
Returns: false
ifAsset
modification is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
get_asset_form_for_update
(asset_id)¶Gets the asset form for updating an existing asset.
A new asset form should be requested for each update transaction.
Parameters: asset_id ( osid.id.Id
) – theId
of theAsset
Returns: the asset form Return type: osid.repository.AssetForm
Raise: NotFound
–asset_id
is not foundRaise: NullArgument
–asset_id
is nullRaise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
update_asset
(asset_form)¶Updates an existing asset.
Parameters: asset_form ( osid.repository.AssetForm
) – the form containing the elements to be updatedRaise: IllegalState
–asset_form
already used in anupdate transactionRaise: InvalidArgument
– the form contains an invalid valueRaise: NullArgument
–asset_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–asset_form
did not originate fromget_asset_form_for_update()
compliance: mandatory – This method must be implemented.
Repository.
can_delete_assets
()¶Tests if this user can delete
Assets
.A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an
Asset
will result in aPermissionDenied
. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
Returns: false
ifAsset
deletion is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
delete_asset
(asset_id)¶Deletes an
Asset
.
Parameters: asset_id ( osid.id.Id
) – theId
of theAsset
to removeRaise: NotFound
–asset_id
not foundRaise: NullArgument
–asset_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
can_manage_asset_aliases
()¶Tests if this user can manage
Id
aliases forAssets
.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
ifAsset
aliasing is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
alias_asset
(asset_id, alias_id)¶Adds an
Id
to anAsset
for the purpose of creating compatibility.The primary
Id
of theAsset
is determined by the provider. The newId
performs as an alias to the primaryId
. If the alias is a pointer to another asset, it is reassigned to the given assetId
.
Parameters:
- asset_id (
osid.id.Id
) – theId
of anAsset
- alias_id (
osid.id.Id
) – the aliasId
Raise:
AlreadyExists
–alias_id
is already assignedRaise:
NotFound
–asset_id
not foundRaise:
NullArgument
–asset_id
oralias_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
can_create_asset_content
()¶Tests if this user can create content for
Assets
.A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an
AssetContent
will result in aPermissionDenied
. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
Returns: false
ifAsset
content creation is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
can_create_asset_content_with_record_types
(asset_content_record_types)¶Tests if this user can create an
AssetContent
using the desired record types.While
RepositoryManager.getAssetContentRecordTypes()
can be used to test which records are supported, this method tests which records are required for creating a specificAssetContent
. Providing an empty array tests if anAssetContent
can be created with no records.
Parameters: asset_content_record_types ( osid.type.Type[]
) – array of asset content record typesReturns: true
ifAssetContent
creation using the specifiedTypes
is supported,false
otherwiseReturn type: boolean
Raise: NullArgument
–asset_content_record_types
isnull
compliance: mandatory – This method must be implemented.
Repository.
get_asset_content_form_for_create
(asset_id, asset_content_record_types)¶Gets an asset content form for creating new assets.
Parameters:
- asset_id (
osid.id.Id
) – theId
of anAsset
- asset_content_record_types (
osid.type.Type[]
) – array of asset content record typesReturns: the asset content form
Return type:
osid.repository.AssetContentForm
Raise:
NotFound
–asset_id
is not foundRaise:
NullArgument
–asset_id
orasset_content_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.
Repository.
create_asset_content
(asset_content_form)¶Creates new
AssetContent
for a given asset.
Parameters: asset_content_form ( osid.repository.AssetContentForm
) – the form for thisAssetContent
Returns: the new AssetContent
Return type: osid.repository.AssetContent
Raise: IllegalState
–asset_content_form
already used in a create transactionRaise: InvalidArgument
– one or more of the form elements is invalidRaise: NullArgument
–asset_content_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–asset_content_form
did not originate fromget_asset_content_form_for_create()
compliance: mandatory – This method must be implemented.
Repository.
can_update_asset_contents
()¶Tests if this user can update
AssetContent
.A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an
AssetContent
will result in aPermissionDenied
. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
Returns: false
ifAssetContent
modification is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
get_asset_content_form_for_update
(asset_content_id)¶Gets the asset content form for updating an existing asset content.
A new asset content form should be requested for each update transaction.
Parameters: asset_content_id ( osid.id.Id
) – theId
of theAssetContent
Returns: the asset content form Return type: osid.repository.AssetContentForm
Raise: NotFound
–asset_content_id
is not foundRaise: NullArgument
–asset_content_id
isnull
Raise: OperationFailed
– unable to complete requestcompliance: mandatory – This method must be implemented.
Repository.
update_asset_content
(asset_content_form)¶Updates an existing asset content.
Parameters: asset_content_form ( osid.repository.AssetContentForm
) – the form containing the elements to be updatedRaise: IllegalState
–asset_content_form
already used in an update transactionRaise: InvalidArgument
– the form contains an invalid valueRaise: NullArgument
–asset_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–asset_content_form
did not originate fromget_asset_content_form_for_update()
compliance: mandatory – This method must be implemented.
Repository.
can_delete_asset_contents
()¶Tests if this user can delete
AssetsContents
.A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an
AssetContent
will result in aPermissionDenied
. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
Returns: false
ifAssetContent
deletion is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
delete_asset_content
(asset_content_id)¶Deletes content from an
Asset
.
Parameters: asset_content_id ( osid.id.Id
) – theId
of theAssetContent
Raise: NotFound
–asset_content_id
is not foundRaise: NullArgument
–asset_content_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Asset Notification Methods¶
Repository.
repository_id
Gets the
Repository
Id
associated with this session.
Returns: the Repository Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
Repository.
repository
Gets the
Repository
associated with this session.
Returns: the Repository
associated with this sessionReturn type: osid.repository.Repository
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
can_register_for_asset_notifications
()¶Tests if this user can register for
Asset
notifications.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 notification operations.
Returns: false
if notification methods are not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
use_federated_repository_view
()Federates the view for methods in this session.
A federated view will include compositions in repositories which are children of this repository in the repository hierarchy.
compliance: mandatory – This method is must be implemented.
Repository.
use_isolated_repository_view
()Isolates the view for methods in this session.
An isolated view restricts lookups to this repository only.
compliance: mandatory – This method is must be implemented.
Repository.
register_for_new_assets
()¶Register for notifications of new assets.
AssetReceiver.newAssets()
is invoked when a newAsset
appears in this repository.
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
register_for_new_assets_by_genus_type
(asset_genus_type)¶Registers for notification of new assets of the given asset genus type.
AssetReceiver.newAssets()
is invoked when an asset is appears in this repository.
Parameters: asset_genus_type ( osid.type.Type
) – the genus type of theAsset
to monitorRaise: NullArgument
–asset_genus_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
register_for_changed_assets
()¶Registers for notification of updated assets.
AssetReceiver.changedAssets()
is invoked when an asset in this repository is changed.
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
register_for_changed_assets_by_genus_type
(asset_genus_type)¶Registers for notification of updated assets of the given asset genus type.
AssetReceiver.changedAssets()
is invoked when an asset in this repository is changed.
Parameters: asset_genus_type ( osid.type.Type
) – the genus type of theAsset
to monitorRaise: NullArgument
–asset_genus_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
register_for_changed_asset
(asset_id)¶Registers for notification of an updated asset.
AssetReceiver.changedAssets()
is invoked when the specified asset in this repository is changed.
Parameters: asset_id ( osid.id.Id
) – theId
of theAsset
to monitorRaise: NullArgument
–asset_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
register_for_deleted_assets
()¶Registers for notification of deleted assets.
AssetReceiver.deletedAssets()
is invoked when an asset is deleted or removed from this repository.
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
register_for_deleted_assets_by_genus_type
(asset_genus_type)¶Registers for notification of deleted assets of the given asset genus type.
AssetReceiver.deletedAssets()
is invoked when an asset is deleted or removed from this repository.
Parameters: asset_genus_type ( osid.type.Type
) – the genus type of theAsset
to monitorRaise: NullArgument
–asset_genus_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
register_for_deleted_asset
(asset_id)¶Registers for notification of a deleted asset.
AssetReceiver.deletedAssets()
is invoked when the specified asset is deleted or removed from this repository.
Parameters: asset_id ( osid.id.Id
) – theId
of theAsset
to monitorRaise: NullArgument
–asset_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
reliable_asset_notifications
()¶Reliable notifications are desired.
In reliable mode, notifications are to be acknowledged using
acknowledge_item_notification()
.compliance: mandatory – This method is must be implemented.
Repository.
unreliable_asset_notifications
()¶Unreliable notifications are desired.
In unreliable mode, notifications do not need to be acknowledged.
compliance: mandatory – This method is must be implemented.
Repository.
acknowledge_asset_notification
(notification_id)¶Acknowledge an asset notification.
Parameters: notification_id ( osid.id.Id
) – theId
of the notificationRaise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Asset Repository Methods¶
Repository.
can_lookup_asset_repository_mappings
()¶Tests if this user can perform lookups of asset/repository mappings.
A return of true does not guarantee successful authorization. A return of false indicates that it is known lookup 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 looking up mappings is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
use_comparative_repository_view
()¶The returns from the lookup 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.
Repository.
use_plenary_repository_view
()¶A complete view of the
Asset
andRepository
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.
Repository.
get_asset_ids_by_repository
(repository_id)¶Gets the list of
Asset
Ids
associated with aRepository
.
Parameters: repository_id ( osid.id.Id
) –Id
of theRepository
Returns: list of related asset Ids
Return 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.
Repository.
get_assets_by_repository
(repository_id)¶Gets the list of
Assets
associated with aRepository
.
Parameters: repository_id ( osid.id.Id
) –Id
of theRepository
Returns: list of related assets Return type: osid.repository.AssetList
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.
Repository.
get_asset_ids_by_repositories
(repository_ids)¶Gets the list of
Asset Ids
corresponding to a list ofRepository
objects.
Parameters: repository_ids ( osid.id.IdList
) – list of repositoryIds
Returns: list of asset Ids
Return type: osid.id.IdList
Raise: NullArgument
–repository_ids
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
get_assets_by_repositories
(repository_ids)¶Gets the list of
Assets
corresponding to a list ofRepository
objects.
Parameters: repository_ids ( osid.id.IdList
) – list of repositoryIds
Returns: list of assets Return type: osid.repository.AssetList
Raise: NullArgument
–repository_ids
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
get_repository_ids_by_asset
(asset_id)¶Gets the list of
Repository
Ids
mapped to anAsset
.
Parameters: asset_id ( osid.id.Id
) –Id
of anAsset
Returns: list of repository Ids
Return type: osid.id.IdList
Raise: NotFound
–asset_id
is not foundRaise: NullArgument
–asset_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
get_repositories_by_asset
(asset_id)¶Gets the list of
Repository
objects mapped to anAsset
.
Parameters: asset_id ( osid.id.Id
) –Id
of anAsset
Returns: list of repositories Return type: osid.repository.RepositoryList
Raise: NotFound
–asset_id
is not foundRaise: NullArgument
–asset_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Asset Repository Assignment Methods¶
Repository.
can_assign_assets
()¶Tests if this user can alter asset/repository mappings.
A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a
PermissionDenied
. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
Returns: false
if mapping is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
can_assign_assets_to_repository
(repository_id)¶Tests if this user can alter asset/repository mappings.
A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a
PermissionDenied
. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
Parameters: repository_id ( osid.id.Id
) – theId
of theRepository
Returns: false
if mapping is not authorized,true
otherwiseReturn type: boolean
Raise: NullArgument
–repository_id
isnull
compliance: mandatory – This method must be implemented.
Repository.
get_assignable_repository_ids
(repository_id)¶Gets a list of repositories including and under the given repository node in which any composition can be assigned.
Parameters: repository_id ( osid.id.Id
) – theId
of theRepository
Returns: list of assignable repository Ids
Return type: osid.id.IdList
Raise: NullArgument
–repository_id
isnull
Raise: OperationFailed
– unable to complete requestcompliance: mandatory – This method must be implemented.
Repository.
get_assignable_repository_ids_for_asset
(repository_id, asset_id)¶Gets a list of repositories including and under the given repository node in which a specific asset can be assigned.
Parameters:
- repository_id (
osid.id.Id
) – theId
of theRepository
- asset_id (
osid.id.Id
) – theId
of theAsset
Returns: list of assignable repository
Ids
Return type:
osid.id.IdList
Raise:
NullArgument
–repository_id
orasset_id
isnull
Raise:
OperationFailed
– unable to complete requestcompliance: mandatory – This method must be implemented.
Repository.
assign_asset_to_repository
(asset_id, repository_id)¶Adds an existing
Asset
to aRepository
.
Parameters:
- asset_id (
osid.id.Id
) – theId
of theAsset
- repository_id (
osid.id.Id
) – theId
of theRepository
Raise:
AlreadyExists
–asset_id
already assigned torepository_id
Raise:
NotFound
–asset_id
orrepository_id
not foundRaise:
NullArgument
–asset_id
orrepository_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
unassign_asset_from_repository
(asset_id, repository_id)¶Removes an
Asset
from aRepository
.
Parameters:
- asset_id (
osid.id.Id
) – theId
of theAsset
- repository_id (
osid.id.Id
) – theId
of theRepository
Raise:
NotFound
–asset_id
orrepository_id
not found orasset_id
not assigned torepository_id
Raise:
NullArgument
–asset_id
orrepository_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Asset Composition Methods¶
Repository.
repository_id
Gets the
Repository
Id
associated with this session.
Returns: the Repository Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
Repository.
repository
Gets the
Repository
associated with this session.
Returns: the Repository
associated with this sessionReturn type: osid.repository.Repository
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
can_access_asset_compositions
()¶Tests if this user can perform composition 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.
Repository.
use_comparative_asset_composition_view
()¶The returns from the lookup 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.
Repository.
use_plenary_asset_composition_view
()¶A complete view of the 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.
Repository.
use_federated_repository_view
()Federates the view for methods in this session.
A federated view will include compositions in repositories which are children of this repository in the repository hierarchy.
compliance: mandatory – This method is must be implemented.
Repository.
use_isolated_repository_view
()Isolates the view for methods in this session.
An isolated view restricts lookups to this repository only.
compliance: mandatory – This method is must be implemented.
Repository.
get_composition_assets
(composition_id)¶Gets the list of assets mapped to the given
Composition
.
Parameters: composition_id ( osid.id.Id
) –Id
of theComposition
Returns: list of assets Return type: osid.repository.AssetList
Raise: NotFound
–composition_id
not foundRaise: NullArgument
–composition_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method is must be implemented.
Repository.
get_compositions_by_asset
(asset_id)¶Gets a list of compositions including the given asset.
Parameters: asset_id ( osid.id.Id
) –Id
of theAsset
Returns: the returned Composition list
Return type: osid.repository.CompositionList
Raise: NotFound
–asset_id
is not foundRaise: NullArgument
–asset_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Asset Composition Design Methods¶
Repository.
repository_id
Gets the
Repository
Id
associated with this session.
Returns: the Repository Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
Repository.
repository
Gets the
Repository
associated with this session.
Returns: the Repository
associated with this sessionReturn type: osid.repository.Repository
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
can_compose_assets
()¶Tests if this user can manage mapping of
Assets
toCompositions
.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 an application hint that may opt not to offer composition operations.
Returns: false
if asset composiion is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
add_asset
(asset_id, composition_id)¶Appends an asset to a composition.
Parameters:
- asset_id (
osid.id.Id
) –Id
of theAsset
- composition_id (
osid.id.Id
) –Id
of theComposition
Raise:
AlreadyExists
–asset_id
already partcomposition_id
Raise:
NotFound
–asset_id
orcomposition_id
not foundRaise:
NullArgument
–asset_id
orcomposition_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization fauilurecompliance: mandatory – This method must be implemented.
Repository.
move_asset_ahead
(asset_id, composition_id, reference_id)¶Reorders assets in a composition by moving the specified asset in front of a reference asset.
Parameters:
- asset_id (
osid.id.Id
) –Id
of theAsset
- composition_id (
osid.id.Id
) –Id
of theComposition
- reference_id (
osid.id.Id
) –Id
of the referenceAsset
Raise:
NotFound
–asset_id
orreference_id
not found in composition_id
Raise:
NullArgument
–asset_id, reference_id
orcomposition_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization fauilurecompliance: mandatory – This method must be implemented.
Repository.
move_asset_behind
(asset_id, composition_id, reference_id)¶Reorders assets in a composition by moving the specified asset behind of a reference asset.
Parameters:
- asset_id (
osid.id.Id
) –Id
of theAsset
- composition_id (
osid.id.Id
) –Id
of theComposition
- reference_id (
osid.id.Id
) –Id
of the referenceAsset
Raise:
NotFound
–asset_id
orreference_id
not found in composition_id
Raise:
NullArgument
–asset_id, reference_id
orcomposition_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization fauilurecompliance: mandatory – This method must be implemented.
Repository.
order_assets
(asset_ids, composition_id)¶Reorders a set of assets in a composition.
Parameters:
- asset_ids (
osid.id.Id[]
) –Ids
for a set ofAssets
- composition_id (
osid.id.Id
) –Id
of theComposition
Raise:
NotFound
–composition_id
not found or, anasset_id
not related tocomposition_id
Raise:
NullArgument
–instruction_ids
oragenda_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
remove_asset
(asset_id, composition_id)¶Removes an
Asset
from aComposition
.
Parameters:
- asset_id (
osid.id.Id
) –Id
of theAsset
- composition_id (
osid.id.Id
) –Id
of theComposition
Raise:
NotFound
–asset_id
not found in composition_id
Raise:
NullArgument
–asset_id
orcomposition_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization fauilurecompliance: mandatory – This method must be implemented.
Composition Lookup Methods¶
Repository.
repository_id
Gets the
Repository
Id
associated with this session.
Returns: the Repository Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
Repository.
repository
Gets the
Repository
associated with this session.
Returns: the Repository
associated with this sessionReturn type: osid.repository.Repository
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
can_lookup_compositions
()¶Tests if this user can perform
Composition
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.
Repository.
use_comparative_composition_view
()¶The returns from the lookup 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.
Repository.
use_plenary_composition_view
()¶A complete view of the
Composition
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.
Repository.
use_federated_repository_view
()Federates the view for methods in this session.
A federated view will include compositions in repositories which are children of this repository in the repository hierarchy.
compliance: mandatory – This method is must be implemented.
Repository.
use_isolated_repository_view
()Isolates the view for methods in this session.
An isolated view restricts lookups to this repository only.
compliance: mandatory – This method is must be implemented.
Repository.
use_active_composition_view
()¶Only active compositions are returned by methods in this session.
compliance: mandatory – This method is must be implemented.
Repository.
use_any_status_composition_view
()¶All active and inactive compositions are returned by methods in this session.
compliance: mandatory – This method is must be implemented.
Repository.
use_sequestered_composition_view
()¶The methods in this session omit sequestered compositions.
compliance: mandatory – This method is must be implemented.
Repository.
use_unsequestered_composition_view
()¶The methods in this session return all compositions, including sequestered compositions.
compliance: mandatory – This method is must be implemented.
Repository.
get_composition
(composition_id)¶Gets the
Composition
specified by itsId
.
Parameters: composition_id ( osid.id.Id
) –Id
of theComposiiton
Returns: the composition Return type: osid.repository.Composition
Raise: NotFound
–composition_id
not foundRaise: NullArgument
–composition_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method is must be implemented.
Repository.
get_compositions_by_ids
(composition_ids)¶Gets a
CompositionList
corresponding to the givenIdList
.
Parameters: composition_ids ( osid.id.IdList
) – the list ofIds
to retrieveReturns: the returned Composition list
Return type: osid.repository.CompositionList
Raise: NotFound
– anId
was not foundRaise: NullArgument
–composition_ids
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
get_compositions_by_genus_type
(composition_genus_type)¶Gets a
CompositionList
corresponding to the given composition genusType
which does not include compositions of types derived from the specifiedType
.
Parameters: composition_genus_type ( osid.type.Type
) – a composition genus typeReturns: the returned Composition list
Return type: osid.repository.CompositionList
Raise: NullArgument
–composition_genus_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
get_compositions_by_parent_genus_type
(composition_genus_type)¶Gets a
CompositionList
corresponding to the given composition genusType
and include any additional compositions with genus types derived from the specifiedType
.
Parameters: composition_genus_type ( osid.type.Type
) – a composition genus typeReturns: the returned Composition list
Return type: osid.repository.CompositionList
Raise: NullArgument
–composition_genus_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
get_compositions_by_record_type
(composition_record_type)¶Gets a
CompositionList
containing the given composition recordType
.
Parameters: composition_record_type ( osid.type.Type
) – a composition record typeReturns: the returned Composition list
Return type: osid.repository.CompositionList
Raise: NullArgument
–composition_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
get_compositions_by_provider
(resource_id)¶Gets a
CompositionList
from the given provider ````.In plenary mode, the returned list contains all known compositions or an error results. Otherwise, the returned list may contain only those compositions that are accessible through this session.
In sequestered mode, no sequestered compositions are returned. In unsequestered mode, all compositions are returned.
Parameters: resource_id ( osid.id.Id
) – a resourceId
Returns: the returned Composition list
Return type: osid.repository.CompositionList
Raise: NullArgument
–resource_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
compositions
¶Gets all
Compositions
.
Returns: a list of Compositions
Return type: osid.repository.CompositionList
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Composition Query Methods¶
Repository.
repository_id
Gets the
Repository
Id
associated with this session.
Returns: the Repository Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
Repository.
repository
Gets the
Repository
associated with this session.
Returns: the Repository
associated with this sessionReturn type: osid.repository.Repository
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
can_search_compositions
()¶Tests if this user can perform
Composition
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.
Repository.
use_federated_repository_view
()Federates the view for methods in this session.
A federated view will include compositions in repositories which are children of this repository in the repository hierarchy.
compliance: mandatory – This method is must be implemented.
Repository.
use_isolated_repository_view
()Isolates the view for methods in this session.
An isolated view restricts lookups to this repository only.
compliance: mandatory – This method is must be implemented.
Repository.
use_sequestered_composition_view
()The methods in this session omit sequestered compositions.
compliance: mandatory – This method is must be implemented.
Repository.
use_unsequestered_composition_view
()The methods in this session return all compositions, including sequestered compositions.
compliance: mandatory – This method is must be implemented.
Repository.
composition_query
¶Gets a composition query.
Returns: the composition query Return type: osid.repository.CompositionQuery
compliance: mandatory – This method must be implemented.
Repository.
get_compositions_by_query
(composition_query)¶Gets a list of
Compositions
matching the given composition query.
Parameters: composition_query ( osid.repository.CompositionQuery
) – the composition queryReturns: the returned CompositionList
Return type: osid.repository.CompositionList
Raise: NullArgument
–composition_query
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–composition_query
is not of this servicecompliance: mandatory – This method must be implemented.
Composition Search Methods¶
Repository.
composition_search
¶Gets a composition search.
Returns: the composition search Return type: osid.repository.CompositionSearch
compliance: mandatory – This method must be implemented.
Repository.
composition_search_order
¶Gets a composition search order.
The
CompositionSearchOrder
is supplied to anCompositionSearch
to specify the ordering of results.
Returns: the composition search order Return type: osid.repository.CompositionSearchOrder
compliance: mandatory – This method must be implemented.
Repository.
get_compositions_by_search
(composition_query, composition_search)¶Gets the search results matching the given search query using the given search.
Parameters:
- composition_query (
osid.repository.CompositionQuery
) – the composition query- composition_search (
osid.repository.CompositionSearch
) – the composition searchReturns: the composition search results
Return type:
osid.repository.CompositionSearchResults
Raise:
NullArgument
–composition_query
orcomposition_search
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failureRaise:
Unsupported
–composition_query
orcomposition_search
is not of this servicecompliance: mandatory – This method must be implemented.
Repository.
get_composition_query_from_inspector
(composition_query_inspector)¶Gets a composition query from an inspector.
The inspector is available from a
CompositionSearchResults
.
Parameters: composition_query_inspector ( osid.repository.CompositionQueryInspector
) – a composition query inspectorReturns: the composition query Return type: osid.repository.CompositionQuery
Raise: NullArgument
–composition_query_inspector
isnull
Raise: Unsupported
–composition_query_inspector
is not of this servicecompliance: mandatory – This method must be implemented.
Composition Admin Methods¶
Repository.
repository_id
Gets the
Repository
Id
associated with this session.
Returns: the Repository Id
associated with this sessionReturn type: osid.id.Id
compliance: mandatory – This method must be implemented.
Repository.
repository
Gets the
Repository
associated with this session.
Returns: the Repository
associated with this sessionReturn type: osid.repository.Repository
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
can_create_compositions
()¶Tests if this user can create
Compositions
.A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a
Composition
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
ifComposition
creation is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
can_create_composition_with_record_types
(composition_record_types)¶Tests if this user can create a single
Composition
using the desired record types.While
RepositoryManager.getCompositionRecordTypes()
can be used to examine which records are supported, this method tests which record(s) are required for creating a specificComposition
. Providing an empty array tests if aComposition
can be created with no records.
Parameters: composition_record_types ( osid.type.Type[]
) – array of composition record typesReturns: true
ifComposition
creation using the specifiedTypes
is supported,false
otherwiseReturn type: boolean
Raise: NullArgument
–composition_record_types
isnull
compliance: mandatory – This method must be implemented.
Repository.
get_composition_form_for_create
(composition_record_types)¶Gets the composition form for creating new compositions.
A new form should be requested for each create transaction.
Parameters: composition_record_types ( osid.type.Type[]
) – array of composition record typesReturns: the composition form Return type: osid.repository.CompositionForm
Raise: NullArgument
–composition_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.
Repository.
create_composition
(composiiton_form)¶Creates a new
Composition
.
Parameters: composiiton_form ( osid.repository.CompositionForm
) – the form for thisComposition
Returns: the new Composition
Return type: osid.repository.Composition
Raise: IllegalState
–composition_form
already used in a create transactionRaise: InvalidArgument
– one or more of the form elements is invalidRaise: NullArgument
–composition_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–composition_form
did not originate fromget_composition_form_for_create()
compliance: mandatory – This method must be implemented.
Repository.
can_update_compositions
()¶Tests if this user can update
Compositions
.A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a
Composition
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
ifComposition
modification is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
get_composition_form_for_update
(composition_id)¶Gets the composition form for updating an existing composition.
A new composition form should be requested for each update transaction.
Parameters: composition_id ( osid.id.Id
) – theId
of theComposition
Returns: the composition form Return type: osid.repository.CompositionForm
Raise: NotFound
–composition_id
is not foundRaise: NullArgument
–composition_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
update_composition
(composiiton_form)¶Updates an existing composition.
Parameters: composiiton_form ( osid.repository.CompositionForm
) – the form containing the elements to be updatedRaise: IllegalState
–composition_form
already used in an update transactionRaise: InvalidArgument
– the form contains an invalid valueRaise: NullArgument
–composition_form
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failureRaise: Unsupported
–composition_form
did not originate fromget_composition_form_for_update()
compliance: mandatory – This method must be implemented.
Repository.
can_delete_compositions
()¶Tests if this user can delete
Compositions
.A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a
Composition
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
ifComposition
deletion is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
delete_composition
(composition_id)¶Deletes a
Composition
.
Parameters: composition_id ( osid.id.Id
) – theId
of theComposition
to removeRaise: NotFound
–composition_id
not foundRaise: NullArgument
–composition_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
delete_composition_node
(composition_id)¶Deletes a
Composition
and all contained children.
Parameters: composition_id ( osid.id.Id
) – theId
of theComposition
to removeRaise: NotFound
–composition_id
not foundRaise: NullArgument
–composition_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
add_composition_child
(composition_id, child_composition_id)¶Adds a composition to a parent composition.
Parameters:
- composition_id (
osid.id.Id
) – theId
of a parentComposition
- child_composition_id (
osid.id.Id
) – theId
of a childComposition
Raise:
AlreadyExists
–child_composition_id
is already a child ofcomposition_id
Raise:
NotFound
–composition_id
orchild_composition_id
is not foundRaise:
NullArgument
–composition_id
orchild_composition_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
remove_composition_child
(composition_id, child_composition_id)¶Removes a composition from a parent composition.
Parameters:
- composition_id (
osid.id.Id
) – theId
of a parentComposition
- child_composition_id (
osid.id.Id
) – theId
of a childComposition
Raise:
NotFound
–composition_id
orchild_composition_id
is not found or not relatedRaise:
NullArgument
–composition_id
orchild_composition_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
can_manage_composition_aliases
()¶Tests if this user can manage
Id
aliases forCompositions
.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
ifComposition
aliasing is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
alias_composition
(composition_id, alias_id)¶Adds an
Id
to aComposition
for the purpose of creating compatibility.The primary
Id
of theComposition
is determined by the provider. The newId
is an alias to the primaryId
. If the alias is a pointer to another composition, it is reassigned to the given compositionId
.
Parameters:
- composition_id (
osid.id.Id
) – theId
of aComposition
- alias_id (
osid.id.Id
) – the aliasId
Raise:
AlreadyExists
–alias_id
is in use as a primaryId
Raise:
NotFound
–composition_id
not foundRaise:
NullArgument
–composition_id
oralias_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Composition Repository Methods¶
Repository.
use_comparative_composition_repository_view
()¶The returns from the lookup 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.
Repository.
use_plenary_composition_repository_view
()¶A complete view of the
Composition
andRepository
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.
Repository.
can_lookup_composition_repository_mappings
()¶Tests if this user can perform lookups of composition/repository mappings.
A return of true does not guarantee successful authorization. A return of false indicates that it is known lookup 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 looking up mappings is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
get_composition_ids_by_repository
(repository_id)¶Gets the list of
Composition
Ids
associated with aRepository
.
Parameters: repository_id ( osid.id.Id
) –Id
of theRepository
Returns: list of related composition Ids
Return 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.
Repository.
get_compositions_by_repository
(repository_id)¶Gets the list of
Compositions
associated with aRepository
.
Parameters: repository_id ( osid.id.Id
) –Id
of theRepository
Returns: list of related compositions Return type: osid.repository.CompositionList
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.
Repository.
get_composition_ids_by_repositories
(repository_ids)¶Gets the list of
Composition
Ids
corresponding to a list ofRepository
objects.
Parameters: repository_ids ( osid.id.IdList
) – list of repositoryIds
Returns: list of composition Ids
Return type: osid.id.IdList
Raise: NullArgument
–repository_ids
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
get_compoitions_by_repositories
(repository_ids)¶Gets the list of
Compositions
corresponding to a list ofRepository
objects.
Parameters: repository_ids ( osid.id.IdList
) – list of repositoryIds
Returns: list of Compositions Return type: osid.repository.CompositionList
Raise: NullArgument
–repository_ids
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
get_repository_ids_by_composition
(composition_id)¶Gets the
Repository
Ids
mapped to aComposition
.
Parameters: composition_id ( osid.id.Id
) –Id
of aComposition
Returns: list of repository Ids
Return type: osid.id.IdList
Raise: NotFound
–composition_id
is not foundRaise: NullArgument
–composition_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
get_repositories_by_composition
(composition_id)¶Gets the
Repository
objects mapped to aComposition
.
Parameters: composition_id ( osid.id.Id
) –Id
of aComposition
Returns: list of repositories Return type: osid.repository.RepositoryList
Raise: NotFound
–composition_id
is not foundRaise: NullArgument
–composition_id
isnull
Raise: OperationFailed
– unable to complete requestRaise: PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Composition Repository Assignment Methods¶
Repository.
can_assign_compositions
()¶Tests if this user can alter composition/repository mappings.
A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a
PermissionDenied
. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
Returns: false
if mapping is not authorized,true
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
Repository.
can_assign_compositions_to_repository
(repository_id)¶Tests if this user can alter composition/repository mappings.
A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a
PermissionDenied
. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
Parameters: repository_id ( osid.id.Id
) – theId
of theRepository
Returns: false
if mapping is not authorized,true
otherwiseReturn type: boolean
Raise: NullArgument
–repository_id
isnull
compliance: mandatory – This method must be implemented.
Repository.
get_assignable_repository_ids
(repository_id)Gets a list of repositories including and under the given repository node in which any composition can be assigned.
Parameters: repository_id ( osid.id.Id
) – theId
of theRepository
Returns: list of assignable repository Ids
Return type: osid.id.IdList
Raise: NullArgument
–repository_id
isnull
Raise: OperationFailed
– unable to complete requestcompliance: mandatory – This method must be implemented.
Repository.
get_assignable_repository_ids_for_composition
(repository_id, composition_id)¶Gets a list of repositories including and under the given repository node in which a specific composition can be assigned.
Parameters:
- repository_id (
osid.id.Id
) – theId
of theRepository
- composition_id (
osid.id.Id
) – theId
of theComposition
Returns: list of assignable repository
Ids
Return type:
osid.id.IdList
Raise:
NullArgument
–repository_id
orcomposition_id
isnull
Raise:
OperationFailed
– unable to complete requestcompliance: mandatory – This method must be implemented.
Repository.
assign_composition_to_repository
(composition_id, repository_id)¶Adds an existing
Composition
to aRepository
.
Parameters:
- composition_id (
osid.id.Id
) – theId
of theComposition
- repository_id (
osid.id.Id
) – theId
of theRepository
Raise:
AlreadyExists
–composition_id
already assigned torepository_id
Raise:
NotFound
–composition_id
orrepository_id
not foundRaise:
NullArgument
–composition_id
orrepository_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.
Repository.
unassign_composition_from_repository
(composition_id, repository_id)¶Removes
Composition
from aRepository
.
Parameters:
- composition_id (
osid.id.Id
) – theId
of theComposition
- repository_id (
osid.id.Id
) – theId
of theRepository
Raise:
NotFound
–composition_id
orrepository_id
not found orcomposition_id
not assigned torepository_id
Raise:
NullArgument
–composition_id
orrepository_id
isnull
Raise:
OperationFailed
– unable to complete requestRaise:
PermissionDenied
– authorization failurecompliance: mandatory – This method must be implemented.