Posts

Showing posts with the label DAM

Add a custom button in AEM DAM console and validate the asset Before Deleting

Image
Add a custom button in AEM DAM Console (Touch UI) Sling Merger is the best way to overlay and hide/add any buttons in components or even AEM consoles. If you would like to do any custom action on the assets, for ex: Validate the asset before deleting, you can follow the below process. Use Case Scenario: When we select the asset and click on the delete, there is no way of holding that activity, we can catch the events by using Event Listeners and do any activity post deletion, but if you would like to make any check's before deletion and stop deleting the asset, There are a couple of options for this requirement 1. Create a workflow and assign the workflow to the asset to do the activity 2. Add a custom button and call a servlet to do required actions, if you are satisifed the conditions in the servlet, you can delete it directly or you can hold the deletion and send emails or any other actions. You can even call a workflow from the servlet to do the activity if any ...

Delete DAM Asset using Workflow

This article shows you to create a simple workflow process step and use it for deleting an DAM Asset. You can ask me why do I need a workflow when I can delete it directly using the delete button :) The intention is to validate the asset information before deleting the asset or trigger any other workflow for the asset and do manipulations like updating the asset data to an user before the deletion as you will not be able to get that post deletion. you can catch the events in the Event Listeners, but there will be no data by then. Simple Workflow Process Step Create a workflow process step by using the below example package com.flash.aem.core.workflow; import java.util.HashMap; import java.util.Map; import javax.jcr.Node; import javax.jcr.RepositoryException; import javax.jcr.Session; import org.apache.sling.api.resource.LoginException; import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.api.resource.ResourceResolverFactory; import org.osgi....