cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 4364] New: - request.xsl XSP logicsheet - get-request-parameters - dropped functionality
Date Tue, 23 Oct 2001 09:42:51 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4364>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4364

request.xsl XSP logicsheet - get-request-parameters - dropped functionality

           Summary: request.xsl XSP logicsheet - get-request-parameters -
                    dropped functionality
           Product: Cocoon 2
           Version: 2.0rc1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: general components
        AssignedTo: cocoon-dev@xml.apache.org
        ReportedBy: ageissel@zenark.com


Hi,

In migrating from C1 to C2, the following logicsheet tag behaviour is no longer 
supported:

<xsp:request:get-parameter-values name="xxx" as="array"/>

Suggest the following changes to the XSP logicsheet and associated helper class.
Many thanks,
Adrian

Appologies for posting what is really a patch as a bug report, but I'm new to 
contributing and still getting the hang of this CVS thing ;)

==== src/org/apache/cocoon/components/language/markup/xsp/java/request.xsl ====

  <xsl:template match="xsp-request:get-parameter-values">
    <xsl:variable name="as">
      <xsl:call-template name="value-for-as">
        <xsl:with-param name="default" select="'xml'"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="name">
      <xsl:call-template name="value-for-name"/>
    </xsl:variable>

    <xsl:choose>
      <xsl:when test="$as = 'array'">
        <xsp:expr>
          (XSPRequestHelper.getParameterValues(objectModel, <xsl:copy-of 
select="$name"/>))
        </xsp:expr>
      </xsl:when>
      <xsl:when test="$as = 'xml'">
        <xsp:logic>
          XSPRequestHelper.getParameterValues(objectModel, this.contentHandler, 
<xsl:copy-of select="$name"/>);
        </xsp:logic>
      </xsl:when>
    </xsl:choose>
  </xsl:template>
==== src/org/apache/cocoon/components/language/markup/xsp/java/request.xsl ====

== src/org/apache/cocoon/components/language/markup/xsp/XSPRequestHelper.java ==
  /**
   * Return the given request parameter values for a give name
   *
   * @param objectModel The Map objectModel
   * @param name The parameter name
   */
  public static String[] getParameterValues(
    Map objectModel,
    String name
  ) {
    Request request = (Request)objectModel.get(Constants.REQUEST_OBJECT);
    String[] values = request.getParameterValues(name);

    return values;
  }

== src/org/apache/cocoon/components/language/markup/xsp/XSPRequestHelper.java ==

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message