Update of 
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/containers
In directory james.mmbase.org:/tmp/cvs-serv30492/containers

Modified Files:
      Tag: MMBase-1_8
        ListRelationsContainerTag.java 
Log Message:
MMB-1609


See also: 
http://cvs.mmbase.org/viewcvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/containers
See also: http://www.mmbase.org/jira/browse/MMB-1609


Index: ListRelationsContainerTag.java
===================================================================
RCS file: 
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/containers/ListRelationsContainerTag.java,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -u -b -r1.14 -r1.14.2.1
--- ListRelationsContainerTag.java      22 Jun 2006 13:17:46 -0000      1.14
+++ ListRelationsContainerTag.java      26 Feb 2008 15:42:41 -0000      1.14.2.1
@@ -27,7 +27,7 @@
  *
  * @author Michiel Meeuwissen
  * @since  MMBase-1.7
- * @version $Id: ListRelationsContainerTag.java,v 1.14 2006/06/22 13:17:46 
johannes Exp $
+ * @version $Id: ListRelationsContainerTag.java,v 1.14.2.1 2008/02/26 15:42:41 
michiel Exp $
  */
 public class ListRelationsContainerTag extends NodeReferrerTag implements 
NodeQueryContainer {
 
@@ -38,6 +38,7 @@
     private Attribute type       = Attribute.NULL;
     private Attribute role       = Attribute.NULL;
     private Attribute searchDir  = Attribute.NULL;
+    protected String jspVar = null;
 
     public void setCachepolicy(String t) throws JspTagException {
         cachePolicy = getAttribute(t);
@@ -60,6 +61,13 @@
         searchDir = getAttribute(s);
     }
 
+    /**
+     * @since MMBase-1.8.6
+     */
+    public void setJspvar(String jv) {
+        jspVar = jv;
+    }
+
 
     public Query getQuery() {
         return getNodeQuery();
@@ -90,6 +98,9 @@
 
 
     public int doStartTag() throws JspTagException {
+        if (getReferid() != null) {
+            query = (NodeQuery) 
getContextProvider().getContextContainer().getObject(getReferid());
+        } else {
         Cloud cloud = getCloudVar();
         NodeManager nm = null;
         if (type != Attribute.NULL) {
@@ -98,11 +109,18 @@
         Node relatedFromNode = getNode();
         query        = Queries.createRelationNodesQuery(relatedFromNode, nm, 
(String) role.getValue(this), (String) searchDir.getValue(this));
         relatedQuery = Queries.createRelatedNodesQuery(relatedFromNode, nm, 
(String) role.getValue(this), (String) searchDir.getValue(this));
-
+        }
         if (cachePolicy != Attribute.NULL) {
             
query.setCachePolicy(CachePolicy.getPolicy(cachePolicy.getValue(this)));
             
relatedQuery.setCachePolicy(CachePolicy.getPolicy(cachePolicy.getValue(this)));
         }
+
+        if (getId() != null) { // write to context.
+            getContextProvider().getContextContainer().register(getId(), 
query);
+        }
+        if (jspVar != null) {
+            pageContext.setAttribute(jspVar, query);
+        }
         return EVAL_BODY;
     }
 
_______________________________________________
Cvs mailing list
Cvs@lists.mmbase.org
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to