Hi, I tried to automate the process and move the asset from one folder to another using workflow in which i moved the asset using assetmanager. However if the same asset is present in the destination folder it is supposed to replace the exiting one but it is not, and i m getting itemExistException when check in to the logs. Please provide any pointers how to replace the existing asset if there is any OOTB functionality need to be enabled for this.
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
Unfortunately the assetManager API does not offer a "move" operation, thus you have to build it yourself using the Sling Resource API (or JCR). In that you have to implement the logic to avoid collisions yourself.
Hi,
Which method are you trying?
Please check - https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/day/cq/dam/api/As...
Let me share my observations during authoring activity associated with create and move operation.
Let's assume that under this /content/dam/we-retail/en/people path one asset named: we-retail.pdf is already available and now you want to upload same file (similar name) from your system.
Here you are doing create operation and this time AEM will give you options like: replace, create versions etc.
During move operation (authoring activity) , we will be able to move same file but after moved file will be renamed as we-retail1.pdf as we already have file named: we-retail.pdf in the same place.
Please note that in AEM , node name represents 'ID' and ID should be unique.
You could validate at your end also.
Now you need to modify the business logic during move operation considering all these points.
One hack would be to check for that asset path before doing the move operation, if it exists, you can delete it and do session save, then move the new one on that path.
Unfortunately the assetManager API does not offer a "move" operation, thus you have to build it yourself using the Sling Resource API (or JCR). In that you have to implement the logic to avoid collisions yourself.
Hi @JJOR could you please elaborate what you are trying to say here.
Views
Replies
Total Likes