Author: cmailleux
Date: Mon Aug 27 10:41:04 2007
New Revision: 407

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D407&repname=
=3Desi_server
Log:
This migration will transform each container Tag into a fragment Tag and us=
e the new ContainerHtmlCache from thomas and serge to make track back of co=
ntainers inside containers list, this automatic fragment will be automatica=
lly invalidated by jahia during is processing of events, otherwise you can =
still use the classic fragment tag but this one will be only flushed by exp=
iration delay (or invalidation events if it use always invalidate parameter=
s) for a starting point as for the HtmlContainerCache you can refer to the =
corporate portal templates V1, as this new cache and fragments strongly bas=
e themselves on Tag.

Modified:
    trunk/WEB-INF/classes/ehcache-esi.xml
    trunk/WEB-INF/config/data.xml
    trunk/src/org/jahia/esi/cache/MainCache.java
    trunk/src/org/jahia/esi/cache/objects/UrlCacheObject.java

Modified: trunk/WEB-INF/classes/ehcache-esi.xml
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/WEB-INF/classes=
/ehcache-esi.xml&rev=3D407&repname=3Desi_server
=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
--- trunk/WEB-INF/classes/ehcache-esi.xml (original)
+++ trunk/WEB-INF/classes/ehcache-esi.xml Mon Aug 27 10:41:04 2007
@@ -15,7 +15,7 @@
 =

     Subdirectories can be specified below the property e.g. java.io.tmpdir=
/one
     -->
-    <diskStore path=3D"java.io.tmpdir/jahia-caches"/>
+    <diskStore path=3D"java.io.tmpdir/esi-caches"/>
 =

     <!--
     Specifies a CacheManagerEventListenerFactory, be used to create a Cach=
eManagerPeerProvider,

Modified: trunk/WEB-INF/config/data.xml
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/WEB-INF/config/=
data.xml&rev=3D407&repname=3Desi_server
=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
--- trunk/WEB-INF/config/data.xml (original)
+++ trunk/WEB-INF/config/data.xml Mon Aug 27 10:41:04 2007
@@ -143,12 +143,12 @@
         nor will it be parsed for ESI tags for the matching requests : -->
         <default-passthrough-rules>
             <!-- activate passthrough for pages in EDIT mode -->
-            <passthrough-rule className=3D"net.sf.j2ep.rules.UrlRule" type=
=3D"SUBSTRING"
-                                  url=3D"/op/edit/" description=3D"EDIT mo=
de passthrough"/>
-            <passthrough-rule className=3D"net.sf.j2ep.rules.UrlRule" type=
=3D"SUBSTRING"
-                                  url=3D"/op/preview/" description=3D"Prev=
iew mode passthrough"/>
-            <passthrough-rule className=3D"net.sf.j2ep.rules.UrlRule" type=
=3D"SUBSTRING"
-                                  url=3D"/op/compare/" description=3D"Comp=
are mode passthrough"/>
+            <!--<passthrough-rule className=3D"net.sf.j2ep.rules.UrlRule" =
type=3D"SUBSTRING"-->
+                                  <!--url=3D"/op/edit/" description=3D"EDI=
T mode passthrough"/>-->
+            <!--<passthrough-rule className=3D"net.sf.j2ep.rules.UrlRule" =
type=3D"SUBSTRING"-->
+                                  <!--url=3D"/op/preview/" description=3D"=
Preview mode passthrough"/>-->
+            <!--<passthrough-rule className=3D"net.sf.j2ep.rules.UrlRule" =
type=3D"SUBSTRING"-->
+                                  <!--url=3D"/op/compare/" description=3D"=
Compare mode passthrough"/>-->
             <!-- activate passthrough for files already compressed -->
             <passthrough-rule className=3D"net.sf.j2ep.rules.UrlRule"
                               type=3D"SUBSTRING"

Modified: trunk/src/org/jahia/esi/cache/MainCache.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/src/org/jahia/e=
si/cache/MainCache.java&rev=3D407&repname=3Desi_server
=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
--- trunk/src/org/jahia/esi/cache/MainCache.java (original)
+++ trunk/src/org/jahia/esi/cache/MainCache.java Mon Aug 27 10:41:04 2007
@@ -897,32 +897,32 @@
         else
             log.info("---- could not remove already deleted content ["+url=
Obj.getContentHash()+"] for urlKey:"+urlKey );
 =

-        //---- Remove all referenced objects (only if referenceCount is 0)
-        String[] refUrlKeys =3D urlObj.getReferencedObjs();
-        Set removedUrls =3D new HashSet();
-        if (refUrlKeys !=3Dnull) {
-            //removed all directly referenced child fragments
-            for (int i=3D0; i < refUrlKeys.length ; i++) {
-
-                //replace markers if possible
-                String refUrlKey =3D Utils.replaceAllMarkers(refUrlKeys[i]=
,userAclGroupKey,userName,requestInfo, (new Integer(i+1)).toString());
-                //no need to remove urlkeys with markers
-                if (refUrlKey.indexOf(EsiConst.ACLGROUP_FRAGMENT_MARKER)=
=3D=3D-1
-                        && refUrlKey.indexOf(EsiConst.USER_FRAGMENT_MARKER=
)=3D=3D-1) {
-                    removeChildFragment(refUrlKey);
-                    removedUrls.add(refUrlKey);
-                }
-            }
-            //now remove all stored urlKeys
-            Iterator refSetIt =3D urlObj.getMarkerReplacedUrlKeys().iterat=
or();
-            while (refSetIt.hasNext()) {
-                String refUrlKey =3D  (String) refSetIt.next();
-                //don't remove it if we just did above
-                if (!removedUrls.contains(refUrlKey))
-                    removeChildFragment(refUrlKey);
-            }
-
-        }
+//        //---- Remove all referenced objects (only if referenceCount is =
0)
+//        String[] refUrlKeys =3D urlObj.getReferencedObjs();
+//        Set removedUrls =3D new HashSet();
+//        if (refUrlKeys !=3Dnull) {
+//            //removed all directly referenced child fragments
+//            for (int i=3D0; i < refUrlKeys.length ; i++) {
+//
+//                //replace markers if possible
+//                String refUrlKey =3D Utils.replaceAllMarkers(refUrlKeys[=
i],userAclGroupKey,userName,requestInfo, (new Integer(i+1)).toString());
+//                //no need to remove urlkeys with markers
+//                if (refUrlKey.indexOf(EsiConst.ACLGROUP_FRAGMENT_MARKER)=
=3D=3D-1
+//                        && refUrlKey.indexOf(EsiConst.USER_FRAGMENT_MARK=
ER)=3D=3D-1) {
+//                    removeChildFragment(refUrlKey);
+//                    removedUrls.add(refUrlKey);
+//                }
+//            }
+//            //now remove all stored urlKeys
+//            Iterator refSetIt =3D urlObj.getMarkerReplacedUrlKeys().iter=
ator();
+//            while (refSetIt.hasNext()) {
+//                String refUrlKey =3D  (String) refSetIt.next();
+//                //don't remove it if we just did above
+//                if (!removedUrls.contains(refUrlKey))
+//                    removeChildFragment(refUrlKey);
+//            }
+//
+//        }
 =

         if (log.isDebugEnabled()) log.debug("Removing ["+urlObj+"]");
         hashCache.remove(urlKey); //TODO: would be nice to use flushGroup(=
) instead at some point

Modified: trunk/src/org/jahia/esi/cache/objects/UrlCacheObject.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/src/org/jahia/e=
si/cache/objects/UrlCacheObject.java&rev=3D407&repname=3Desi_server
=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
--- trunk/src/org/jahia/esi/cache/objects/UrlCacheObject.java (original)
+++ trunk/src/org/jahia/esi/cache/objects/UrlCacheObject.java Mon Aug 27 10=
:41:04 2007
@@ -235,6 +235,10 @@
                     log.error("no "+EsiConst.JAHIAESI_PID+" header found i=
n "+this);
                     return;
                 }
+                String fid =3D getResponseHeader(EsiConst.JAHIAESI_FRAGMEN=
T);
+                if(fid!=3Dnull && Integer.parseInt(fid)>1000)
+                key.append("_pid-0");
+                else
                 key.append("_pid-").append(pid);
 =

                 //if this is an always_invalidate fragment, then mark it a=
s such
@@ -243,7 +247,6 @@
                 }
                 //otherwise, this might just be a standard fragment
                 else {
-                    String fid =3D getResponseHeader(EsiConst.JAHIAESI_FRA=
GMENT);
                     if (fid!=3Dnull) {
                         key.append("_fid-").append(fid);
                     }

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

Reply via email to