Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Change Delete function on author to deactivate and delete

Avatar

Level 2

We have 6.5 SP18.

We have this structur on Author which is activated

Folder

   - Page 1

   - Page 2

 

I deaktivate the folder on author instance:

I have three events on publisher

  • delete Page 1
  • delete Page 2
  • delete Folder

 

I delete the folder on author instance:

I have one event on publisher

  • delete Folder

 

My question: How can I get the three events on publisher when deleting a folder because I need them to update our external search index.

My idea: change the delete on author to deaktivate and delete but I do not know how.

I allready tried: To intercept the delete event on publisher does not help because the folder and the Pages are allready deleted so I could not get information about the Pages that was under the folder. I found no way to start befor the deletion starts on publisher.

I hope someone can help me!

 

Thank you,

Anja

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
9 Replies

Avatar

Community Advisor

Hi @anjabed 
You can hide the OOTB 'delete' button using ACL and create a workflow to delete folder/page. Use workflow to deactivate/delete and have a process step in between to capture all the payloads including children.



Arun Patidar

Avatar

Level 2

The author must be able to delete a folder so deactivating the "delete" button will not help.
The workflows I found and tried to change them but they are not used when using the delete Button. Can I "hang" the workflow behind the delete button? When this is possible how can we do this?

Avatar

Community Advisor

Hi @anjabed 
Could you please explain which folder? you meant in DAM?

I think it is possible to create workflows with folder as well

 

arunpatidar_0-1724321124474.png

 



Arun Patidar

Avatar

Level 2

Normal pages under /content/.

I just found the delete.js which starts the deletion when clicking the button. Perhaps I can change it like the unpublish.js or add the unpublish before starting delete.js.

Avatar

Level 2

No, changing the delete.js will not work because the function delete just delete the selected folder and not the items unter the pages under the folder. 
The unpublish command seams to work different and unpublish the folder and the pages under the folder individualy.

So I need help to "disable" the delete button and put a new "delete" button on the page which starts the workflow.

Avatar

Correct answer by
Community Advisor

Avatar

Level 2

Thanks, I will try it but the documentation is just for assets and I need it unter sites. But I will search for it and try it an will give an report if it works or not.

Avatar

Community Advisor

Hi @anjabed ,

 

You can try using query builder to run a query which will find all the deactivated & deleted pages.
All these pages will reside under var folder.
The query will look something like below:

            map.put("group.type", "cq:AuditEvent");
            map.put("group.path", "/var/audit/com.day.cq.replication" + <variable-page-path>);
            map.put("group.property", "cq:type");
            map.put("group.property.1_value", "Deactivate");
            map.put("group.property.2_value", "Delete");

 

 

-Tarun

Avatar

Level 2

Sorry, this does not help because the information is just on author. I would need it on publisher. An deleting the folder just add one note with delete for the folder and not delete notes for the pages under the folder. I just checked it.