Hi,
When i am trying to update the title of asset [from image1 to image2] in DAM then the title first time its not updated and second time it will shown as a string [] like image1, image2.
when i investigated this further i found that <dc:title> property of metadata node is first time string and if we update this property then it will convert as string[].
Could anyone please suggest how can we get the last updated title as string? Do we need to update the DAM Update Asset Workflow or modify any process in the workflow?
For e.g: image1, image2 where title[0] = image1 and title[1] = image2
Thanks in Advance!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi, there is a suggested method from adobe to handle the metadata values that sometimes can show up as string arays:
//Get the title as string and put it into the tmp variable String tmp = ""; Object titleObj = asset.getMetadata().get("dc:title"); if (titleObj instanceof String) { tmp = titleObj.toString(); } else if (titleObj instanceof Object[]) { Object[] titleArray = (Object[]) titleObj; tmp = (titleArray.length > 0) ? titleArray[0].toString() : ""; }
Hope that will help you :D
/Johan
Views
Replies
Total Likes
Hi, there is a suggested method from adobe to handle the metadata values that sometimes can show up as string arays:
//Get the title as string and put it into the tmp variable String tmp = ""; Object titleObj = asset.getMetadata().get("dc:title"); if (titleObj instanceof String) { tmp = titleObj.toString(); } else if (titleObj instanceof Object[]) { Object[] titleArray = (Object[]) titleObj; tmp = (titleArray.length > 0) ? titleArray[0].toString() : ""; }
Hope that will help you :D
/Johan
Views
Replies
Total Likes
Hi Johan,
Thanks for the reply.
This approach we are using currently but we need to handle it at workflow level may be at some process step. Is there any way to handle it from workflow level?
Regards,
Radhika
Views
Replies
Total Likes
I guess one way of doing that is to handle it in kind of the same way using a custom workflow process.
Have you read this great page about the workflow customizing and extending workflows http://dev.day.com/docs/en/cq/current/workflows/wf-extending.html ? In there there are some good examples of how to write your own processes.
Good Luck
/Johan
Views
Replies
Total Likes
Do you know when the property dc:title is stored as String and when the property dc:title is stored as String[]?? is random this behavior?
Views
Replies
Total Likes
Views
Likes
Replies