[opencms-dev] Missing element that calls a customizedEventListener

Martin Lehnert martin.lehnert at hannecke-its.de
Thu Mar 24 16:30:35 CET 2005


Thank you very much for the fast responses... I think the workaround
with the servlet will do until this behaviour is implemented in OpenCms.

Just one note though: The main reason why I want to create this Listener
is because I want to simplify the OpenCms-behaviour when I want to add a
resource in different languages. I think the existing implementation
with saving different languages in one xml-file and the possibility to
switch between them in the WYSIWYG-editor is really great, but clients
find it rather cumbersome to manually add siblings for every
language-version and configure them by adding the right locale property.
Since I understand the necessity to have the different language-versions
accessible through different URLs (for statistic and caching-reasons for
example) I would propose another option in the workplace-context-menu
that automatically creates siblings with an adequate pre- or postfix
(e.g. ISO-locale-code) for every used language-version in the
xml-control code of a resource. This behaviour could also set the
fitting locale-property in the file's properties (perhaps it's even
better to start this behaviour automatically as soon as you save a
resource, while making it possible to deactivate this for people who
don't like this because they want to organize the their
language-versions differently).

This is exactly the behaviour I want to implement through Listeners.
Unfortunately I am to create modules without touching the OpenCms-source
and have a very restrictive deadline, so I have to go the way with
Listeners, otherwise I would program this behaviour directly into
OpenCms and send it to you as a suggestion for incluing it into OpenCms.
When I'm finished, I could send you the code of the behaviour of my
listener, because once this is done I think it would not be too hard to
implement it the way I suggested. As long as you think this idea is
useful, of course.

Greetings and thank you again,
Martin Lehnert


>Hello,
>
>
>Thomas Maerz wrote:
> 
>>"Martin Lehnert" <martin.lehnert at hannecke-its.de> writes:
>>
>>  
>>
>>>I also stumbled over a class of the TemplateOne-module
>>>(CmsTemplateParts) which is implementing the Listener-interface and
is
>>>used by other classes of the module, but when does the system call
one
>>>of those classes so that the Listener can register itself?
>>>    
>>>
>>
>>
>>,----[ CmsTemplateParts.java ]
>>| // add an event listener
>>| OpenCms.addCmsEventListener(this);
>>`----
>>
>>Maybe register your Listener in a JSP,
>>that is requested for sure by a user.
>>
>>I couldn't find a way to add listeners on startup, too.
>>  
>>
>
>For this we have created our own small servlet and in the init() method

>we registered our listnerer.
>The servlet was called on startup by Tomcat and we made sure to be 
>called *after* the OpenCms servlet.

>At least it was possible with OpenCms 5.0.
>
>Regards,
>Thomas
>  
>
>
>Best regards,
>Andras Balogh.
>
>

>Small oversight on our part, this will be added ASAP. 
>
>Best Regards,
>Alex.
>
>Alexander Kandzior
>Alkacon Software - The OpenCms Experts
>http://www.alkacon.com




More information about the opencms-dev mailing list