Trash Can layer for AEM Assets | Community
Skip to main content
Level 2
February 6, 2018

Trash Can layer for AEM Assets

  • February 6, 2018
  • 1 reply
  • 10341 views

Hi,

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!

Thanks,

Ramya

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

1 reply

joerghoh
Adobe Employee
Adobe Employee
February 7, 2018

Hi,

as Scott already mentioned that's something one would implement as workflow and use the Sling API to move the resource tree of the asset to a different location.

On the other hand be aware that there might be versions already available for an asset, so technically you could use this versioning information to restore the asset if needed. That's probably a bit harder to implement (you don't have a specific "trash" folder etc) but something to consider.

Jörg

Level 2
February 8, 2018

Hi Jörg & smacdonald2008​,

I used a workflow launcher to trigger a custom workflow process for 'Remove' event type on dam:Asset type, to copy the asset to the trash folder. But by the time this workflow process is executed, the asset is already deleted and I am getting a null pointer exception.

I guess there would be a similar error if I use an event listener.

Am I missing something?

Thanks for your help!

Ramya

smacdonald2008
Level 10
February 11, 2018

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.

Article -- Scott's Digital Community: Modifying Digital Assets using Adobe Experience Manager Workflows


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.

Notice that the asset is in Trash folder.