There is a requirement from business to change the default AEM deletion functionality.
Current functionality: When an already activated asset/web page is deleted from author instance, AEM first deactivates the asset/web page (results in deletion of the same from Publisher instance) and then it deletes the page from author.
Expected functionality: When an already activated asset/web page is deleted from author instance, AEM should not deactivate the asset/web page from publisher and instead only delete the page from author instance.
Although, AEM is following a good practice to deactivate first from publisher and then delete from author which will not result in creation of ghost pages. Business wants to follow an approach where we can avoid unintentional deletes from authors/producers which doesn't result in deletion of the content from all the instances.
I kind off reverse engineered the AEM delete process which executes a servlet call /bin/wcmcommand with parameter 'deletePage', however it is the core functionality and I want to understand the best approach before making any change.
P.S. We are using AEM v6.3
Any response will be appreciated.
First, Why you need this. If you don't want to delete assets/web page from Publisher, just don't delete.
If you change the functionality, which only deletes page/assets at the author, how would you delete/unpublished things later at publish environment?
It is just to avoid unintentional delete. We have had such scenario where one of the author mistakenly deleted a folder of assets from author instance (which deactivated the asset from publisher and then deleted the asset folder from author). Since this type of activity is not reversible and we had no backup of that asset folder containing number of documents and files, we had no option to restore the files.
Apart from being cautious, can this situation be avoided? Any approach here to disable deactivation on deletion when we click 'Delete' option from siteadmin?
The alternative is to disable/hide delete button and introduce delete workflow with participant step to approve/reject deletion and then delete page/assets using java api.
Overlay /libs/dam/gui/content/assets/jcr:content/actions/selection/delete/granite:rendercondition to apps folder i.e.
and add following properties to this granite:rendercondition node
I was able to hide the delete button by using sling resource merger but the new challenge is to show a new button and trigger workflow from it. Thanks a lot in advance.
I need to disable or enable "delete button" on some basis ...
for example : for pdf docx ppt these kind of assets i want "delete button" to be disabled
and for multimedia and images i want "delete button " to be enabled
You should be creating a set of users or groups who can only delete the folders or publish the content.
In this usecase you dont need to write any custom code rather you need to create proper set of users with correct permission and sets of users to review or approve you can use OOB workflows as well.