Hi everyone,
i am trying to customize delete button functionality. I copied /libs/cq/ui/widgets/source/widgets/wcm/DamAdmin.Actions.js to /apps folder.
I have to call custom servlet, when delete button is hit for any asset/node deletion. It still calls out of the box delete logic internally. I could not find where exactly i have to call my servlet when delete button is clicked. Could anyone suggest me?
Thanks & Regards,
Radhakrishna
Solved! Go to Solution.
File /libs/cq/ui/widgets/source/widgets/wcm/DamAdmin.Actions.js
For deleting a asset, this method gets called
CQ.wcm.DamAdmin.deleteAsset which further calls CQ.wcm.DamAdmin.internalDeleteAsset
LIne 162 is the success callback once these assets are deleted
File /libs/cq/ui/widgets/source/widgets/wcm/DamAdmin.Actions.js
For deleting a asset, this method gets called
CQ.wcm.DamAdmin.deleteAsset which further calls CQ.wcm.DamAdmin.internalDeleteAsset
LIne 162 is the success callback once these assets are deleted
Hi Edubey,
sorry for posting unnecessary script of the JS file.
i appreciate your quick help here. Yes, you are correct. It executes deleteAsset method. I could not see the control coming to (/libs/cq/ui/widgets/source/widgets/wcm/DamAdmin.Actions.js) file. I have cleaned up the connect from this js and deleted asset. Asset is getting deleted even when there is nothing to handle in the JS file. Please let me know, if i forgot anything here.
Thanks & Regards,
Radhakrishna.
Views
Replies
Total Likes
Just tried, I am able to see added console logs in browser
These are huge clientlibs and gets cached at browser as well as /var/clientlibs in AEM.
What you can try is to invalidate these files under /var AEM
Use this link to invalidate existing generated clientlibs http://localhost:4502/libs/granite/ui/content/dumplibs.rebuild.html
Hi Edubey,
thanks for such an explanation. I have added some console logs and have invalidated cache and rebuilt libraries. I don't see any console log printed in the console. Then i have removed JS (/libs/cq/ui/widgets/source/widgets/wcm/DamAdmin.Actions.js) content and clientlibs from var folder. I have clicked delete button for one asset and it has been deleted. I am still not sure how is getting deleted.
Thanks & Regards,
Radhakrishna.
Views
Replies
Total Likes
Above mentioned file by you is used in Classic UI
Are you using touch UI?
Hi Edubey,
yes, you are correct. We don't use this classic UI at all. We use Touch UI only.
Thanks & Regards,
Radhakrishna.
Views
Replies
Total Likes
Got it, then you are looking at wrong file.
Used by Classic UI
/libs/cq/ui/widgets/source/widgets/wcm/DamAdmin.Actions.js
Used by Touch UI (line 106)
/libs/dam/gui/coral/components/admin/clientlibs/actions/js/delete.js
Hi Edubey,
many thanks for your quick help. I have got the location where this delete location function deleteResources(force, type) in /libs/dam/gui/coral/components/admin/clientlibs/actions/js/delete.js to do it in Touch UI. I could take it from here for my customization.
Thanks & Regards,
Radhakrishna.
Views
Replies
Total Likes
Hi edubey,
We have a similar usecase to customize the delete functionality to move the assets to a trash can(another location in DAM) before the assets are deleted. We could handle the assets deleted from touch/classic UI by overlaying these JS files and calling our custom servlets.
But I wanted to check how could we handle the assets deleted by the users using the Desktop App? Do we have to overlay the actual delete servlet itself? Any pointers are greatly appreciated.
Thanks in advance!
Ramya
Views
Replies
Total Likes
Hello Radhakrishna,
I need more help on this to override the delete action button.
I have done overlay of /app/dam/gui/coral/components/admin/clientlibs/actions/js/delete.js and trying to calling the delete action on asset selection button as /apps/dam/gui/content/assets/jcr:content/actions/selection/myaction
it calling default "Delete Asset" dialog successfully.
But I want to handle some action on "Delete" button can you help me more on this. The properties of myaction button as below
Thanks
Qamar
" many thanks for your quick help. I have got the location where this delete location function deleteResources(force, type) in /libs/dam/gui/coral/components/admin/clientlibs/actions/js/delete.js to do it in Touch UI. I could take it from here for my customization."
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies