Update of
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/containers
In directory james.mmbase.org:/tmp/cvs-serv32201/containers
Modified Files:
Tag: MMBase-1_8
RelatedNodesContainerTag.java ListNodesContainerTag.java
Log Message:
MMB-1610
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-1610
Index: RelatedNodesContainerTag.java
===================================================================
RCS file:
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/containers/RelatedNodesContainerTag.java,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -u -b -r1.14 -r1.14.2.1
--- RelatedNodesContainerTag.java 4 Jul 2006 12:16:09 -0000 1.14
+++ RelatedNodesContainerTag.java 26 Feb 2008 16:57:06 -0000 1.14.2.1
@@ -26,7 +26,7 @@
*
* @author Michiel Meeuwissen
* @since MMBase-1.7
- * @version $Id: RelatedNodesContainerTag.java,v 1.14 2006/07/04 12:16:09
michiel Exp $
+ * @version $Id: RelatedNodesContainerTag.java,v 1.14.2.1 2008/02/26 16:57:06
michiel Exp $
*/
public class RelatedNodesContainerTag extends ListNodesContainerTag {
@@ -51,7 +51,11 @@
public int doStartTag() throws JspTagException {
- if (getReferid() != null) {
+ String cloneId = clone.getString(this);
+ if (! "".equals(cloneId)) {
+ query = (NodeQuery)
getContextProvider().getContextContainer().getObject(cloneId);
+ query = (NodeQuery) query.clone();
+ } else if (getReferid() != null) {
query = (NodeQuery)
getContextProvider().getContextContainer().getObject(getReferid());
if (nodeManager != Attribute.NULL || role != Attribute.NULL ||
searchDirs != Attribute.NULL || path != Attribute.NULL || element !=
Attribute.NULL) {
throw new JspTagException("Cannot use 'nodemanager', 'role',
'searchdirs', 'path' or 'element' attributes together with 'referid'");
@@ -111,6 +115,9 @@
if (jspVar != null) {
pageContext.setAttribute(jspVar, query);
}
+ if (markused.getBoolean(this, false)) {
+ query.markUsed();
+ }
return EVAL_BODY;
}
Index: ListNodesContainerTag.java
===================================================================
RCS file:
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/containers/ListNodesContainerTag.java,v
retrieving revision 1.21
retrieving revision 1.21.2.1
diff -u -b -r1.21 -r1.21.2.1
--- ListNodesContainerTag.java 4 Jul 2006 12:16:09 -0000 1.21
+++ ListNodesContainerTag.java 26 Feb 2008 16:57:06 -0000 1.21.2.1
@@ -23,7 +23,7 @@
*
* @author Michiel Meeuwissen
* @since MMBase-1.7
- * @version $Id: ListNodesContainerTag.java,v 1.21 2006/07/04 12:16:09 michiel
Exp $
+ * @version $Id: ListNodesContainerTag.java,v 1.21.2.1 2008/02/26 16:57:06
michiel Exp $
*/
public class ListNodesContainerTag extends NodeReferrerTag implements
NodeQueryContainer {
// nodereferrer because RelatedNodesContainer extension
@@ -35,6 +35,8 @@
protected Attribute nodeManager = Attribute.NULL;
protected Attribute element = Attribute.NULL;
protected Attribute nodes = Attribute.NULL;
+ protected Attribute clone = Attribute.NULL;
+ protected Attribute markused = Attribute.NULL;
protected String jspVar = null;
/**
@@ -59,6 +61,20 @@
element = getAttribute(e);
}
+
+ /**
+ * @since MMBase-1.8.6
+ */
+ public void setClone(String c) throws JspTagException {
+ clone = getAttribute(c);
+ }
+ /**
+ * @since MMBase-1.8.6
+ */
+ public void setMarkused(String mu) throws JspTagException {
+ markused = getAttribute(mu);
+ }
+
/**
* @since MMBase-1.7.1
*/
@@ -90,7 +106,11 @@
}
public int doStartTag() throws JspTagException {
- if (getReferid() != null) {
+ String cloneId = clone.getString(this);
+ if (! "".equals(cloneId)) {
+ query = (NodeQuery)
getContextProvider().getContextContainer().getObject(cloneId);
+ query = (NodeQuery) query.clone();
+ } else if (getReferid() != null) {
query = (NodeQuery)
getContextProvider().getContextContainer().getObject(getReferid());
if (nodeManager != Attribute.NULL || path != Attribute.NULL ||
element != Attribute.NULL) {
throw new JspTagException("Cannot use 'nodemanager', 'path' or
'element' attributes together with 'referid'");
@@ -133,6 +153,9 @@
if (jspVar != null) {
pageContext.setAttribute(jspVar, query);
}
+ if (markused.getBoolean(this, false)) {
+ query.markUsed();
+ }
return EVAL_BODY;
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs