maxon.KeywordAssetInterface¶
Description¶
An Asset represents digital content which can be managed by an maxon.AssetRepositoryRef
“asset repository”.
The management includes versioning, meta data and automatic updates.
Attributes¶
Methods Signature¶
|
Adds a keyword to an asset. |
|
|
|
Returns the default preset for the given type. |
Checks if the given asset is a preset. |
|
|
Returns true if the given asset is a favourite. |
|
Removes a keyword from an asset. |
|
Sets the default state of the given preset asset. |
Methods Definition¶
-
static
KeywordAssetInterface.
AddKeyword
(target, keywordId, userScope, updateUsageRepository)¶ Adds a keyword to an asset.
- Parameters
target (
maxon.AssetDescription
) – Asset to add keywords.keywordId (
maxon.Id
) – Keyword Id to add.userScope (bool) – True to use
maxon.ASSETMETADATA.UserKeywords
otherwisemaxon.ASSETMETADATA.Keywords
.updateUsageRepository (
maxon.AssetRepositoryRef
) – True to update the last used time and use count.
- Returns
True if a keyword was added. False if the keyword was not added - that means it already exists.
- Return type
bool
-
static
KeywordAssetInterface.
Create
()¶ - Returns
A new reference of
maxon.KeywordAssetInterface
.- Return type
-
static
KeywordAssetInterface.
GetDefaultAsset
(type, lookupRepository)¶ Returns the default preset for the given type.
- Parameters
type (
maxon.Id
) – Preset type.lookupRepository (
maxon.AssetRepositoryRef
) – Repository to search for.
- Returns
AssetDescription on success.
- Return type
-
static
KeywordAssetInterface.
GetDefaultAssetState
(ad)¶ Checks if the given asset is a preset.
- Parameters
ad (
maxon.AssetDescription
) – Asset to look at.- Returns
First: True if it is an preset, Second: True if the asset is the default asset.
- Return type
maxon.Tuple
[bool, bool]
-
static
KeywordAssetInterface.
IsFavouriteAsset
(ad)¶ Returns true if the given asset is a favourite.
- Parameters
ad (
maxon.AssetDescription
) – Asset to inspect.- Returns
True if favourite.
- Return type
bool
-
static
KeywordAssetInterface.
RemoveKeyword
(target, keywordId, userScope)¶ Removes a keyword from an asset.
- Parameters
target (
maxon.AssetDescription
) – Asset to remove keywords.keywordId (
maxon.Id
) – Keyword Id to remove.userScope (bool) – True to use
maxon.ASSETMETADATA.UserKeywords
otherwisemaxon.ASSETMETADATA.Keywords
.
- Returns
True if a keyword was found and removed. False if the keyword was not found on the asset.
- Return type
bool
-
static
KeywordAssetInterface.
SetDefaultAsset
(ad, on)¶ Sets the default state of the given preset asset. Every type can only have one preset as default.
- Parameters
ad (
maxon.AssetDescription
) – Asset to modify.on (bool) – True to make this preset the default. False to make it no longer the default.