Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Trash Can layer for AEM Assets

Avatar

Avatar
Validate 1
Level 2
ramya_reddy
Level 2

Likes

7 likes

Total Posts

23 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
ramya_reddy
Level 2

Likes

7 likes

Total Posts

23 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
ramya_reddy
Level 2

06-02-2018

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

Replies

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,077 likes

Total Posts

3,112 posts

Correct Reply

1,060 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,077 likes

Total Posts

3,112 posts

Correct Reply

1,060 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

07-02-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

Avatar

Avatar
Validate 1
Level 2
ramya_reddy
Level 2

Likes

7 likes

Total Posts

23 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
ramya_reddy
Level 2

Likes

7 likes

Total Posts

23 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
ramya_reddy
Level 2

07-02-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

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

07-02-2018

Post a pic of your workflow model. Lets see if he can help improve it.

Avatar

Avatar
Validate 1
Level 2
ramya_reddy
Level 2

Likes

7 likes

Total Posts

23 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
ramya_reddy
Level 2

Likes

7 likes

Total Posts

23 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
ramya_reddy
Level 2

08-02-2018

Hi smacdonald2008​,

Here are the worklfow launcher and workflow modal created. The workflow modal includes a process step which does copy of asset to trash folder in DAM. This workflow is triggered when any DAM users delete any assets in the DAM. The issue is that the assets gets deleted already before it is copied to the trash folder, since this workflow is triggered on Remove event type. Is there any other way to overcome this issue?

trashcan-workflow-launcher.PNG

workflow-modal-trashcan.PNG

Thanks,

Ramya

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

08-02-2018

You need to redefine the Model. Make the model something like this:

1- Move Asset

2- Delete Asset

That way - the asset will be there when step 1 moves it. Run the WF on the Asset --

RunWFOnAsset.png

Avatar

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,077 likes

Total Posts

3,112 posts

Correct Reply

1,060 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Coach
Employee
Jörg_Hoh
Employee

Likes

1,077 likes

Total Posts

3,112 posts

Correct Reply

1,060 solutions
Top badges earned
Coach
Give back 600
Ignite 5
Ignite 3
Ignite 1
View profile
Jörg_Hoh
Employee

08-02-2018

The problem is that the workflow is triggered after the asset has been already removed. At that time it simply does not exist anymore.

You cannot rely on the workflow trigger, but you need to activly trigger the workflow (instead of just deleting the asset). The easiest way is to remove the "delete" privilege for all users and change the "request for deletion" to your needs.

Jörg

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

08-02-2018

I am going to code this in a WF - if you want to move the asset to another folder (maybe a copy of the asset). Then  delete the original in the workflow.

Avatar

Avatar
Validate 1
Level 2
ramya_reddy
Level 2

Likes

7 likes

Total Posts

23 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
ramya_reddy
Level 2

Likes

7 likes

Total Posts

23 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
ramya_reddy
Level 2

08-02-2018

Hi Jörg,

Thanks for your inputs! The issue is we cannot deny delete permissions on assets for these DAM users, since that would restrict lot of other Assets functionality for them(like deleting comments, share link, relate/unrelate etc).

We are expecting that when the users delete assets (either from UI or Desktop App), they should be moved to a trash folder. Handling this from the UI can probably be done by customizing the Delete button. But this seems to be a challenge when users use Desktop app to delete any assets.

Can we overlay the OOTB Delete servlet to achieve this?

Thanks,

Ramya

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

08-02-2018

The solution is a workflow - step A for the payload - make a copy and move it the Trash folder and Step B is to delete the original payload. There is no need to modify the Delete button - not even sure how you would do that.

Therefore you would have your users run the workflow on the Asset when they want to delete it.