내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

AEM Listeners & Events

Avatar

이전 커뮤니티 멤버

How can I capture the asset that triggered a listener in to a variable.

 

In my application:

When a new asset is uploaded to a folder I want to

move it to a different folder.

 

Is there a way to acquire the path or the asset that triggers the event?

I know I can invoke a workflow/use workflow launcher in conjunction with a workflow but I want to do it using the

listener approach.

 

Thanks!

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 10

" I'm trying to get is the Asset "

Look at using this API:

http://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/dam/commons/handler/AbstractAssetHandler.h...

It's the AEM Asset Handler API. We have a community article that shows how to use this API:

https://helpx.adobe.com/experience-manager/using/damhandler.html

This article's use case is to track assets uploaded to the AEM DAM. It will show you how to get up and running with AssetHandler. 

원본 게시물의 솔루션 보기

4 답변 개

Avatar

Level 10

You can.. when you upload an asset, essentially a node will be created. so you can use the node_added listener and do the action. refer [1]

[1] https://helpx.adobe.com/experience-manager/using/events.html

Avatar

이전 커뮤니티 멤버

I understand that, but what I'm trying to get is the Asset that invoked the listener to begin with. I need to capture that into a variable

Maybe a node variable or maybe an Asset variable.

 

Thanks.

Avatar

Level 10

You can get the path of the event and fro the path you can get asset details

when you write an eventlistner and override onEvent(EventIterator itr)

from the EventIterator, get the event and then the path of the event

Check these APIs for the reference

http://www.day.com/specs/jsr170/javadocs/jcr-1.0/javax/jcr/observation/EventIterator.html

http://www.day.com/specs/jsr170/javadocs/jcr-1.0/javax/jcr/observation/Event.html

Avatar

정확한 답변 작성자:
Level 10

" I'm trying to get is the Asset "

Look at using this API:

http://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/dam/commons/handler/AbstractAssetHandler.h...

It's the AEM Asset Handler API. We have a community article that shows how to use this API:

https://helpx.adobe.com/experience-manager/using/damhandler.html

This article's use case is to track assets uploaded to the AEM DAM. It will show you how to get up and running with AssetHandler.