...
BIT
Use the Digizuite serviceIAssetSearchService
andIMetadataValueService
.
First we fetch the asset. Then creates a new instance ofBitMetadataUpdate
. TheTargetItemIds
is the itemId of the asset we just fetched. TheMetaFieldItemGuid
is the GUID of the metafield you wants to update. As you can see in the ApplyUpdate, it takes a list of updates. So you have the options to bulk update metadata for an asset.Code Block var assetSearchService = app.Services.GetRequiredService<IAssetSearchService>(); var metadataValueService = app.Services.GetRequiredService<IMetadataValueService>(); var asset = await assetSearchService.GetAsset(75); var metadataUpdate = new BitMetadataUpdate { Value = true, TargetItemIds = new HashSet<int> { asset.ItemId }, MetaFieldItemGuid = Guid.Parse("<GUID of Metafield>") }; await metadataValueService.ApplyUpdate<MetadataUpdate>(new[] { metadataUpdate});
INT
Use the Digizuite serviceIAssetSearchService
andIMetadataValueService
.
First we fetch the asset. Then creates a new instance ofIntMetadataUpdate
. TheTargetItemIds
is the itemId of the asset we just fetched. TheMetaFieldItemGuid
is the GUID of the metafield you wants to update. As you can see in the ApplyUpdate, it takes a list of updates. So you have the options to bulk update metadata for an asset.Code Block var assetSearchService = app.Services.GetRequiredService<IAssetSearchService>(); var metadataValueService = app.Services.GetRequiredService<IMetadataValueService>(); var asset = await assetSearchService.GetAsset(75); var metadataUpdate = new IntMetadataUpdate { Value = 99, TargetItemIds = new HashSet<int> { asset.ItemId }, MetaFieldItemGuid = Guid.Parse("<GUID of Metafield>") }; await metadataValueService.ApplyUpdate<MetadataUpdate>(new[] { metadataUpdate});
STRING
Use the Digizuite serviceIAssetSearchService
andIMetadataValueService
.
First we fetch the asset. Then creates a new instance ofStringMetadataUpdate
. TheTargetItemIds
is the itemId of the asset we just fetched. TheMetaFieldItemGuid
is the GUID of the metafield you wants to update. As you can see in the ApplyUpdate, it takes a list of updates. So you have the options to bulk update metadata for an asset.Code Block var assetSearchService = app.Services.GetRequiredService<IAssetSearchService>(); var metadataValueService = app.Services.GetRequiredService<IMetadataValueService>(); var asset = await assetSearchService.GetAsset(75); var metadataUpdate = new StringMetadataUpdate { Value = "Update metafield string", TargetItemIds = new HashSet<int> { asset.ItemId }, MetaFieldItemGuid = Guid.Parse("<GUID of Metafield>") }; await metadataValueService.ApplyUpdate<MetadataUpdate>(new[] { metadataUpdate});
COMBOVALUE
Use the Digizuite serviceIAssetSearchService
andIMetadataValueService
.
First we fetch the asset. Then creates a new instance ofComboValueMetadataUpdate
. TheTargetItemIds
is the itemId of the asset we just fetched. TheMetaFieldItemGuid
is the GUID of the metafield you wants to update.
TheComboValue
can either be set to an existing combovalue or create an new combovalue.new ExistingCombo(50170)
ornew DynamicCombo { Label = "test" , OptionValue = "test" }
.
As you can see in the ApplyUpdate, it takes a list of updates. So you have the options to bulk update metadata for an asset.Code Block var assetSearchService = app.Services.GetRequiredService<IAssetSearchService>(); var metadataValueService = app.Services.GetRequiredService<IMetadataValueService>(); var asset = await assetSearchService.GetAsset(75); var metadataUpdate = new ComboValueMetadataUpdate { ComboValue = new ExistingCombo(50170), TargetItemIds = new HashSet<int> { asset.ItemId }, MetaFieldItemGuid = Guid.Parse("<GUID of Metafield>") }; await metadataValueService.ApplyUpdate<MetadataUpdate>(new[] { metadataUpdate});
MULTICOMBOVALUE
Use the Digizuite serviceIAssetSearchService
andIMetadataValueService
.
First we fetch the asset. Then creates a new instance ofMultiComboValueMetadataUpdate
. TheTargetItemIds
is the itemId of the asset we just fetched. TheMetaFieldItemGuid
is the GUID of the metafield you wants to update.
TheComboValues
can either be a set of existings combovalues or create an new combovalues.new ExistingCombo(50170)
ornew DynamicCombo { Label = "test" , OptionValue = "test" }
.
As you can see in the ApplyUpdate, it takes a list of updates. So you have the options to bulk update metadata for an asset.Code Block var assetSearchService = app.Services.GetRequiredService<IAssetSearchService>(); var metadataValueService = app.Services.GetRequiredService<IMetadataValueService>(); var asset = await assetSearchService.GetAsset(75); var metadataUpdate = new MultiComboValueMetadataUpdate { ComboValues = new List<BaseInputCombo> { new ExistingCombo(50175), new ExistingCombo(50174) }, TargetItemIds = new HashSet<int> { asset.ItemId }, MetaFieldItemGuid = Guid.Parse("<GUID of Metafield>") }; await metadataValueService.ApplyUpdate<MetadataUpdate>(new[] { metadataUpdate});
DATETIME
Use the Digizuite serviceIAssetSearchService
andIMetadataValueService
.
First we fetch the asset. Then creates a new instance ofDateTimeMetadataUpdate
. TheTargetItemIds
is the itemId of the asset we just fetched. TheMetaFieldItemGuid
is the GUID of the metafield you wants to update. As you can see in the ApplyUpdate, it takes a list of updates. So you have the options to bulk update metadata for an asset.Code Block var assetSearchService = app.Services.GetRequiredService<IAssetSearchService>(); var metadataValueService = app.Services.GetRequiredService<IMetadataValueService>(); var asset = await assetSearchService.GetAsset(75); var metadataUpdate = new DateTimeMetadataUpdate { Value = DateTime.Now, TargetItemIds = new HashSet<int> { asset.ItemId }, MetaFieldItemGuid = Guid.Parse("<GUID of Metafield>") }; await metadataValueService.ApplyUpdate<MetadataUpdate>(new[] { metadataUpdate});
TREE
Use the Digizuite serviceIAssetSearchService
andIMetadataValueService
.
First we fetch the asset. Then creates a new instance ofTreeMetadataUpdate
. TheTargetItemIds
is the itemId of the asset we just fetched. TheMetaFieldItemGuid
is the GUID of the metafield you wants to update.
TheTreeValues
can eather be a set of existingsExistingTreeNode
or create new treenodes by using theDynamicTopDownTreeNode
.
As you can see in the ApplyUpdate, it takes a list of updates. So you have the options to bulk update metadata for an asset.Code Block var assetSearchService = app.Services.GetRequiredService<IAssetSearchService>(); var metadataValueService = app.Services.GetRequiredService<IMetadataValueService>(); var asset = await assetSearchService.GetAsset(75); var metadataUpdate = new TreeMetadataUpdate { TreeValues = new ValueList<BaseTreeNodeUpdate> { new ExistingTreeNode(2) }, TargetItemIds = new HashSet<int> { asset.ItemId }, MetaFieldItemGuid = Guid.Parse("<GUID of Metafield>") }; await metadataValueService.ApplyUpdate<MetadataUpdate>(new[] { metadataUpdate});
EDITCOMBOVALUE
EDITMULTICOMBOVALUE
...