Update of 
/var/cvs/contributions/CMSContainer/cmsc/taglib/src/java/com/finalist/cmsc/taglib/render
In directory 
james.mmbase.org:/tmp/cvs-serv14466/cmsc/taglib/src/java/com/finalist/cmsc/taglib/render

Modified Files:
      Tag: b1_4
        InsertPortletTag.java 
Log Message:
CMSC-409 var attribute of the cmsc:insert-portlet tag doesn't work


See also: 
http://cvs.mmbase.org/viewcvs/contributions/CMSContainer/cmsc/taglib/src/java/com/finalist/cmsc/taglib/render
See also: http://www.mmbase.org/jira/browse/CMSC-409


Index: InsertPortletTag.java
===================================================================
RCS file: 
/var/cvs/contributions/CMSContainer/cmsc/taglib/src/java/com/finalist/cmsc/taglib/render/InsertPortletTag.java,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -b -r1.2 -r1.2.2.1
--- InsertPortletTag.java       17 Dec 2007 20:34:18 -0000      1.2
+++ InsertPortletTag.java       8 Feb 2008 12:19:51 -0000       1.2.2.1
@@ -17,6 +17,7 @@
 import javax.servlet.jsp.PageContext;
 import javax.servlet.jsp.tagext.SimpleTagSupport;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -33,17 +34,18 @@
     private static Log log = LogFactory.getLog(InsertPortletTag.class);
 
     private String layoutid;
-
+       private String var;
 
     public String getLayoutid() {
        return layoutid;
     }
 
-
     public void setLayoutid(String layoutid) {
        this.layoutid = layoutid;
     }
-
+       public void setVar(String var) {
+               this.var = var;
+        }      
 
     @Override
     public void doTag() throws JspException, IOException {
@@ -63,8 +65,14 @@
                       .getStoredServletResponse(response, new 
PrintWriter(storedWriter));
                 // let the Portlet do it's thing
                 portlet.writeToResponse(request, wrappedResponse);
+                
+                if (StringUtils.isNotEmpty(var)) {
+                    request.setAttribute(var, storedWriter.toString());
+                }
+                else {
                 ctx.getOut().print(storedWriter.toString());
              }
+             }
              catch (IOException e) {
                 log.error("Error in portlet");
                 ctx.getOut().print("Error in portlet");
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to