Author: tdraier
Date: Fri Sep 21 10:32:38 2007
New Revision: 18587

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18587&repname=
=3Djahia
Log:
add attributes to set cacheKey as a bean or bean property ( port 18403 )

Modified:
    trunk/core/src/java/org/jahia/taglibs/container/ContainerCacheTag.java
    trunk/core/src/java/org/jahia/taglibs/container/ContainerTag.java
    trunk/core/src/webapp/WEB-INF/etc/taglibs/content.tld

Modified: trunk/core/src/java/org/jahia/taglibs/container/ContainerCacheTag=
.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/taglibs/container/ContainerCacheTag.java&rev=3D18587&repname=3Djah=
ia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=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/core/src/java/org/jahia/taglibs/container/ContainerCacheTag.java =
(original)
+++ trunk/core/src/java/org/jahia/taglibs/container/ContainerCacheTag.java =
Fri Sep 21 10:32:38 2007
@@ -1,5 +1,6 @@
 package org.jahia.taglibs.container;
 =

+import org.apache.struts.taglib.TagUtils;
 import org.jahia.bin.Jahia;
 import org.jahia.content.ContentContainerKey;
 import org.jahia.content.ContentContainerListKey;
@@ -40,6 +41,9 @@
     private JahiaData jData =3D null;
     private String cache;
     private String cacheKey =3D null;
+    private String cacheKeyName =3D null;
+    private String cacheKeyProperty =3D null;
+    private String cacheKeyScope =3D null;
     private Set dependencies =3D null;
     private ContainerCache oldCacheTag;
     private boolean display =3D true;
@@ -56,6 +60,30 @@
         this.cacheKey =3D cacheKey.toString();
     }
 =

+    public String getCacheKeyName() {
+        return cacheKeyName;
+    }
+
+    public void setCacheKeyName(String cacheKeyName) {
+        this.cacheKeyName =3D cacheKeyName;
+    }
+
+    public String getCacheKeyProperty() {
+        return cacheKeyProperty;
+    }
+
+    public void setCacheKeyProperty(String cacheKeyProperty) {
+        this.cacheKeyProperty =3D cacheKeyProperty;
+    }
+
+    public String getCacheKeyScope() {
+        return cacheKeyScope;
+    }
+
+    public void setCacheKeyScope(String cacheKeyScope) {
+        this.cacheKeyScope =3D cacheKeyScope;
+    }
+
     /**
          * @jsp:attribute name=3D"id" required=3D"false" rtexprvalue=3D"tr=
ue"
          * description=3D"id attribute for this tag.
@@ -83,6 +111,10 @@
     }
 =

     public int doStartTag() throws JspException {
+        if (cacheKeyName !=3D null) {
+            cacheKey =3D TagUtils.getInstance().lookup(pageContext, cacheK=
eyName, cacheKeyProperty, cacheKeyScope).toString();
+        }
+
         oldCacheTag =3D (ContainerCache) pageContext.getAttribute(Containe=
rTag.CACHETAG);
         pageContext.setAttribute(ContainerTag.CACHETAG, this);
 =

@@ -159,6 +191,9 @@
         pageContext.setAttribute(ContainerTag.CACHETAG, oldCacheTag);
         oldCacheTag =3D null;
 =

+        cacheKeyName =3D null;
+        cacheKeyProperty =3D null;
+        cacheKeyScope =3D null;
 =

         return EVAL_PAGE;
     }

Modified: trunk/core/src/java/org/jahia/taglibs/container/ContainerTag.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/taglibs/container/ContainerTag.java&rev=3D18587&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
--- trunk/core/src/java/org/jahia/taglibs/container/ContainerTag.java (orig=
inal)
+++ trunk/core/src/java/org/jahia/taglibs/container/ContainerTag.java Fri S=
ep 21 10:32:38 2007
@@ -29,6 +29,7 @@
 import org.jahia.services.cache.ContainerHTMLCache;
 import org.jahia.services.cache.GroupCacheKey;
 import org.jahia.utils.LanguageCodeConverters;
+import org.apache.struts.taglib.TagUtils;
 =

 import javax.servlet.ServletRequest;
 import javax.servlet.jsp.JspException;
@@ -77,6 +78,9 @@
     private ContainerCache oldCacheTag;
     private String cache =3D Boolean.toString(Jahia.getSettings().isOutput=
ContainerCacheActivated());
     private String cacheKey =3D "";
+    private String cacheKeyName =3D null;
+    private String cacheKeyProperty =3D null;
+    private String cacheKeyScope =3D null;
 =

     private boolean initLoop =3D true;
     private boolean display =3D true;
@@ -125,6 +129,30 @@
         this.cacheKey =3D cacheKey.toString();
     }
     =

+    public String getCacheKeyName() {
+        return cacheKeyName;
+    }
+
+    public void setCacheKeyName(String cacheKeyName) {
+        this.cacheKeyName =3D cacheKeyName;
+    }
+
+    public String getCacheKeyProperty() {
+        return cacheKeyProperty;
+    }
+
+    public void setCacheKeyProperty(String cacheKeyProperty) {
+        this.cacheKeyProperty =3D cacheKeyProperty;
+    }
+
+    public String getCacheKeyScope() {
+        return cacheKeyScope;
+    }
+
+    public void setCacheKeyScope(String cacheKeyScope) {
+        this.cacheKeyScope =3D cacheKeyScope;
+    }
+
     public JahiaContainer getContainer() {
         return this.container;
     }
@@ -141,6 +169,9 @@
     }
 =

     public int doStartTag() throws JspException {
+        if (cacheKeyName !=3D null) {
+            cacheKey =3D TagUtils.getInstance().lookup(pageContext, cacheK=
eyName, cacheKeyProperty, cacheKeyScope).toString();
+        }
         oldCacheTag =3D (ContainerCache) pageContext.getAttribute(CACHETAG=
);
         pageContext.setAttribute(CACHETAG, this);
         initLoop =3D true;
@@ -262,6 +293,10 @@
 =

         cacheKey =3D "";
 =

+        cacheKeyName =3D null;
+        cacheKeyProperty =3D null;
+        cacheKeyScope =3D null;
+
         initLoop =3D true;
         jData =3D null;
 =


Modified: trunk/core/src/webapp/WEB-INF/etc/taglibs/content.tld
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/WEB-INF/etc/taglibs/content.tld&rev=3D18587&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
--- trunk/core/src/webapp/WEB-INF/etc/taglibs/content.tld (original)
+++ trunk/core/src/webapp/WEB-INF/etc/taglibs/content.tld Fri Sep 21 10:32:=
38 2007
@@ -279,6 +279,21 @@
         <required>false</required>
         <rtexprvalue>true</rtexprvalue>
     </attribute>
+      <attribute>
+          <name>cacheKeyName</name>
+          <required>false</required>
+          <rtexprvalue>true</rtexprvalue>
+      </attribute>
+      <attribute>
+          <name>cacheKeyProperty</name>
+          <required>false</required>
+          <rtexprvalue>true</rtexprvalue>
+      </attribute>
+      <attribute>
+          <name>cacheKeyScope</name>
+          <required>false</required>
+          <rtexprvalue>true</rtexprvalue>
+      </attribute>
   </tag>
 =

     <tag>
@@ -295,6 +310,21 @@
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
         </attribute>
+        <attribute>
+            <name>cacheKeyName</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>cacheKeyProperty</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
+        <attribute>
+            <name>cacheKeyScope</name>
+            <required>false</required>
+            <rtexprvalue>true</rtexprvalue>
+        </attribute>
     </tag>
 =

   <tag>

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

Reply via email to