[opencms-dev] use a Publish Listener object

Matteo Menghi m.menghi at inera.it
Thu Aug 30 17:30:38 CEST 2012


Hi list,

I created a custom module and an Action Class to react at publish event: 
i'd like to use a publisher Listener object for this and i write the command

OpenCms.getPublishManager().addPublishListener(my_publisherListener);

in the "initialize" method of my action class.

The method returns a NullPointerException because the publishManager is 
not yet initialized: opencms has changed the order of the manager object 
initialization from OpenCms 7.5.x (see org.opencms.main.OpenCmsCore), 
first the module Manager object (see line 1212) (with my action class) 
and then the publish Manager object (line 1218).

How i can use a publish Listener with my action class in OpenCms 8.0.x ?

Thanks,

Matteo









More information about the opencms-dev mailing list