[opencms-dev] Handling CmsEvents to modify resource properties after edit

Jonathan Woods jonathan.woods at scintillance.com
Sun May 7 07:12:45 CEST 2006


I'm handling CmsEvents in order to modify a resource's properties based on
its contents every time those contents change.  Can anyone suggest the best
mix of event and resource state to use?  So far it's looking like
I_CmsEventListener.EVENT_RESOURCE_MODIFIED (and I guess
I_CmsEventListener.EVENT_RESOURCES_MODIFIED) when the resource's state is
'1' (i.e. CmsResource.STATE_CHANGED).  I'll probably also listen for
property changes too, just to ensure that the contents and associated
properties really are kept in synch.
 
The trouble with carrying out actions on meeting EVENT_RESOURCE_MODIFIED and
STATE_CHANGED is that two matching events seem to be fired when a user edits
then publishes a resource directly.  Maybe I don't have a choice, but it's a
pity that I end up carrying out the same modifications twice.
 
The resources concerned are of custom XML types.  I can't use the usual
element-to-properties mapping mechanism because the mapping isn't
straightforward; and in any case, having full control over the mapping seems
like a nice way of getting around the problem mentioned in the thread
"Several Languages - Howto" started by Roman Uhlig last October.
 
Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060507/e1edbed3/attachment.htm>


More information about the opencms-dev mailing list