Change Delete function on author to deactivate and delete | Community
Skip to main content
anjabed
Level 2
August 22, 2024
Solved

Change Delete function on author to deactivate and delete

  • August 22, 2024
  • 2 replies
  • 2423 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

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.


Hi 

Please check

Disable Delete button

https://aemexperience.wordpress.com/2020/03/07/aem-permission-tricks-remove-delete-access-without-impacting-move/ 

 

Create New Delete button

https://blogs.perficient.com/2023/10/06/aem-customization-how-to-add-a-custom-action-button-to-the-aem-assets-action-bar-menu/ 

https://medium.com/@theopendle/aem-adding-a-button-to-a-touchui-toolbar-ae1d1dc1c530 

2 replies

arunpatidar
Community Advisor
Community Advisor
August 22, 2024

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
anjabed
anjabedAuthor
Level 2
August 22, 2024

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?

arunpatidar
Community Advisor
Community Advisor
August 22, 2024

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

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

 

 

Arun Patidar
TarunKumar
Community Advisor
Community Advisor
August 22, 2024

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

anjabed
anjabedAuthor
Level 2
August 22, 2024

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.