Hi,
I am facing the problem below.
I have a workflow to publish a content on a specific node when it is updated.
On the other hand, I have an action on my bundle that has to be executed when this content is activated.
I am following this tutorial below. but my class is not been called when workflow is completed. I realized that this class is using some deprecated method.
Adobe CQ Help | Creating Replication Event Handlers for Adobe Experience Manager
Has someone implemented this on AEM6.4? If so, is there a most current tutorial?
My class does not have errors, but does is not working as well.
I appreciate any help.
Thanks in advance.
Views
Replies
Total Likes
Do not use the EventHandler anymore. You can use the Resource Change Listener to listen to node event and implement any custom operations.
You can follow this example however it contains Felix annotations. Attaching sample code with OSGI annotations:
@Component(
service = ResourceChangeListener.class,
property = {
ResourceChangeListener.PATHS + "=" + "/<add path here>",
ResourceChangeListener.CHANGES + "=" + "ADDED"
}
)
public class Sample implements ResourceChangeListener {
@Override
public void onChange(@Nonnull List<ResourceChange> list) {
try {
for (final ResourceChange change : list) {
}
} catch (Exception e) {
LOGGER.error("Exception {}", e);
}
}
}
Hope, it helps.
Views
Replies
Total Likes
Hi,
thank you very much for your answer!
So, I noticed that the events that I am able to use are "ADDED", "CHANGED", "REMOVED", but there is not replication events.
If I use changed event for example, the class will be called when the change is on author mode and when the change is on publish mode as well?
Thank you once more!
Views
Replies
Total Likes
Did you get a chance to check ACS AEM Samples -
You may swap SCR annotations with OSGI annotations. Refer - Re: Difference between SCR as well as R6 Annotation for examples
Views
Replies
Total Likes
Thank you, but it was told to me to not use Event Handler anymore.
I am already using OSGI annotations but ResourceChangeListener does not have an event type to identify the replication of a node,
how can I identify a replication of a node and then call some method???
Views
Replies
Total Likes
@elizabethp60981 , Did you get the replication event listener? If Yes, please share how you implemented the replication or activation event handler.
Thanks in advance.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies