Author: mcardle
Date: Tue Jan 10 16:30:27 2006
New Revision: 105

URL: https://jahia.mine.nu/websvn/listing.php?sc=1&rev=105&repname=esi_server
Log:
* support for invalidation of Staging-only pages

Modified:
    trunk/src/org/jahia/esi/invalidation/services/Invalidator.java

Modified: trunk/src/org/jahia/esi/invalidation/services/Invalidator.java
URL: 
https://jahia.mine.nu/websvn/diff.php?path=/trunk/src/org/jahia/esi/invalidation/services/Invalidator.java&rev=105&repname=esi_server
==============================================================================
--- trunk/src/org/jahia/esi/invalidation/services/Invalidator.java (original)
+++ trunk/src/org/jahia/esi/invalidation/services/Invalidator.java Tue Jan 10 
16:30:27 2006
@@ -439,12 +439,20 @@
                     Other other = (Other) enumOther.nextElement();
                     //TODO: support OTHER 
NAME="URI|BODY|QUERYSTRING_PARAMETER|SEARCHKEY"  and TYPE="SUBSTRING|REGEX"
                     if ("URI".equals(other.getNAME()) &&
-                            "REGEX".equals(other.getTYPE()) &&
                             other.getVALUE() != null) {
 
                         Matcher mOtherpUriExp = 
getReformatedMatcher(other.getVALUE());
-                        matchers.addElement(new 
java.lang.Object[]{mOtherpUriExp, MATCHES});
+                        Integer type = MATCHES;
+                        if ("REGEX".equals(other.getTYPE()))
+                            type = MATCHES;
+                        else if ("SUBSTRING".equals(other.getTYPE()))
+                            type = FIND;
+                        else {
+                            log.error("Unknown TYPE in invalidation message 
entry OTHER : "+ other);
+                        }
+                        matchers.addElement(new 
java.lang.Object[]{mOtherpUriExp, type});
                     }
+
                 }
 
                 //Deal with ADVANCEDSELECTOR attributes
@@ -551,7 +559,7 @@
     private Matcher getReformatedMatcher(String pat) {
         //converts Regex Pattern from the Oracle-compatible format to a usable 
format
         Matcher mOtherpUriExp;
-        if (pat.indexOf("__esi_fragment=") !=-1)
+        if (pat.indexOf("__esi_fragment=") !=-1 || 
pat.indexOf("/op/compare|/op/preview|/op/edit") !=-1)
             mOtherpUriExp = Pattern.compile(".*"+pat+".*").matcher("");
         else
             mOtherpUriExp = Pattern.compile(".*"+pat).matcher("");

Reply via email to