Determine the project a change was made in
Kai Widmann via opencms-dev <[email protected]> Fri, 14 Feb 2025 15:52:31 +0000
| Newsgroups | gmane.comp.cms.opencms.devel |
|---|---|
| Message-ID | <[email protected]> |
Hey there, I have a custom caching mechanism that stores some stuff in a project specific way (Offline / Online). Now I’d like to flush the cache in two distinct situations: * Once a container page is edited (and saved) by an editor in the Offline project, I’d like to flush the Offline cache * Once a container page is published from the Offline to the Online project, I’d like to flush the Online cache The second thing is not a problem, I can use a module action and react to the publishProject event. For the first thing I guess I’d have to use I_ModuleActionHandler’s cmsEvent method to react to EVENT_RESOURCE_MODIFIED and/or some other resource events. But these are fired after an editor changed the resource AND after publishing, so more often than I’d like. Is there any way to figure out, if a resource was changed in the Offline project or published to the Online project in I_ModuleActionHandler’s cmsEvent method? I used resource.getProjectLastModified() and used this to determine the Project, but this always is Offline. So it doesn’t help. What I would need is something like “resource.getCurrentProject” or event.getCurrentProject, but both do not exist. Also the eventData (event.getData()) doesn’t contain any project specific information. Any ideas would be appreciated! Mit freundlichen Grüßen Kai Widmann Webentwickler Backend EWS Elektrizitätswerke Schönau eG Lehrter Straße 57 Haus 1 | 10557 Berlin Hauptsitz: Friedrichstraße 53/55 | 79677 Schönau www.ews-schoenau.de<https://www.ews-schoenau.de/> Vorstände Anja Burde, Armin Komenda, Alexander Sladek, Sebastian Sladek Aufsichtsratsvorsitzender Thomas Jorberg Genossenschaftsregister GnR 700017 beim AG Freiburg im Breisgau _______________________________________________ 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 https://lists.opencms.org/mailman/listinfo/opencms-dev