Expand my Community achievements bar.

SOLVED

listeners involving dam assets

Avatar

Level 2

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!

1 Accepted Solution

Avatar

Correct answer by
Level 10

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

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

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