[opencms-dev] Get the value of a property in order to set another property

Nacho Fernández Orellana nacho.fernandez.orellana at gmail.com
Fri Jul 3 08:56:49 CEST 2009


Hi Enric, Chris and list,

Enric actually wants the property "my_property" automatically updated
whenever he updates the "locale" property. That is not possible "out of the
box", but as I have written in spanish in opencmshispano to Enric (and want
to share here for a more global community), something similar can be done
with events.

I suggested him to register a new listener that listens to events of type "*
EVENT_PROPERTY_MODIFIED<../../../org/opencms/main/I_CmsEventListener.html#EVENT_PROPERTY_MODIFIED>
*" that read the locale property and checks that every "my_property"
property under that resource has the right value (and changes those in need
to be changed accordingly).

I also suggested him to define another property that controls where those
changes are made (something like "auto_set_my_property"), so he can specify
which folders should he process that way, and therefore avoid processing
many others where this is not useful. Hope this helps Enric and the
community. Greetings,

Nacho Fernandez.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20090703/362f6f6b/attachment.htm>


More information about the opencms-dev mailing list