cziegeler    2004/03/15 02:14:39

  Modified:    .        status.xml
               src/blocks/portal/java/org/apache/cocoon/portal/pluto
                        PortletContainerEnvironmentImpl.java
               src/blocks/portal/java/org/apache/cocoon/portal/serialization
                        IncludingHTMLSerializer.java
  Added:       src/blocks/portal/java/org/apache/cocoon/portal/pluto/services
                        PropertyManagerServiceImpl.java
  Log:
     <action dev="CZ" type="fix" fixes-bug="27658" due-to="Michal Durdina" 
due-to-email="[EMAIL PROTECTED]">
       Portal: Add default PropertyManagerService implementation
     </action>
     <action dev="CZ" type="fix" fixes-bug="27657" due-to="Michal Durdina" 
due-to-email="[EMAIL PROTECTED]">
       Portal: Fix synchronization problem with JSR-168 portlets in 
IncludingHTMLSerializer.
     </action>
  
  Revision  Changes    Path
  1.278     +7 -1      cocoon-2.1/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/status.xml,v
  retrieving revision 1.277
  retrieving revision 1.278
  diff -u -r1.277 -r1.278
  --- status.xml        12 Mar 2004 15:14:19 -0000      1.277
  +++ status.xml        15 Mar 2004 10:14:39 -0000      1.278
  @@ -212,6 +212,12 @@
     <changes>
   
    <release version="@version@" date="@date@">
  +   <action dev="CZ" type="fix" fixes-bug="27658" due-to="Michal Durdina" 
due-to-email="[EMAIL PROTECTED]">
  +     Portal: Add default PropertyManagerService implementation
  +   </action>
  +   <action dev="CZ" type="fix" fixes-bug="27657" due-to="Michal Durdina" 
due-to-email="[EMAIL PROTECTED]">
  +     Portal: Fix synchronization problem with JSR-168 portlets in 
IncludingHTMLSerializer.
  +   </action>
      <action dev="CZ" type="fix" fixes-bug="27602" due-to="Gunnar Brand" 
due-to-email="[EMAIL PROTECTED]">
        Improvement for AbstractReader: Don't wrap an already buffered stream.
      </action>
  
  
  
  1.1                  
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/pluto/services/PropertyManagerServiceImpl.java
  
  Index: PropertyManagerServiceImpl.java
  ===================================================================
  /*
   * Copyright 2004,2004 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.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.cocoon.portal.pluto.services;
  
  import java.util.Collections;
  import java.util.Map;
  
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  import org.apache.pluto.om.window.PortletWindow;
  import org.apache.pluto.services.property.PropertyManagerService;
  
  /**
   * Dummy property manager service. Since vendor specific information from 
   * the portlets is not needed they are discarded.
   *
   * @see javax.portlet.PortletResponse#addProperty(String, String)
   * @see javax.portlet.PortletResponse#setProperty(String, String) 
   *  
   * @author <a href="mailto:[EMAIL PROTECTED]">Michal Durdina</a>
   * 
   * @version CVS $Id: PropertyManagerServiceImpl.java,v 1.1 2004/03/15 
10:14:39 cziegeler Exp $
   */
  public class PropertyManagerServiceImpl implements PropertyManagerService {
  
        /**
         * Sets the given property map defined by the portlet window in its 
response.  
         * <br>
         * The purpose of this method is to provide the portal framework
         * with a new map of properties set by the portlet. The map can be 
empty, but not NULL
         * <br>
         * This method can be called multiple times during one request by the 
portlet container
         * 
         * @param window the portlet window of this property
         * @param request the servlet request
         * @param response the servlet response
         * @param properties the String/String array map containing the
         *                  properties to be set.
         **/
        public void setResponseProperties(PortletWindow window, 
                HttpServletRequest request, 
                HttpServletResponse response, 
                Map properties) {
  
                // do nothing
        }
  
        /**
         * Returns all properties for the given portlet window 
         * defined in the portal as String/String array map.
         * They will be made available to the portlet through the
         * portlet request.
         * <br>
         * The purpose of this method is to allow the portal framework
         * to create a map of properties and make it available to the portlet 
container.
         * <br>
         * This method can be called multiple times during one request by the 
portlet container
         * <br>
         * The return value cannot be null.
         *
         * @param window the portlet window of this property
         * @param request the servlet request
         * @param response the servlet response
         * 
         * @return              a <code>Map</code> containing
         *                  all properties. If there are no properties of
         *                  that name returns an empty <code>Map</code>.    
         **/
        public Map getRequestProperties(PortletWindow window, 
HttpServletRequest request) {
  
                return Collections.EMPTY_MAP;
        }
  
  }
  
  
  
  1.5       +5 -1      
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletContainerEnvironmentImpl.java
  
  Index: PortletContainerEnvironmentImpl.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/pluto/PortletContainerEnvironmentImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PortletContainerEnvironmentImpl.java      5 Mar 2004 13:02:14 -0000       
1.4
  +++ PortletContainerEnvironmentImpl.java      15 Mar 2004 10:14:39 -0000      
1.5
  @@ -32,12 +32,14 @@
   import org.apache.cocoon.portal.pluto.om.PortletDefinitionRegistry;
   import org.apache.cocoon.portal.pluto.om.PortletDefinitionRegistryImpl;
   import org.apache.cocoon.portal.pluto.service.log.LogServiceImpl;
  +import org.apache.cocoon.portal.pluto.services.PropertyManagerServiceImpl;
   import 
org.apache.cocoon.portal.pluto.services.factory.FactoryManagerServiceImpl;
   import org.apache.pluto.services.ContainerService;
   import org.apache.pluto.services.PortletContainerEnvironment;
   import org.apache.pluto.services.factory.FactoryManagerService;
   import org.apache.pluto.services.information.InformationProviderService;
   import org.apache.pluto.services.log.LogService;
  +import org.apache.pluto.services.property.PropertyManagerService;
   import org.apache.pluto.services.title.DynamicTitleService;
   
   /**
  @@ -91,6 +93,8 @@
                   this.init(new FactoryManagerServiceImpl()));
           this.staticServices.put(DynamicTitleService.class.getName(), 
                   this.init(new DynamicTitleServiceImpl()));
  +        this.staticServices.put(PropertyManagerService.class.getName(),
  +                     this.init(new PropertyManagerServiceImpl()));
       }
   
       /**
  
  
  
  1.3       +8 -15     
cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/serialization/IncludingHTMLSerializer.java
  
  Index: IncludingHTMLSerializer.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/portal/serialization/IncludingHTMLSerializer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IncludingHTMLSerializer.java      5 Mar 2004 13:02:16 -0000       1.2
  +++ IncludingHTMLSerializer.java      15 Mar 2004 10:14:39 -0000      1.3
  @@ -17,10 +17,8 @@
   
   import java.io.IOException;
   import java.io.OutputStream;
  -import java.util.ArrayList;
   import java.util.HashMap;
  -import java.util.Iterator;
  -import java.util.List;
  +import java.util.LinkedList;
   import java.util.Map;
   
   import org.apache.cocoon.serialization.HTMLSerializer;
  @@ -47,7 +45,7 @@
       
       public static final String NAMESPACE = 
"http://apache.org/cocoon/portal/include";;
       
  -    protected List orderedPortletList = new ArrayList(20);
  +    protected LinkedList orderedPortletList = new LinkedList();
       
       protected static final char token = '~';
       
  @@ -103,7 +101,7 @@
                   value = (String)map.get(portletId);
               }
               if ( value != null ) {
  -                this.orderedPortletList.add(value);
  +                this.orderedPortletList.addFirst(value);
                   this.characters(tokens, 0, tokens.length);
               }
           }
  @@ -120,18 +118,16 @@
   class ReplacingOutputStream extends OutputStream {
       
       /** Stream */
  -    protected OutputStream stream;
  +    protected final OutputStream stream;
       
       protected boolean inKey;
       
  -    protected Iterator valueIterator;
  -    
  -    protected List orderedValues;
  +    protected final LinkedList orderedValues;
       
       /**
        * Constructor
        */
  -    public ReplacingOutputStream(OutputStream stream, List values) {
  +    public ReplacingOutputStream(OutputStream stream, LinkedList values) {
           this.stream = stream;    
           this.orderedValues = values;
           this.inKey = false;
  @@ -231,10 +227,7 @@
        * Write next value
        */
       protected void writeNextValue() throws IOException {
  -        if ( this.valueIterator == null ) {
  -            this.valueIterator = this.orderedValues.iterator();
  -        }
  -        final String value = (String)this.valueIterator.next();
  +        final String value = (String)this.orderedValues.removeLast();
           if ( value != null ) {
               this.stream.write(value.getBytes(), 0, value.length());
           }        
  
  
  

Reply via email to