Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

DAM admin delete button functionality customization

Avatar

Avatar
Validate 1
Level 2
radhakrishnan72
Level 2

Likes

4 likes

Total Posts

28 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
radhakrishnan72
Level 2

Likes

4 likes

Total Posts

28 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile
radhakrishnan72
Level 2

23-01-2018

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

276 likes

Total Posts

1,502 posts

Correct Reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

276 likes

Total Posts

1,502 posts

Correct Reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
edubey
Level 10

23-01-2018

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

Answers (9)

Answers (9)

Avatar

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

276 likes

Total Posts

1,502 posts

Correct Reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

276 likes

Total Posts

1,502 posts

Correct Reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
edubey
Level 10

24-01-2018

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

Avatar

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

276 likes

Total Posts

1,502 posts

Correct Reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

276 likes

Total Posts

1,502 posts

Correct Reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
edubey
Level 10

24-01-2018

Above mentioned file by you is used in Classic UI

1401969_pastedImage_0.png

Are you using touch UI?

Avatar

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

276 likes

Total Posts

1,502 posts

Correct Reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

276 likes

Total Posts

1,502 posts

Correct Reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
edubey
Level 10

23-01-2018

Just tried, I am able to see added console logs in browser

1401418_pastedImage_0.png

1401456_pastedImage_1.png

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

Avatar

Avatar
Validate 1
Level 3
Qamar_khan
Level 3

Likes

17 likes

Total Posts

30 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile

Avatar
Validate 1
Level 3
Qamar_khan
Level 3

Likes

17 likes

Total Posts

30 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Ignite 3
Ignite 1
Give Back 5
Give Back 3
View profile
Qamar_khan
Level 3

14-09-2018

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

1571388_pastedImage_8.png

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."

Avatar

Avatar
Validate 1
Level 2
ramya_reddy
Level 2

Likes

7 likes

Total Posts

23 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
ramya_reddy
Level 2

Likes

7 likes

Total Posts

23 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
ramya_reddy
Level 2

05-02-2018

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

Avatar

Avatar
Validate 1
Level 2
radhakrishnan72
Level 2

Likes

4 likes

Total Posts

28 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
radhakrishnan72
Level 2

Likes

4 likes

Total Posts

28 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile
radhakrishnan72
Level 2

24-01-2018

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.

Avatar

Avatar
Validate 1
Level 2
radhakrishnan72
Level 2

Likes

4 likes

Total Posts

28 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
radhakrishnan72
Level 2

Likes

4 likes

Total Posts

28 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile
radhakrishnan72
Level 2

24-01-2018

Hi Edubey,

                  yes, you are correct. We don't use this classic UI at all. We use Touch UI only.

Thanks & Regards,

Radhakrishna.

Avatar

Avatar
Validate 1
Level 2
radhakrishnan72
Level 2

Likes

4 likes

Total Posts

28 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
radhakrishnan72
Level 2

Likes

4 likes

Total Posts

28 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile
radhakrishnan72
Level 2

24-01-2018

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.

Avatar

Avatar
Validate 1
Level 2
radhakrishnan72
Level 2

Likes

4 likes

Total Posts

28 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
radhakrishnan72
Level 2

Likes

4 likes

Total Posts

28 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile
radhakrishnan72
Level 2

23-01-2018

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.