listeners involving dam assets | Community
Skip to main content
adobefor
Level 2
October 16, 2015
Solved

listeners involving dam assets

  • October 16, 2015
  • 1 reply
  • 1384 views

Hi, I have a pathfield via which a dam asset would be selected (say Image). I want to have a listener attached to the pathfield which validates the size of the selected image. For that I would require asset api and resource resolver. By any chance is there a way to have these working inside a listener? I couldn't find any listener using these objects or could it be done? Thanks!

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

To create an event listener for an AEM DAM handler - you use the com.day.cq.dam.commons.handler.AbstractAssetHandler API.  The handler is also implemented as an OSGi bundle - not on an event of a PathField. 

This is fired when an Assets is uploaded for example to the DAM. For information about how to write an AEM DAM Handler - see: 

Creating a Custom AEM Dam Media Handler

1 reply

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

To create an event listener for an AEM DAM handler - you use the com.day.cq.dam.commons.handler.AbstractAssetHandler API.  The handler is also implemented as an OSGi bundle - not on an event of a PathField. 

This is fired when an Assets is uploaded for example to the DAM. For information about how to write an AEM DAM Handler - see: 

Creating a Custom AEM Dam Media Handler