maxon.AssetDescriptionInterface

Description

Represents all meta information about an asset, namely its identifier and version, the maxon.AssetMetaData and some further information. AssetRepositoryInterface.FindAssets() yields the found assets not as maxon.Asset, but as maxon.AssetDescription to avoid unnecessary loading of the assets. When you really need the asset itself you have to call Load on the description.

Inheritance diagram

Inheritance

Parent Class:

Child Class:

Methods Signature

EraseMetaData(attr, kind)

EraseMetaData removes meta data from the asset.

GetMetaData()

Returns the meta data of this asset.

GetMetaString(key[, languageRef, fallback])

Returns the translated string from a asset.

GetUrl()

Returns the maxon.Url where the asset is stored.

IsDeleted()

Returns True if this asset description is a delete marker.

Load([updateLinks])

Loads the asset.

StoreMetaData(attr, data, kind)

Stores data for the meta data attribute #attr of this asset.

StoreMetaString(key, value, languageRef)

Stores the name of an asset for a language.

StoreUrlMetaData(metaId, source, kind)

Copies the file or directory #source as meta data for the meta data attribute #metaId of this asset.

Methods Definition

AssetDescriptionInterface.EraseMetaData(attr, kind)

EraseMetaData removes meta data from the asset.

AssetDescriptionInterface.GetMetaData()

Returns the meta data of this asset.

Returns

The meta data of this asset.

Return type

maxon.AssetMetaData

AssetDescriptionInterface.GetMetaString(key, languageRef=None, fallback='')

Returns the translated string from a asset.

Parameters
  • key (maxon.InternedId) – Attribute id to load. e.g. maxon.OBJECT.BASE.NAME.

  • languageRef (Optional[maxon.LanguageRef]) – Optional language. By default the function uses the current language.

  • fallback (str) – Fallback string if the asset has no name.

Returns

String on success.

Return type

str

AssetDescriptionInterface.GetUrl()

Returns the maxon.Url where the asset is stored.

Returns

The maxon.Url of this asset, may be empty if the asset isn’t accessible through a maxon.Url.

Return type

maxon.Url

AssetDescriptionInterface.IsDeleted()

Returns True if this asset description is a delete marker. Delete markers are stored in repositories upon call of AssetRepositoryInterface.DeleteAsset() to indicate a deleted asset, but previous asset versions still exist in the repository.

Returns

True if this description represents a delete marker, False otherwise.

Return type

bool

AssetDescriptionInterface.Load(updateLinks=None)

Loads the asset. The implementation may use caching to avoid repeated loading of the same asset.

Parameters

updateLinks (Optional[bool]) – None if the asset shall be loaded as is. A bool if asset links which use maxon.ASSET_UPDATE_POLICY.IMPLICIT shall be resolved to the latest version. The bool is set to True by this method whenever there is a link where the resolved version differs from the original version.

Returns

The loaded asset.

Return type

maxon.Asset

AssetDescriptionInterface.StoreMetaData(attr, data, kind)

Stores data for the meta data attribute #attr of this asset. Observers of AssetRepositoryInterface.ObservableMetaDataStored() of the repository of the asset and its derived repositories are informed.

Parameters
AssetDescriptionInterface.StoreMetaString(key, value, languageRef)

Stores the name of an asset for a language.

Parameters
  • key (maxon.InternedId) – Attribute id to save. e.g. maxon.OBJECT.BASE.NAME.

  • value (str) – New String

  • languageRef (Optional[maxon.LanguageRef]) – Optional language. By default the function uses the current language.

AssetDescriptionInterface.StoreUrlMetaData(metaId, source, kind)

Copies the file or directory #source as meta data for the meta data attribute #metaId of this asset. The value of the meta data attribute will be a maxon.Url which points to the local copy within the asset (i.e., not to source) of the form {meta:///assetid/metaid.kind.extension}, so the file name extension of source gets preserved.

Observers of ObservableMetaDataStored of this repository and its derived repositories are informed.

Parameters