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.
Attributes¶
Methods Signature¶
|
EraseMetaData removes meta data from the asset. |
Returns the meta data of this asset. |
|
|
Returns the translated string from a asset. |
|
Returns the |
Returns True if this asset description is a delete marker. |
|
|
Loads the asset. |
|
Stores data for the meta data attribute #attr of this asset. |
|
Stores the name of an asset for a language. |
|
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
-
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.
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
-
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
attr (
maxon.InternedId
) – The meta data attribute.data (
maxon.Data
) – The value to set.kind (
maxon.AssetMetaDataInterface.KIND
) – The kind of the meta data.
-
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
metaId (
maxon.InternedId
) – The identifier of the meta data attribute.source (
maxon.Url
) – The source which shall be copied as meta data to asset. Pass empty Url to erase meta data.kind (
maxon.AssetMetaDataInterface.KIND
) – The kind of the meta data.