haul        2002/12/19 07:14:57

  Modified:    src/webapp/WEB-INF cocoon.xconf
               src/java/org/apache/cocoon/components/language/markup/xsp
                        JSGenerator.java XSPRequestHelper.java
               src/java/org/apache/cocoon/components/language/markup/xsp/java
                        xsp.xsl
               src/java/org/apache/cocoon/components/language/markup/xsp/javascript
                        session.xsl
  Added:       src/java/org/apache/cocoon/components/language/markup/xsp
                        XSPSessionHelper.java
               src/java/org/apache/cocoon/components/language/markup/xsp/java
                        session.xsl
  Log:
  revert the following change since it conflicts with Vadim's plan to
  eventually remove session stuff from xsp-session and XSPRequestHelper.
  Will reopen the bugzilla entry. Sorry for inconveniences caused by this.
  
  >   <action dev="CH"
  >   type="add"due-to-email="[EMAIL PROTECTED]"
  >   due-to="Antonio Gallardo" fixes-bug="13070">
  >    Add a new tag xsp-session:getxml to XSP. In this course moved
  >    session.xsl
  >    for JAVA as well as XSPSessionHelper to session-fw block. Removed
  >    dependencies to XSPSessionHelper and moved functionality to
  >    XSPRequestHelper
  >    which already deals with session.
  >   </action>
  
  Revision  Changes    Path
  1.51      +10 -0     xml-cocoon2/src/webapp/WEB-INF/cocoon.xconf
  
  Index: cocoon.xconf
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/webapp/WEB-INF/cocoon.xconf,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- cocoon.xconf      18 Dec 2002 16:53:34 -0000      1.50
  +++ cocoon.xconf      19 Dec 2002 15:14:56 -0000      1.51
  @@ -259,6 +259,16 @@
             <parameter name="href" 
value="resource://org/apache/cocoon/components/language/markup/xsp/java/response.xsl"/>
           </builtin-logicsheet>
   
  +        <!-- The Session logicsheet (taglib) is an XSP logicsheet that wraps XML 
tags around 
  +             standard session operations. Specifically, the Session logicsheet 
provides an 
  +             XML interface to most methods of the HttpSession object (see the Java 
Servlet API 
  +             Specification, version 2.2 ) for more information. -->
  +        <builtin-logicsheet>
  +          <parameter name="prefix" value="xsp-session"/>
  +          <parameter name="uri" value="http://apache.org/xsp/session/2.0"/>
  +          <parameter name="href" 
value="resource://org/apache/cocoon/components/language/markup/xsp/java/session.xsl"/>
  +        </builtin-logicsheet>
  +
           <!-- The Cookie logicsheet (taglib) is an XSP logicsheet that wraps XML 
tags 
                around standard cookie operations -->
           <builtin-logicsheet>
  
  
  
  1.12      +10 -10    
xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/JSGenerator.java
  
  Index: JSGenerator.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/JSGenerator.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- JSGenerator.java  18 Dec 2002 16:52:50 -0000      1.11
  +++ JSGenerator.java  19 Dec 2002 15:14:56 -0000      1.12
  @@ -309,15 +309,6 @@
           return XSPRequestHelper.getRequestedURL(this.objectModel);
       }
   
  -    public Object getSessionAttribute(String name, Object defaultValue) {
  -        return XSPRequestHelper.getSessionAttribute(this.objectModel, name, 
defaultValue);
  -    }
  -
  -    public String[] getSessionAttributeNames() {
  -        Collection c = XSPRequestHelper.getSessionAttributeNames(this.objectModel);
  -        return (String[])c.toArray(new String[c.size()]);
  -    }
  -
       // XSPResponseHelper
   
       public void responseGetLocale()
  @@ -365,4 +356,13 @@
           XSPResponseHelper.setDateHeader(this.response, name, date, format);
       }
   
  +    // XSPSessionHelper
  +    public Object getSessionAttribute(Session session, String name, Object 
defaultValue) {
  +        return XSPSessionHelper.getSessionAttribute(session, name, defaultValue);
  +    }
  +
  +    public String[] getSessionAttributeNames(Session session) {
  +        Collection c = XSPSessionHelper.getSessionAttributeNames(session);
  +        return (String[])c.toArray(new String[c.size()]);
  +    }
   }
  
  
  
  1.16      +1 -42     
xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/XSPRequestHelper.java
  
  Index: XSPRequestHelper.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/XSPRequestHelper.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- XSPRequestHelper.java     18 Dec 2002 16:52:50 -0000      1.15
  +++ XSPRequestHelper.java     19 Dec 2002 15:14:56 -0000      1.16
  @@ -61,7 +61,6 @@
   import org.xml.sax.helpers.AttributesImpl;
   
   import java.util.ArrayList;
  -import java.util.List;
   import java.util.Date;
   import java.util.Enumeration;
   import java.util.Locale;
  @@ -562,45 +561,5 @@
   
           XSPObjectHelper.elementData(URI, PREFIX, contentHandler, "parameter",
               getSessionAttribute(objectModel, name, defaultValue).toString(), attr);
  -    }
  -
  -    /**
  -     * Output session attribute names for a given request
  -     *
  -     * @param objectModel The Map objectModel
  -     * @param contentHandler The SAX content handler
  -     * @exception SAXException If a SAX error occurs
  -     */
  -    public static void getSessionAttributeNames(Map objectModel,
  -                                         ContentHandler contentHandler)
  -        throws SAXException {
  -        Request request = ObjectModelHelper.getRequest(objectModel);
  -        XSPObjectHelper.start(URI, PREFIX, contentHandler, "attribute-names");
  -
  -        Enumeration e = request.getSession().getAttributeNames();
  -        while (e.hasMoreElements()) {
  -            String name = (String) e.nextElement();
  -            XSPObjectHelper.elementData(URI, PREFIX, contentHandler, "name", name);
  -        }
  -
  -        XSPObjectHelper.end(URI, PREFIX, contentHandler, "attribute-names");
  -    }
  -
  -    /**
  -     * Returns the session attribute names
  -     *
  -     * @param objectModel The Map objectModel
  -     */
  -    public static List getSessionAttributeNames(Map objectModel)
  -    {
  -        Request request = ObjectModelHelper.getRequest(objectModel);
  -
  -        ArrayList a = new ArrayList(10);
  -        Enumeration e = request.getSession().getAttributeNames();
  -        while (e.hasMoreElements()) {
  -            a.add(e.nextElement());
  -        }
  -
  -        return a;
       }
   }
  
  
  
  1.12      +9 -1      
xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/XSPSessionHelper.java
  
  
  
  
  1.16      +3 -2      
xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl
  
  Index: xsp.xsl
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- xsp.xsl   18 Dec 2002 16:52:50 -0000      1.15
  +++ xsp.xsl   19 Dec 2002 15:14:56 -0000      1.16
  @@ -121,6 +121,7 @@
       import org.apache.cocoon.components.language.markup.xsp.XSPObjectHelper;
       import org.apache.cocoon.components.language.markup.xsp.XSPRequestHelper;
       import org.apache.cocoon.components.language.markup.xsp.XSPResponseHelper;
  +    import org.apache.cocoon.components.language.markup.xsp.XSPSessionHelper;
   
       /* User Imports */
       <xsl:for-each select="xsp:structure/xsp:include">
  
  
  
  1.16      +2 -2      
xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/session.xsl
  
  
  
  
  1.6       +6 -6      
xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/javascript/session.xsl
  
  Index: session.xsl
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/javascript/session.xsl,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- session.xsl       18 Dec 2002 16:52:50 -0000      1.5
  +++ session.xsl       19 Dec 2002 15:14:56 -0000      1.6
  @@ -128,14 +128,14 @@
         <xsl:when test="$as = 'xml'">
           <xsp-session:attribute>
             <xsp:expr>
  -            page.getSessionAttribute(String(<xsl:copy-of select="$name"/>),
  +            page.getSessionAttribute(session, String(<xsl:copy-of select="$name"/>),
                   <xsl:copy-of select="$default"/>)
             </xsp:expr>
           </xsp-session:attribute>
         </xsl:when>
         <xsl:when test="$as = 'object'">
           <xsp:expr>
  -          page.getSessionAttribute(String(<xsl:copy-of select="$name"/>),
  +          page.getSessionAttribute(session, String(<xsl:copy-of select="$name"/>),
                 <xsl:copy-of select="$default"/>)
           </xsp:expr>
         </xsl:when>
  @@ -152,7 +152,7 @@
       <xsl:choose>
         <xsl:when test="$as = 'xml'">
           <xsp:logic>
  -          _session_attribute_names_ = page.getSessionAttributeNames();
  +          _session_attribute_names_ = page.getSessionAttributeNames(session);
           </xsp:logic>
           <xsp-session:attribute-names>
             <xsp:logic>
  @@ -167,7 +167,7 @@
   
         <xsl:when test="$as = 'array'">
           <xsp:expr>
  -          page.getSessionAttributeNames()
  +          page.getSessionAttributeNames(session)
           </xsp:expr>
         </xsl:when>
       </xsl:choose>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to