We have a requirement to implement a trash can layer for AEM Assets. This needs to be functional from both Touch UI and AEM Desktop App.
When users delete any assets(either from Touch UI or Desktop App), assets should be moved to a trash layer/folder in DAM(Copy to trash layer and delete asset in the current location). Our DAM users have delete permissions given on all asset folders.
Is there any recommended way to achieve this for both Touch UI and Desktop App? Appreciate your help!
Here is the Model for your use case - this will work.
We are working on a HELPX Article for this use case. This is a really nice use case in terms of using a custom workflow step and the workflow APIs to achieve this. OOTB - there is no MOVE Asset step. Therefore - how do you do it. The answer is you have to program a custom step that can get the InputStream of the Asset Payload and then create a new Asset in the Trash folder under /DAM/TRASH. You can use the AssetManager API for this task.
Also - this made me realize that we need to explore the AEM Workflow APIs in a more detailed way. As a result - we will be doing this month (FEB 2018) Ask the AEM Community Experts on this subject - sign up soon.
After testing - this is the model that works. Notice the last step - its Delete Node as opposed to Delete Asset (Delete Node deletes the asset). This workflow does exactly what you want. It moves the Asset to /DAM/Trash and then deletes the original asset.
Thanks for your reply and for working on this usecase.
The workflow with the above steps mentioned is not suitable for our requirement. Our DAM users can run this workflow to achieve this functionality, but our users are not expected to run any workflow. Also, this does not cover the usecase when users click on Delete button or delete assets from Desktop app. Since our DAM users will have delete permissions on assets, we need to move assets to trash folder whenever they click on Delete button in UI or whenever they delete from Desktop App. Moving to trash folder should automatically happen whenever users delete assets from DAM.
I have also explored using a workflow launcher, but that does not work either(See my above posts).
You should have your users that can delete asset belong to a workflow user group so they can invoke WFs. As Far as the Delete button, you need to document to your users to invoke the TrashAsset workflow to remove assets, not use the Delete button.
To delete assets using this WF - you need to have a user select the asset from the Asset view.
Select the Workflow button - not Delete button and select the specific workflow.
Once done, the Asset is placed into the Trash folder.
and the original asset is deleted.
This is the best way to achieve your requirements. Adobe does not recommend trying to reverse eng the Delete button, etc, This would not be supported if something broke. This is exactly why Workflows were added to the product. Use the tooling that is part of AEM.