maxon.AssetTypeInterface

Description

Class to store and find any maxon.Data type under any type of key.

Warning

This function is only there to expose a C++ Object to Python.
As a Python developer you normally don’t have to deal with this function.

Inheritance diagram

Inheritance

Parent Class:

Children Classes:

Methods Signature

ComputeMetaData(repository, asset, meta, metaId)

ComputeMetaData to specialize the loading of meta data.

CopyWithEncryption(source, urlFrom, urlTo)

Copies the asset with encryption to the new url.

GetAssetDataType()

Returns the DataType of assets handled by this maxon.AssetType.

GetDefaultIcon(repository, asset, meta)

Returns the default icon of this asset type.

GetId()

Returns the identifier of this asset type.

GetMetaString(asset, key, languageRef, fallback)

Returns the translated string from a asset.

GetRepositoryId(id, fromTo)

Returns the default id of the asset.

GetUrlSuffix(asset)

Returns the maxon.Url suffix (file name ending without the dot) to use for the given asset.

Load(repo, assetDescription, url[, updateLinks])

Loads an asset from a Url.

LoadDescriptionDefinition(asset, mode, …)

Loads the data description of the given asset.

StoreDescriptionDefinition(asset, category, …)

param asset

Asset to store.

StoreMetaString(asset, key, value, languageRef)

Stores the name of an asset for a language.

Methods Definition

AssetTypeInterface.ComputeMetaData(repository, asset, meta, metaId)

ComputeMetaData to specialize the loading of meta data.

Parameters
Returns

Data contains the data. Bool if the value should be cached.

Return type

maxon.Tuple [maxon.Data, maxon.Bool]

AssetTypeInterface.CopyWithEncryption(source, urlFrom, urlTo)

Copies the asset with encryption to the new url.

Parameters
AssetTypeInterface.GetAssetDataType()

Returns the DataType of assets handled by this maxon.AssetType. The data type has to be a reference type derived from maxon.Asset.

Returns

The data type of assets of this maxon.AssetType.

Return type

maxon.DataType

AssetTypeInterface.GetDefaultIcon(repository, asset, meta)

Returns the default icon of this asset type.

Parameters
Returns

Return type

maxon.Url

AssetTypeInterface.GetId()

Returns the identifier of this asset type. This has to be the same as used for the maxon.AssetTypes registry.

Returns

Asset type identifier.

Return type

maxon.Id

AssetTypeInterface.GetMetaString(asset, key, languageRef, fallback)

Returns the translated string from a asset.

Parameters
  • asset (maxon.AssetDescription) – Asset to load.

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

  • languageRef (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

AssetTypeInterface.GetRepositoryId(id, fromTo)

Returns the default id of the asset.

Parameters
  • id (maxon.Id) – Id of the asset.

  • fromTo (bool) – True to add the full id. False to cut the hash code and append it.

Returns

New id on success.

Return type

maxon.Id

AssetTypeInterface.GetUrlSuffix(asset)

Returns the maxon.Url suffix (file name ending without the dot) to use for the given asset.

Parameters

asset (maxon.Asset) – An asset, has to match the expected data type of this maxon.AssetType.

Returns

The Url suffix to use, may be empty.

Return type

maxon.Url

AssetTypeInterface.Load(repo, assetDescription, url, updateLinks=None)

Loads an asset from a Url.

Parameters
  • repo (maxon.AssetRepositoryRef) – The repository to which the asset belongs.

  • assetDescription (maxon.AssetDescription) – The asset description.

  • url (maxon.Url) – The maxon.Url from which the asset shall be loaded.

  • updateLinks (Optional[bool]) –

    None if the asset shall be loaded as is.
    A boolean if asset links which use ASSET_UPDATE_POLICY.IMPLICIT shall be resolved to the latest version.

Returns

The loaded asset and a boolean sets to True whenever there is a link where the resolved version differs from the original version.

Return type

Tuple[maxon.Asset, bool]

AssetTypeInterface.LoadDescriptionDefinition(asset, mode, category, language)

Loads the data description of the given asset.

Parameters
Returns

ataDescriptionDefinition on success.

Return type

maxon.DataDescriptionDefinition

AssetTypeInterface.StoreDescriptionDefinition(asset, category, language, overwrittenDescription, storeRepository)
Parameters
  • asset (maxon.AssetDescription) – Asset to store.

  • category (maxon.Id) – DATADESCRIPTION_CATEGORY_xxx

  • language (maxon.LanguageRef) – Language id in case of DATADESCRIPTION_CATEGORY_STRING.

  • overwrittenDescription (maxon.DataDescriptionDefinition) – Additional description with overwritten parameters.

  • storeRepository (maxon.AssetRepositoryRef) – Repository to store the asset.

Returns

AssetDescription with the new asset on success.

Return type

maxon.AssetDescription

AssetTypeInterface.StoreMetaString(asset, key, value, languageRef)

Stores the name of an asset for a language.

Parameters
  • asset (maxon.AssetDescription) – Asset to modify.

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

  • value (str) – New string.

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