[opencms-dev] use a Publish Listener object

RĂ¼diger Kurz r.kurz at alkacon.com
Thu Aug 30 20:05:49 CEST 2012


Hi,

try to implement the interface:

org.opencms.main.I_CmsEventListener

and then register it with:

org.opencms.main.OpenCms.addCmsEventListener(I_CmsEventListener)

greetz
RĂ¼diger

Am 30.08.2012 17:30, schrieb Matteo Menghi:
> 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