You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2006/03/08 12:52:38 UTC

svn commit: r384191 - in /cocoon/branches/BRANCH_2_1_X: src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java status.xml

Author: cziegeler
Date: Wed Mar  8 03:52:35 2006
New Revision: 384191

URL: http://svn.apache.org/viewcvs?rev=384191&view=rev
Log:
Fix bug in handling multiple instances of the same portlet

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java
    cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java?rev=384191&r1=384190&r2=384191&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java Wed Mar  8 03:52:35 2006
@@ -1,12 +1,12 @@
 /*
  * Copyright 2004,2004-2005 The Apache Software Foundation.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -77,8 +77,7 @@
  * This is the adapter to use JSR-168 portlets as coplets
  *
  * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
- * 
- * @version CVS $Id$
+ * @version $Id$
  */
 public class PortletAdapter 
     extends AbstractCopletAdapter
@@ -173,14 +172,10 @@
             throw new SAXException("Unable to execute JSR-168 portlets because of missing servlet context.");
         }
         try {
-            final String portlet = (String)super.getConfiguration(coplet, "portlet");
-            if ( portlet == null ) {
-                throw new SAXException("Portlet configuration is missing.");
-            }
             // get the window
             final PortletWindow window = (PortletWindow)coplet.getTemporaryAttribute("window");
             if ( window == null ) {
-                throw new SAXException("Portlet couldn't be loaded: " + portlet);
+                throw new SAXException("Portlet couldn't be loaded: " + coplet.getId());
             }
             final Map objectModel = ContextHelper.getObjectModel(this.context);
             final ServletRequestImpl  req = (ServletRequestImpl) objectModel.get("portlet-request");
@@ -195,10 +190,10 @@
                 HtmlSaxParser.parseString(value, HtmlSaxParser.getContentFilter(contentHandler));
             } else {
                 // stream out the include for the serializer
-                IncludingHTMLSerializer.addPortlet(portlet, value);
+                IncludingHTMLSerializer.addPortlet(coplet.getId(), value);
                 contentHandler.startPrefixMapping("portal", IncludingHTMLSerializer.NAMESPACE);
                 AttributesImpl attr = new AttributesImpl();
-                attr.addCDATAAttribute("portlet", portlet);
+                attr.addCDATAAttribute("portlet", coplet.getId());
                 contentHandler.startElement(IncludingHTMLSerializer.NAMESPACE, 
                                             "include", "portal:include", attr);
                 contentHandler.endElement(IncludingHTMLSerializer.NAMESPACE, 
@@ -414,4 +409,7 @@
         }
     }
 
+    protected String getResponse(HttpServletResponse response) {
+        return response.toString();
+    }
 }

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?rev=384191&r1=384190&r2=384191&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Wed Mar  8 03:52:35 2006
@@ -180,6 +180,10 @@
   <release version="@version@" date="@date@">
 -->
   <release version="2.1.9" date="TBD">
+    <action dev="CZ" type="fix">
+      Portal Block: Fix handling of several instances of the same portlet where all instances
+                    showed the contents of the last portlet instance.
+    </action>
     <action dev="JBQ" type="fix" fixes-bug="COCOON-1707" due-to="Sébastien Grimault" due-to-email="sgrimault@jouve.fr">
       Allow configuration of initial context in LDAPTransformer.  Example:
       &lt;ldap:initial-context name="com.sun.jndi.ldap.connect.timeout" value="5000"/&gt;



Re: svn commit: r384191 - in /cocoon/branches/BRANCH_2_1_X: src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java status.xml

Posted by Carsten Ziegeler <cz...@apache.org>.
Jean-Baptiste Quenot wrote:

> What  about:  « This  only  applies to  JSR-168  portlets, not  to
> coplets »?
Go ahead.


Carsten
-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: svn commit: r384191 - in /cocoon/branches/BRANCH_2_1_X: src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java status.xml

Posted by Jean-Baptiste Quenot <jb...@apache.org>.
* Carsten Ziegeler:
> Jean-Baptiste Quenot schrieb:
> > * Carsten Ziegeler:
> > > +    <action dev="CZ" type="fix">
> > > +      Portal Block: Fix handling of several instances of the same portlet where all instances
> > > +                    showed the contents of the last portlet instance.
> > > +    </action>
> >
> > It  may be  worth to  mention clearly  that this  problem does
> > *not* apply to *coplets*, just to *portlets*.

> I think this  is clearly mentioned by the word  "portlet" :) But
> if you have a better wording  go ahead, I'm not a native speaker
> anyway :)

What  about:  « This  only  applies to  JSR-168  portlets, not  to
coplets »?
-- 
Jean-Baptiste Quenot
http://caraldi.com/jbq/

Re: svn commit: r384191 - in /cocoon/branches/BRANCH_2_1_X: src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java status.xml

Posted by Carsten Ziegeler <cz...@apache.org>.
Jean-Baptiste Quenot schrieb:
> * Carsten Ziegeler:
>> Author: cziegeler
>> Date: Wed Mar  8 03:52:35 2006
>> New Revision: 384191
>>
>> URL: http://svn.apache.org/viewcvs?rev=384191&view=rev
>> Log:
>> Fix bug in handling multiple instances of the same portlet
>>
>> Modified: cocoon/branches/BRANCH_2_1_X/status.xml
>> URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?rev=384191&r1=384190&r2=384191&view=diff
>> ==============================================================================
>> --- cocoon/branches/BRANCH_2_1_X/status.xml (original)
>> +++ cocoon/branches/BRANCH_2_1_X/status.xml Wed Mar  8 03:52:35 2006
>> @@ -180,6 +180,10 @@
>>    <release version="@version@" date="@date@">
>>  -->
>>    <release version="2.1.9" date="TBD">
>> +    <action dev="CZ" type="fix">
>> +      Portal Block: Fix handling of several instances of the same portlet where all instances
>> +                    showed the contents of the last portlet instance.
>> +    </action>
>>      <action dev="JBQ" type="fix" fixes-bug="COCOON-1707" due-to="Sébastien Grimault" due-to-email="sgrimault@jouve.fr">
>>        Allow configuration of initial context in LDAPTransformer.  Example:
>>        &lt;ldap:initial-context name="com.sun.jndi.ldap.connect.timeout" value="5000"/&gt;
> 
> It may be worth to mention clearly that this problem does *not*
> apply to *coplets*, just to *portlets*.
I  think this is clearly mentioned by the word "portlet" :) But if you
have a better wording go ahead, I'm not a native speaker anyway :)

Carsten

-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: svn commit: r384191 - in /cocoon/branches/BRANCH_2_1_X: src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/PortletAdapter.java status.xml

Posted by Jean-Baptiste Quenot <jb...@apache.org>.
* Carsten Ziegeler:
> Author: cziegeler
> Date: Wed Mar  8 03:52:35 2006
> New Revision: 384191
> 
> URL: http://svn.apache.org/viewcvs?rev=384191&view=rev
> Log:
> Fix bug in handling multiple instances of the same portlet
> 
> Modified: cocoon/branches/BRANCH_2_1_X/status.xml
> URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?rev=384191&r1=384190&r2=384191&view=diff
> ==============================================================================
> --- cocoon/branches/BRANCH_2_1_X/status.xml (original)
> +++ cocoon/branches/BRANCH_2_1_X/status.xml Wed Mar  8 03:52:35 2006
> @@ -180,6 +180,10 @@
>    <release version="@version@" date="@date@">
>  -->
>    <release version="2.1.9" date="TBD">
> +    <action dev="CZ" type="fix">
> +      Portal Block: Fix handling of several instances of the same portlet where all instances
> +                    showed the contents of the last portlet instance.
> +    </action>
>      <action dev="JBQ" type="fix" fixes-bug="COCOON-1707" due-to="Sébastien Grimault" due-to-email="sgrimault@jouve.fr">
>        Allow configuration of initial context in LDAPTransformer.  Example:
>        &lt;ldap:initial-context name="com.sun.jndi.ldap.connect.timeout" value="5000"/&gt;

It may be worth to mention clearly that this problem does *not*
apply to *coplets*, just to *portlets*.
-- 
Jean-Baptiste Quenot
http://caraldi.com/jbq/