Objects

Asset

class dlkit.repository.objects.Asset

Bases: dlkit.osid.objects.OsidObject, dlkit.osid.markers.Aggregateable, dlkit.osid.markers.Sourceable

An Asset represents some digital content.

Example assets might be a text document, an image, or a movie. The content data, and metadata related directly to the content format and quality, is accessed through AssetContent. Assets , like all OsidObjects, include a type a record to qualify the Asset and include additional data. The division between the Asset Type and AssetContent is to separate data describing the asset from data describing the format of the contents, allowing a consumer to select among multiple formats, sizes or levels of fidelity.

An example is a photograph of the Bay Bridge. The content may deliver a JPEG in multiple resolutions where the AssetContent may also desribe size or compression factor for each one. The content may also include an uncompressed TIFF version. The Asset Type may be “photograph” indicating that the photo itself is the asset managed in this repository.

Since an Asset may have multiple AssetContent structures, the decision of how many things to stuff inside a single asset comes down to if the content is actually a different format, or size, or quality, falling under the same creator, copyright, publisher and distribution rights as the original. This may, in some cases, provide a means to implement some accessibility, it doesn’t handle the case where, to meet an accessibility requirement, one asset needs to be substituted for another. The Repository OSID manages this aspect outside the scope of the core Asset definition.

Assets map to AssetSubjects. AssetSubjects are OsidObjects that capture a subject matter. In the above example, an AssetSubject may be defined for the Bay Bridge and include data describing the bridge. The single subject can map to multiple assets depicting the bridge providing a single entry for a search and a single place to describe a bridge. Bridges, as physical items, may also be described using the Resource OSID in which case the use of the AssetSubject acts as a cover for the underlying Resource to assist repository-only consumers.

The Asset definition includes some basic copyright and related licensing information to assist in finding free-to-use content, or to convey the distribution restrictions that may be placed on the asset. Generally, if no data is available it is to be assumed that all rights are reserved.

A publisher is applicable if the content of this Asset has been published. Not all Assets in this Repository may have a published status and such a status may effect the applicability of copyright law. To trace the source of an Asset, both a provider and source are defined. The provider indicates where this repository acquired the asset and the source indicates the original provider or copyright owner. In the case of a published asset, the source is the publisher.

Assets also define methods to facilitate searches over time and space as it relates to the subject matter. This may at times be redundant with the AssetSubject. In the case of the Bay Bridge photograph, the temporal coverage may include 1936, when it opened, and/or indicate when the photo was taken to capture a current event of the bridge. The decision largeley depends on what desired effect is from a search. The spatial coverage may describe the gps coordinates of the bridge or describe the spatial area encompassed in the view. In either case, a “photograph” type may unambiguously defined methods to describe the exact time the photograph was taken and the location of the photographer.

The core Asset defines methods to perform general searches and construct bibliographic entries without knowledge of a particular Asset or AssetContent record Type.

title

Gets the proper title of this asset.

This may be the same as the display name or the display name may be used for a less formal label.

Returns:the title of this asset
Return type:osid.locale.DisplayText

Tests if the copyright status is known.

return:true if the copyright status of this asset is known, false otherwise. If false, is_public_domain(), ``can_distribute_verbatim(), can_distribute_alterations() and
can_distribute_compositions()`` may also be false.
rtype:boolean
is_public_domain()

Tests if this asset is in the public domain.

An asset is in the public domain if copyright is not applicable, the copyright has expired, or the copyright owner has expressly relinquished the copyright.

Returns:true if this asset is in the public domain, false otherwise. If true, can_distribute_verbatim(), can_distribute_alterations() and can_distribute_compositions() must also be true.
Return type:boolean
Raise:IllegalStateis_copyright_status_known() is false
copyright_registration

Gets the copyright registration information for this asset.

Returns:the copyright registration. An empty string means the registration status isn’t known.
Return type:string
Raise:IllegalStateis_copyright_status_known() is false
can_distribute_verbatim()

Tests if there are any license restrictions on this asset that restrict the distribution, re-publication or public display of this asset, commercial or otherwise, without modification, alteration, or inclusion in other works.

This method is intended to offer consumers a means of filtering out search results that restrict distribution for any purpose. The scope of this method does not include licensing that describes warranty disclaimers or attribution requirements. This method is intended for informational purposes only and does not replace or override the terms specified in a license agreement which may specify exceptions or additional restrictions.

Returns:true if the asset can be distributed verbatim, false otherwise.
Return type:boolean
Raise:IllegalStateis_copyright_status_known() is false
can_distribute_alterations()

Tests if there are any license restrictions on this asset that restrict the distribution, re-publication or public display of any alterations or modifications to this asset, commercial or otherwise, for any purpose.

This method is intended to offer consumers a means of filtering out search results that restrict the distribution or public display of any modification or alteration of the content or its metadata of any kind, including editing, translation, resampling, resizing and cropping. The scope of this method does not include licensing that describes warranty disclaimers or attribution requirements. This method is intended for informational purposes only and does not replace or override the terms specified in a license agreement which may specify exceptions or additional restrictions.

Returns:true if the asset can be modified, false otherwise. If true, can_distribute_verbatim() must also be true.
Return type:boolean
Raise:IllegalStateis_copyright_status_known() is false
can_distribute_compositions()

Tests if there are any license restrictions on this asset that restrict the distribution, re-publication or public display of this asset as an inclusion within other content or composition, commercial or otherwise, for any purpose, including restrictions upon the distribution or license of the resulting composition.

This method is intended to offer consumers a means of filtering out search results that restrict the use of this asset within compositions. The scope of this method does not include licensing that describes warranty disclaimers or attribution requirements. This method is intended for informational purposes only and does not replace or override the terms specified in a license agreement which may specify exceptions or additional restrictions.

Returns:true if the asset can be part of a larger composition false otherwise. If true, can_distribute_verbatim() must also be true.
Return type:boolean
Raise:IllegalStateis_copyright_status_known() is false
source_id

Gets the Resource Id of the source of this asset.

The source is the original owner of the copyright of this asset and may differ from the creator of this asset. The source for a published book written by Margaret Mitchell would be Macmillan. The source for an unpublished painting by Arthur Goodwin would be Arthur Goodwin.

An Asset is Sourceable and also contains a provider identity. The provider is the entity that makes this digital asset available in this repository but may or may not be the publisher of the contents depicted in the asset. For example, a map published by Ticknor and Fields in 1848 may have a provider of Library of Congress and a source of Ticknor and Fields. If copied from a repository at Middlebury College, the provider would be Middlebury College and a source of Ticknor and Fields.

Returns:the source Id
Return type:osid.id.Id
source

Gets the Resource of the source of this asset.

The source is the original owner of the copyright of this asset and may differ from the creator of this asset. The source for a published book written by Margaret Mitchell would be Macmillan. The source for an unpublished painting by Arthur Goodwin would be Arthur Goodwin.

Returns:the source
Return type:osid.resource.Resource

Gets the resource Ids representing the source of this asset in order from the most recent provider to the originating source.

Returns:the provider Ids
Return type:osid.id.IdList

Gets the Resources representing the source of this asset in order from the most recent provider to the originating source.

Returns:the provider chain
Return type:osid.resource.ResourceList
Raise:OperationFailed – unable to complete request
created_date

Gets the created date of this asset, which is generally not related to when the object representing the asset was created.

The date returned may indicate that not much is known.

Returns:the created date
Return type:osid.calendaring.DateTime
is_published()

Tests if this asset has been published.

Not all assets viewable in this repository may have been published. The source of a published asset indicates the publisher.

Returns:true if this asset has been published, false if unpublished or its published status is not known
Return type:boolean
published_date

Gets the published date of this asset.

Unpublished assets have no published date. A published asset has a date available, however the date returned may indicate that not much is known.

Returns:the published date
Return type:osid.calendaring.DateTime
Raise:IllegalStateis_published() is false
principal_credit_string

Gets the credits of the principal people involved in the production of this asset as a display string.

Returns:the principal credits
Return type:osid.locale.DisplayText
asset_content_ids

Gets the content Ids of this asset.

Returns:the asset content Ids
Return type:osid.id.IdList
asset_contents

Gets the content of this asset.

Returns:the asset contents
Return type:osid.repository.AssetContentList
Raise:OperationFailed – unable to complete request
is_composition()

Tetss if this asset is a representation of a composition of assets.

Returns:true if this asset is a composition, false otherwise
Return type:boolean
composition_id

Gets the Composition Id corresponding to this asset.

Returns:the composiiton Id
Return type:osid.id.Id
Raise:IllegalStateis_composition() is false
composition

Gets the Composition corresponding to this asset.

Returns:the composiiton
Return type:osid.repository.Composition
Raise:IllegalStateis_composition() is false
Raise:OperationFailed – unable to complete request
get_asset_record(asset_record_type)

Gets the asset record corresponding to the given Asset record Type.

This method is used to retrieve an object implementing the requested record. The asset_record_type may be the Type returned in get_record_types() or any of its parents in a Type hierarchy where has_record_type(asset_record_type) is true .

Parameters:asset_record_type (osid.type.Type) – an asset record type
Returns:the asset record
Return type:osid.repository.records.AssetRecord
Raise:NullArgumentasset_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(asset_record_type) is false

Asset Form

class dlkit.repository.objects.AssetForm

Bases: dlkit.osid.objects.OsidObjectForm, dlkit.osid.objects.OsidAggregateableForm, dlkit.osid.objects.OsidSourceableForm

This is the form for creating and updating Assets.

Like all OsidForm objects, various data elements may be set here for use in the create and update methods in the AssetAdminSession. For each data element that may be set, metadata may be examined to provide display hints or data constraints.

title_metadata

Gets the metadata for an asset title.

Returns:metadata for the title
Return type:osid.Metadata
title

Sets the title.

Parameters:title (string) – the new title
Raise:InvalidArgumenttitle is invalid
Raise:NoAccessMetadata.isReadOnly() is true
Raise:NullArgumenttitle is null
public_domain_metadata

Gets the metadata for the public domain flag.

Returns:metadata for the public domain
Return type:osid.Metadata
public_domain

Sets the public domain flag.

Parameters:public_domain (boolean) – the public domain status
Raise:NoAccessMetadata.isReadOnly() is true
copyright_metadata

Gets the metadata for the copyright.

Returns:metadata for the copyright
Return type:osid.Metadata
copyright_registration_metadata

Gets the metadata for the copyright registration.

Returns:metadata for the copyright registration
Return type:osid.Metadata
copyright_registration

Sets the copyright registration.

Parameters:registration (string) – the new copyright registration
Raise:InvalidArgumentcopyright is invalid
Raise:NoAccessMetadata.isReadOnly() is true
Raise:NullArgumentcopyright is null
distribute_verbatim_metadata

Gets the metadata for the distribute verbatim rights flag.

Returns:metadata for the distribution rights fields
Return type:osid.Metadata
distribute_verbatim

Sets the distribution rights.

Parameters:distribute_verbatim (boolean) – right to distribute verbatim copies
Raise:InvalidArgumentdistribute_verbatim is invalid
Raise:NoAccess – authorization failure
distribute_alterations_metadata

Gets the metadata for the distribute alterations rights flag.

Returns:metadata for the distribution rights fields
Return type:osid.Metadata
distribute_alterations

Sets the distribute alterations flag.

This also sets distribute verbatim to true.

Parameters:distribute_mods (boolean) – right to distribute modifications
Raise:InvalidArgumentdistribute_mods is invalid
Raise:NoAccess – authorization failure
distribute_compositions_metadata

Gets the metadata for the distribute compositions rights flag.

Returns:metadata for the distribution rights fields
Return type:osid.Metadata
distribute_compositions

Sets the distribution rights.

This sets distribute verbatim to true.

Parameters:distribute_comps (boolean) – right to distribute modifications
Raise:InvalidArgumentdistribute_comps is invalid
Raise:NoAccess – authorization failure
source_metadata

Gets the metadata for the source.

Returns:metadata for the source
Return type:osid.Metadata
source

Sets the source.

Parameters:source_id (osid.id.Id) – the new publisher
Raise:InvalidArgumentsource_id is invalid
Raise:NoAccessMetadata.isReadOnly() is true
Raise:NullArgumentsource_id is null

Gets the metadata for the provider chain.

Returns:metadata for the provider chain
Return type:osid.Metadata

Sets a provider chain in order from the most recent source to the originating source.

Parameters:resource_ids (osid.id.Id[]) – the new source
Raise:InvalidArgumentresource_ids is invalid
Raise:NoAccessMetadata.isReadOnly() is true
Raise:NullArgumentresource_ids is null
created_date_metadata

Gets the metadata for the asset creation date.

Returns:metadata for the created date
Return type:osid.Metadata
created_date

Sets the created date.

Parameters:created_date (osid.calendaring.DateTime) – the new created date
Raise:InvalidArgumentcreated_date is invalid
Raise:NoAccessMetadata.isReadOnly() is true
Raise:NullArgumentcreated_date is null
published_metadata

Gets the metadata for the published status.

Returns:metadata for the published field
Return type:osid.Metadata
published

Sets the published status.

Parameters:published (boolean) – the published status
Raise:NoAccessMetadata.isReadOnly() is true
published_date_metadata

Gets the metadata for the published date.

Returns:metadata for the published date
Return type:osid.Metadata
published_date

Sets the published date.

Parameters:published_date (osid.calendaring.DateTime) – the new published date
Raise:InvalidArgumentpublished_date is invalid
Raise:NoAccessMetadata.isReadOnly() is true
Raise:NullArgumentpublished_date is null
principal_credit_string_metadata

Gets the metadata for the principal credit string.

Returns:metadata for the credit string
Return type:osid.Metadata
principal_credit_string

Sets the principal credit string.

Parameters:credit_string (string) – the new credit string
Raise:InvalidArgumentcredit_string is invalid
Raise:NoAccessMetadata.isReadOnly() is true
Raise:NullArgumentcredit_string is null
composition_metadata

Gets the metadata for linking this asset to a composition.

Returns:metadata for the composition
Return type:osid.Metadata
composition

Sets the composition.

Parameters:composition_id (osid.id.Id) – a composition
Raise:InvalidArgumentcomposition_id is invalid
Raise:NoAccessMetadata.isReadOnly() is true
Raise:NullArgumentcomposition_id is null
get_asset_form_record(asset_record_type)

Gets the AssetFormRecord corresponding to the given Asset record Type.

Parameters:asset_record_type (osid.type.Type) – an asset record type
Returns:the asset form record
Return type:osid.repository.records.AssetFormRecord
Raise:NullArgumentasset_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(asset_record_type) is false

Asset List

class dlkit.repository.objects.AssetList

Bases: dlkit.osid.objects.OsidList

Like all OsidLists, AssetList provides a means for accessing Asset elements sequentially either one at a time or many at a time.

Examples: while (al.hasNext()) { Asset asset = al.getNextAsset(); }

or
while (al.hasNext()) {
Asset[] assets = al.getNextAssets(al.available());

}

next_asset

Gets the next Asset in this list.

Returns:the next Asset in this list. The has_next() method should be used to test that a next Asset is available before calling this method.
Return type:osid.repository.Asset
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request
get_next_assets(n)

Gets the next set of Assets in this list which must be less than or equal to the return from available().

Parameters:n (cardinal) – the number of Asset elements requested which must be less than or equal to available()
Returns:an array of Asset elements.The length of the array is less than or equal to the number specified.
Return type:osid.repository.Asset
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

Asset Content

class dlkit.repository.objects.AssetContent

Bases: dlkit.osid.objects.OsidObject, dlkit.osid.markers.Subjugateable

AssetContent represents a version of content represented by an Asset.

Although AssetContent is a separate OsidObject with its own Id to distuinguish it from other content inside an Asset, AssetContent can only be accessed through an Asset.

Once an Asset is selected, multiple contents should be negotiated using the size, fidelity, accessibility requirements or application evnironment.

asset_id

Gets the Asset Id corresponding to this content.

Returns:the asset Id
Return type:osid.id.Id
asset

Gets the Asset corresponding to this content.

Returns:the asset
Return type:osid.repository.Asset
accessibility_types

Gets the accessibility types associated with this content.

Returns:list of content accessibility types
Return type:osid.type.TypeList
has_data_length()

Tests if a data length is available.

Returns:true if a length is available for this content, false otherwise.
Return type:boolean
data_length

Gets the length of the data represented by this content in bytes.

Returns:the length of the data stream
Return type:cardinal
Raise:IllegalStatehas_data_length() is false
data

Gets the asset content data.

Returns:the length of the content data
Return type:osid.transport.DataInputStream
Raise:OperationFailed – unable to complete request
has_url()

Tests if a URL is associated with this content.

Returns:true if a URL is available, false otherwise
Return type:boolean
url

Gets the URL associated with this content for web-based retrieval.

Returns:the url for this data
Return type:string
Raise:IllegalStatehas_url() is false
get_asset_content_record(asset_content_content_record_type)

Gets the asset content record corresponding to the given AssetContent record Type.

This method is used to retrieve an object implementing the requested record. The asset_record_type may be the Type returned in get_record_types() or any of its parents in a Type hierarchy where has_record_type(asset_record_type) is true .

Parameters:asset_content_content_record_type (osid.type.Type) – the type of the record to retrieve
Returns:the asset content record
Return type:osid.repository.records.AssetContentRecord
Raise:NullArgumentasset_content_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(asset_content_record_type) is false

Asset Content Form

class dlkit.repository.objects.AssetContentForm

Bases: dlkit.osid.objects.OsidObjectForm, dlkit.osid.objects.OsidSubjugateableForm

This is the form for creating and updating content for AssetContent.

Like all OsidForm objects, various data elements may be set here for use in the create and update methods in the AssetAdminSession. For each data element that may be set, metadata may be examined to provide display hints or data constraints.

accessibility_type_metadata

Gets the metadata for an accessibility type.

Returns:metadata for the accessibility types
Return type:osid.Metadata
add_accessibility_type(accessibility_type)

Adds an accessibility type.

Multiple types can be added.

Parameters:accessibility_type (osid.type.Type) – a new accessibility type
Raise:InvalidArgumentaccessibility_type is invalid
Raise:NoAccessMetadata.isReadOnly() is true
Raise:NullArgumentaccessibility_t_ype is null
remove_accessibility_type(accessibility_type)

Removes an accessibility type.

Parameters:accessibility_type (osid.type.Type) – accessibility type to remove
Raise:NoAccessMetadata.isReadOnly() is true
Raise:NotFound – acessibility type not found
Raise:NullArgumentaccessibility_type is null
accessibility_types
data_metadata

Gets the metadata for the content data.

Returns:metadata for the content data
Return type:osid.Metadata
data

Sets the content data.

Parameters:data (osid.transport.DataInputStream) – the content data
Raise:InvalidArgumentdata is invalid
Raise:NoAccessMetadata.isReadOnly() is true
Raise:NullArgumentdata is null
url_metadata

Gets the metadata for the url.

Returns:metadata for the url
Return type:osid.Metadata
url

Sets the url.

Parameters:url (string) – the new copyright
Raise:InvalidArgumenturl is invalid
Raise:NoAccessMetadata.isReadOnly() is true
Raise:NullArgumenturl is null
get_asset_content_form_record(asset_content_record_type)

Gets the AssetContentFormRecord corresponding to the given asset content record Type.

Parameters:asset_content_record_type (osid.type.Type) – an asset content record type
Returns:the asset content form record
Return type:osid.repository.records.AssetContentFormRecord
Raise:NullArgumentasset_content_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(asset_content_record_type) is false

Asset Content List

class dlkit.repository.objects.AssetContentList

Bases: dlkit.osid.objects.OsidList

Like all OsidLists, AssetContentList provides a means for accessing AssetContent elements sequentially either one at a time or many at a time.

Examples: while (acl.hasNext()) { AssetContent content = acl.getNextAssetContent(); }

or
while (acl.hasNext()) {
AssetContent[] contents = acl.getNextAssetContents(acl.available());

}

next_asset_content

Gets the next AssetContent in this list.

Returns:the next AssetContent in this list. The has_next() method should be used to test that a next AssetContent is available before calling this method.
Return type:osid.repository.AssetContent
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request
get_next_asset_contents(n)

Gets the next set of AssetContents in this list which must be less than or equal to the return from available().

Parameters:n (cardinal) – the number of AssetContent elements requested which must be less than or equal to available()
Returns:an array of AssetContent elements.The length of the array is less than or equal to the number specified.
Return type:osid.repository.AssetContent
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request

Repository Form

class dlkit.repository.objects.RepositoryForm

Bases: dlkit.osid.objects.OsidCatalogForm

This is the form for creating and updating repositories.

Like all OsidForm objects, various data elements may be set here for use in the create and update methods in the RepositoryAdminSession. For each data element that may be set, metadata may be examined to provide display hints or data constraints.

get_repository_form_record(repository_record_type)

Gets the RepositoryFormRecord corresponding to the given repository record Type.

Parameters:repository_record_type (osid.type.Type) – a repository record type
Returns:the repository form record
Return type:osid.repository.records.RepositoryFormRecord
Raise:NullArgumentrepository_record_type is null
Raise:OperationFailed – unable to complete request
Raise:Unsupportedhas_record_type(repository_record_type) is false

Repository List

class dlkit.repository.objects.RepositoryList

Bases: dlkit.osid.objects.OsidList

Like all OsidLists, RepositoryList provides a means for accessing Repository elements sequentially either one at a time or many at a time.

Examples: while (rl.hasNext()) { Repository repository = rl.getNextRepository(); }

or
while (rl.hasNext()) {
Repository[] repositories = rl.getNextRepositories(rl.available());

}

next_repository

Gets the next Repository in this list.

Returns:the next Repository in this list. The has_next() method should be used to test that a next Repository is available before calling this method.
Return type:osid.repository.Repository
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request
get_next_repositories(n)

Gets the next set of Repository elements in this list which must be less than or equal to the return from available().

Parameters:n (cardinal) – the number of Repository elements requested which must be less than or equal to available()
Returns:an array of Repository elements.The length of the array is less than or equal to the number specified.
Return type:osid.repository.Repository
Raise:IllegalState – no more elements available in this list
Raise:OperationFailed – unable to complete request