cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giac...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java session.xsl xsp.xsl
Date Fri, 25 May 2001 18:49:58 GMT
giacomo     01/05/25 11:49:57

  Modified:    src/org/apache/cocoon/components/language/markup/xsp
                        XSPRequestHelper.java
               src/org/apache/cocoon/components/language/markup/xsp/java
                        session.xsl xsp.xsl
  Log:
  Added patch for xsp session attributesPablo Bendersky <pbendersky@itineri.com>
  Submitted by:	Pablo Bendersky <pbendersky@itineri.com>
  
  Revision  Changes    Path
  1.4       +6 -8      xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/XSPRequestHelper.java
  
  Index: XSPRequestHelper.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/XSPRequestHelper.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- XSPRequestHelper.java	2001/05/23 12:32:16	1.3
  +++ XSPRequestHelper.java	2001/05/25 18:49:52	1.4
  @@ -9,7 +9,8 @@
   
   import java.util.Enumeration;
   import java.util.Map;
  -import java.util.Vector;
  +import java.util.ArrayList;
  +import java.util.List;
   import org.apache.cocoon.Constants;
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.Session;
  @@ -21,7 +22,7 @@
    * The <code>Request</code> object helper
    *
    * @author <a href="mailto:ricardo@apache.org">Ricardo Rocha</a>
  - * @version CVS $Revision: 1.3 $ $Date: 2001/05/23 12:32:16 $
  + * @version CVS $Revision: 1.4 $ $Date: 2001/05/25 18:49:52 $
    */
   public class XSPRequestHelper extends XSPObjectHelper {
     /**
  @@ -672,18 +673,15 @@
      *
      * @param objectModel The Map objectModel
      */
  -  public static Vector getSessionAttributeNames (
  +  public static List getSessionAttributeNames (
       Map objectModel) {
         Request request = (Request)objectModel.get(Constants.REQUEST_OBJECT);
  -      Vector v = new Vector();
  +      ArrayList v = new ArrayList();
         Enumeration e = request.getSession().getAttributeNames();
   
         while (e.hasMoreElements()) {
  -          v.addElement(request.getSession().getAttribute((String) e.nextElement()));
  +          v.add(e.nextElement());
         }
  -
  -      String[] attributeNames = new String[v.size()];
  -      v.copyInto(attributeNames);
         return v;
     }
   
  
  
  
  1.3       +19 -18    xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/session.xsl
  
  Index: session.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/session.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- session.xsl	2001/05/23 12:32:17	1.2
  +++ session.xsl	2001/05/25 18:49:55	1.3
  @@ -101,26 +101,27 @@
         </xsl:call-template>
       </xsl:variable>
   
  -    <xsp:logic>
  -      Vector v = XSPRequestHelper.getSessionAttributeNames(objectModel);
  -    </xsp:logic>
  -
         <xsl:choose>
           <xsl:when test="$as = 'xml'">
  -	  <xsp:element name="session:attribute-names">
  -	    <xsp:logic>
  -	      for (int i = 0; i &lt; attributeName.length; i++) {
  -	        <xsp:element name="session:attribute-name">
  -		  <xsp:expr>attributeName[i]</xsp:expr>
  -		</xsp:element>
  -	      }
  -            </xsp:logic>
  -	  </xsp:element>
  -        </xsl:when>
  -        <xsl:when test="$as = 'array'">
  -          <xsp:expr>attributeNames</xsp:expr>
  -        </xsl:when>
  -      </xsl:choose>
  +        <xsp:logic>
  +          List v = XSPRequestHelper.getSessionAttributeNames(objectModel);
  +        </xsp:logic>
  +
  +        <xsp:element name="session:attribute-names">
  +          <xsp:logic>
  +            for (int i = 0; i &lt; v.size(); i++) {
  +              <xsp:element name="session:attribute-name">
  +                <xsp:expr>v.get(i)</xsp:expr>
  +              </xsp:element>
  +            }
  +          </xsp:logic>
  +        </xsp:element>
  +      </xsl:when>
  +
  +      <xsl:when test="$as = 'array'">
  +        <xsp:expr>XSPRequestHelper.getSessionAttributeNames(objectModel)</xsp:expr>
  +      </xsl:when>
  +    </xsl:choose>
     </xsl:template>
   
     <xsl:template match="session:get-creation-time">
  
  
  
  1.2       +2 -1      xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl
  
  Index: xsp.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- xsp.xsl	2001/05/09 20:49:56	1.1
  +++ xsp.xsl	2001/05/25 18:49:55	1.2
  @@ -12,7 +12,7 @@
   <!--
    * @author <a href="mailto:ricardo@apache.org>Ricardo Rocha</a>
    * @author <a href="sylvain.wallez@anyware-tech.com">Sylvain Wallez</a>
  - * @version CVS $Revision: 1.1 $ $Date: 2001/05/09 20:49:56 $
  + * @version CVS $Revision: 1.2 $ $Date: 2001/05/25 18:49:55 $
   -->
   
   <!-- XSP Core logicsheet for the Java language -->
  @@ -39,6 +39,7 @@
       import java.io.StringReader;
       //import java.net.*;
       import java.util.Date;
  +    import java.util.List;
       import java.util.Stack;
   
       //import org.w3c.dom.*;
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message