Jahia Dev Forum > Jahia 7 - System...

0 (0 Good)
0 (0 Bad)

Jahia 7 - System Event

by  eddyacthergal »  2015/02/11 16:49

Hello,

I need to do some custom logic whenever a module is deployed on a site. I tried to follow the documentation found here: http://www.jahia.com/documentation-and-downloads/developers-techwiki/events-rules-jobs/system-events

However, when I create my own Listener implementing the ApplicationListener<ModuleDeployedOnSiteEvent>, I don't receive any event when deploying a module on a site...

Here is the java code:

public class ResourceSynchronizerListener implements  ApplicationListener<ModuleDeployedOnSiteEvent> {

    private static final Logger logger = org.slf4j.LoggerFactory.getLogger(ResourceSynchronizerListener.class);
    
    @Override
    public void onApplicationEvent(ModuleDeployedOnSiteEvent event) {
        //Custom logic when a module is deployed to a site
        logger.info(event.getTargetSitePath());
    }  
}

And the Spring bean definition

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
    
    <bean id="resourceListener" class="org.jahia.modules.resources.ResourceSynchronizerListener"  />
    
</beans>

Any idea ?

  (eddyacthergal)

Number of messages  1
Registration date
Contact
Share
Feedback

Get in touch

Whether you are a current user or if you are just evaluating Jahia, we are here to help.

Contact us

Share this page