Author: cmailleux
Date: Wed May 23 10:25:36 2007
New Revision: 17358

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D17358&repname=
=3Djahia
Log:
Add a new webdav listener to refresh files from esi server

Added:
    branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/webdav/li=
steners/JahiaESIWebdavEventListener.java
Modified:
    branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/esi/EsiIn=
validationWriterService.java
    branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/WEB-INF/etc/slide/domain.x=
ml

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/esi=
/EsiInvalidationWriterService.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/services/esi/EsiInvalidationWriterService.j=
ava&rev=3D17358&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/esi/EsiIn=
validationWriterService.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/esi/EsiIn=
validationWriterService.java Wed May 23 10:25:36 2007
@@ -1313,6 +1313,21 @@
 =

         return str.toString();
     }
+
+    public String getWebDAVFileInvalidationString(String uri) {
+        //TODO: will invalidate entries shared with others,
+        //TODO: but also might not invalidate entries generated by other b=
ut used by the current user
+
+        StringBuffer str =3D new StringBuffer("");
+        for (int  i =3D 0; i < EsiServerIPs.length; i++) {
+        str.append("<OBJECT> \n");
+            str.append("<ADVANCEDSELECTOR HOST=3D\"").append(EsiServerIPs[=
i]).append(":").append(EsiServerPorts[i]).append("\" > \n");
+            str.append("<OTHER NAME=3D\"URI\" TYPE=3D\"SUBSTRING\" VALUE=
=3D\"").append(uri).append("\"/> \n");
+            str.append("</ADVANCEDSELECTOR> \n");
+            str.append("</OBJECT> \n");
+        }
+        return str.toString();
+    }
 }
 =

 =


Added: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/webdav=
/listeners/JahiaESIWebdavEventListener.java
URL: https://svndev.jahia.net/websvn/filedetails.php?path=3D/branches/JAHIA=
-5-0-SP-BRANCH/core/src/java/org/jahia/services/webdav/listeners/JahiaESIWe=
bdavEventListener.java&rev=3D17358&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/webdav/li=
steners/JahiaESIWebdavEventListener.java (added)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/services/webdav/li=
steners/JahiaESIWebdavEventListener.java Wed May 23 10:25:36 2007
@@ -0,0 +1,122 @@
+package org.jahia.services.webdav.listeners;
+
+import org.apache.log4j.Logger;
+import org.apache.slide.event.ContentEvent;
+import org.apache.slide.event.VetoException;
+import org.apache.slide.webdav.event.WebdavEvent;
+import org.apache.slide.webdav.event.WebdavListener;
+import org.apache.slide.webdav.method.PutMethod;
+import org.jahia.bin.Jahia;
+import org.jahia.registries.ServicesRegistry;
+import org.jahia.services.webdav.DAVFileAccess;
+
+/**
+ * Created by IntelliJ IDEA. User: Rincevent Date: 31 ao=C3=83=C2=BBt 2005=
 Time: 12:24:26
+ *
+ * @version $Id: JahiaProductionListener.java 16005 2006-12-14 11:48:47Z t=
draier $
+ */
+public class JahiaESIWebdavEventListener implements WebdavListener {
+    private static final Logger logger =3D Logger.getLogger(JahiaESIWebdav=
EventListener.class);
+
+    public void acl(WebdavEvent event) throws VetoException {
+    }
+
+    public void bind(WebdavEvent event) throws VetoException {
+    }
+
+    public void checkin(WebdavEvent event) throws VetoException {
+    }
+
+    public void checkout(WebdavEvent event) throws VetoException {
+    }
+
+    public void copy(WebdavEvent event) throws VetoException {
+    }
+
+    public void delete(WebdavEvent event) throws VetoException {
+    }
+
+    public void get(WebdavEvent event) throws VetoException {
+    }
+
+    public void label(WebdavEvent event) throws VetoException {
+    }
+
+    public void lock(WebdavEvent event) throws VetoException {
+    }
+
+    public void mkcol(WebdavEvent event) throws VetoException {
+    }
+
+    public void mkcolAfter(WebdavEvent event) throws VetoException {
+    }
+
+    public void mkworkspace(WebdavEvent event) throws VetoException {
+    }
+
+    public void move(WebdavEvent event) throws VetoException {
+    }
+
+    public void options(WebdavEvent event) throws VetoException {
+    }
+
+    public void poll(WebdavEvent event) throws VetoException {
+    }
+
+    public void propFind(WebdavEvent event) throws VetoException {
+    }
+
+    public void propPatch(WebdavEvent event) throws VetoException {
+    }
+
+    public void put(WebdavEvent event) throws VetoException {
+    }
+
+    public void putAfter(WebdavEvent event) throws VetoException {
+        if (Jahia.getSettings().isEsiCacheActivated()) {
+            final String uri;
+            if (event.getSource() instanceof PutMethod) {
+                PutMethod m =3D (PutMethod) event.getSource();
+                uri =3D m.getRequestUri();
+            }
+            else {
+                DAVFileAccess file =3D (DAVFileAccess) event.getSource();
+                uri =3D file.getPath();
+            }
+            ServicesRegistry.getInstance().getEsiSOAPInvalidatorService().=
SOAPInvalidateWebDAVFile(uri);
+        }
+    }
+
+    public void rebind(WebdavEvent event) throws VetoException {
+    }
+
+    public void report(WebdavEvent event) throws VetoException {
+    }
+
+    public void search(WebdavEvent event) throws VetoException {
+    }
+
+    public void subscribe(WebdavEvent event) throws VetoException {
+    }
+
+    public void unbind(WebdavEvent event) throws VetoException {
+    }
+
+    public void uncheckout(WebdavEvent event) throws VetoException {
+    }
+
+    public void unlock(WebdavEvent event) throws VetoException {
+    }
+
+    public void unsubscribe(WebdavEvent event) throws VetoException {
+    }
+
+    public void update(WebdavEvent event) throws VetoException {
+    }
+
+    public void versionControl(WebdavEvent event) throws VetoException {
+    }
+
+    public void retrieve(ContentEvent event) throws VetoException {
+    }
+}

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/WEB-INF/etc/slide/do=
main.xml
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/webapp/WEB-INF/etc/slide/domain.xml&rev=3D17358&repname=3D=
jahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/WEB-INF/etc/slide/domain.x=
ml (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/WEB-INF/etc/slide/domain.x=
ml Wed May 23 10:25:36 2007
@@ -106,6 +106,7 @@
         <listener classname=3D"org.jahia.services.webdav.listeners.JahiaPr=
oductionListener"/>
         <listener classname=3D"org.jahia.services.webdav.listeners.IMGSlid=
eContentListener"/>
         <listener classname=3D"org.jahia.services.webdav.listeners.JahiaSe=
archListener"/>
+        <listener classname=3D"org.jahia.services.webdav.listeners.JahiaES=
IWebdavEventListener"/>
 <!--    <listener classname=3D"org.jahia.services.webdav.listeners.CMSSlid=
eContentListener"/>-->
                                <!--        =

         <listener classname=3D"org.jahia.test.SlideContentListener"/>

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to