[opencms-dev] Catch onsave event in I_CmsEventListener

Achim Westermann achim.westermann at questico.de
Mon Feb 15 13:49:57 CET 2010


Hi Chuck,

what about EVENT_RESOURCES_MODIFIED? That is fired when a file is written (CmsDriverManager.writeFile... writeResource).

Regarding the ~files: Those are temporary files and you might check for a leading ~ and then do noting (in case the event is never triggered 
for the original resource without ~ you'll have to find it by a dirty substring(1.. routine).

HTH,

Achim

Chuck Mysak wrote:
> Hello list,
> 
> I'm trying to catch the save-and-exit event from the editor but from 
> what I see in I_CmsEventListener, this can't be done so easily.
> I tried EVENT_RESOURCES_AND_PROPERTIES_MODIFIED, but I get the temporary 
> (prefixed with ~) resource, that is created at the moment of editing, 
> and deleted afterwards. I also tried to catch the EVENT_RESOURCE_CREATED 
> event, and then I ended up dubling the two events (the temporary 
> resource is first created and then modified).
> 
> What I'm trying to achieve is a log of all the resources modified in the 
> offline project, after the user saves from the editor.
> 
> Thank you in advance
> 
> 
> Regards,
> 
> Chuck
> 
> 
> ------------------------------------------------------------------------
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list