I have added a few fields in the properties tab of asset. i wanted to work with these fields and manipulate the data. What should be the approach?
Solved! Go to Solution.
Views
Replies
Total Likes
I believe after manipulation , you need to activate the modified assets also. Please correct me.
Option1> You can use bulk editor to manipulate/edit the values. No coding would be required. But you have to think about activation separately.
Option2> You can write a groovy script to access those fields and manipulate the data. You need to run the same script on author and publish instances individually. This will help you to avoid replication/activation process and we won't be seeing queues are stuck or queue is active - # pending if you are dealing with so huge number of assets.
No code deployment will be required. But you need to spend time to run the script on author and multiple publish instances individually.
Option3> As @Sachin_Arora_ has mentioned you can write a workflow and here you can incorporate approval process before publishing/activation. Code deployment would be required.
Hello @Shaheena_Sheikh ,
The properties of the asset(metadata) values will be stored in asset/jcr:content/metadata node. This can be programatically updated using by using below approaches
Reference:
You can use workflows to do manipulation of the asset metadata. There are few workflows like XMP writeback which gets executed automatically once author saves properties or asset metadata. You can add custom workflow process step in the same workflow or create new one.
If you create a new workflow, you need to add launcher so that workflow gets execute once data is updated on asset metadata(ASSET_PATH/jcr:content/metadata).
Code Snippet for update of Asset's title
Resource res = resourceResolver.getResource("/content/dam/test/asset.jpg"); Resource metadataRes =res.getChild("jcr:content/metadata"); ModifiableValueMap map = metadataRes.adaptTo(ModifiableValueMap.class); //set metadata map.put("dc:title", "Updated Title"); resourceResolver.commit();
I believe after manipulation , you need to activate the modified assets also. Please correct me.
Option1> You can use bulk editor to manipulate/edit the values. No coding would be required. But you have to think about activation separately.
Option2> You can write a groovy script to access those fields and manipulate the data. You need to run the same script on author and publish instances individually. This will help you to avoid replication/activation process and we won't be seeing queues are stuck or queue is active - # pending if you are dealing with so huge number of assets.
No code deployment will be required. But you need to spend time to run the script on author and multiple publish instances individually.
Option3> As @Sachin_Arora_ has mentioned you can write a workflow and here you can incorporate approval process before publishing/activation. Code deployment would be required.
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies