vgritsenko 2003/05/22 14:26:27
Modified: . changes.xml
. status.xml
src/java/org/apache/cocoon/components/language/markup/xsp/java
soap.xsl xscript-lib.xsl xscript.xsl
src/java/org/apache/cocoon/components/language/markup/xsp/java
soap.xsl xscript-lib.xsl xscript.xsl
Log:
Fix bug 20159 and some:
Changed scope of and renamed temporary 'soap:call' XScript variable in
<soap:call>.
Fixed compilation problem with <xscript-get as="object"> expression.
Revision Changes Path
1.14 +6 -1 cocoon-2.0/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/cocoon-2.0/changes.xml,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- changes.xml 20 May 2003 20:54:49 -0000 1.13
+++ changes.xml 22 May 2003 21:26:26 -0000 1.14
@@ -42,6 +42,11 @@
</devs>
<release version="@version@" date="@date@">
+ <action dev="VG" type="fix" fixes-bug="20159" due-to="Hugh Leather"
due-to-email="[EMAIL PROTECTED]">
+ Logicsheets:
+ Changed scope of and renamed temporary 'soap:call' XScript variable in
<soap:call>.
+ Fixed compilation problem with <xscript-get as="object"> expression.
+ </action>
<action dev="BRD" type="fix" fixes-bug="8379">
XIncludeTransformer: handle null systemid's in setDocumentLocator event.
</action>
1.42 +5 -0 cocoon-2.1/status.xml
Index: status.xml
===================================================================
RCS file: /home/cvs/cocoon-2.1/status.xml,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- status.xml 22 May 2003 16:01:58 -0000 1.41
+++ status.xml 22 May 2003 21:26:26 -0000 1.42
@@ -180,6 +180,11 @@
<changes>
<release version="@version@" date="@date@">
+ <action dev="VG" type="fix" fixes-bug="20159" due-to="Hugh Leather"
due-to-email="[EMAIL PROTECTED]">
+ Logicsheets:
+ Changed scope of and renamed temporary 'soap:call' XScript variable in
<soap:call>.
+ Fixed compilation problem with <xscript-get as="object"> expression.
+ </action>
<action dev="BRD" type="add" fixes-bug="19894" due-to="Michael Enke"
due-to-email="[EMAIL PROTECTED]">
I18nTransformer: support a currency attribute on i18n:number. This allows
to take the currency symbol and formatting from one locale and the
decimal
1.2 +34 -34
cocoon-2.0/src/java/org/apache/cocoon/components/language/markup/xsp/java/soap.xsl
Index: soap.xsl
===================================================================
RCS file:
/home/cvs/cocoon-2.0/src/java/org/apache/cocoon/components/language/markup/xsp/java/soap.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- soap.xsl 9 Mar 2003 00:02:01 -0000 1.1
+++ soap.xsl 22 May 2003 21:26:26 -0000 1.2
@@ -63,14 +63,14 @@
-->
<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsp="http://apache.org/xsp"
- xmlns:xscript="http://apache.org/xsp/xscript/1.0"
- xmlns:soap="http://apache.org/xsp/soap/3.0"
- >
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:xscript="http://apache.org/xsp/xscript/1.0"
+ xmlns:soap="http://apache.org/xsp/soap/3.0">
<xsl:include href="xscript-lib.xsl"/>
+
<xsl:template match="xsp:page">
<xsp:page>
<xsl:apply-templates select="@*"/>
@@ -81,6 +81,7 @@
</xsp:page>
</xsl:template>
+
<xsl:template match="soap:call">
<xsl:variable name="url">
<xsl:choose>
@@ -99,18 +100,17 @@
</xsl:variable>
<xsl:variable name="scope">
- <xsl:call-template name="xscript-get-scope">
- <xsl:with-param name="scope" select="@scope"/>
+ <xsl:call-template name="xscript-get-scope-for-creation">
+ <xsl:with-param name="scope" select="'request'"/>
</xsl:call-template>
</xsl:variable>
- <xsl:variable name="creation-scope">
- <xsl:call-template name="xscript-get-scope-for-creation">
- <xsl:with-param name="scope" select="@scope"/>
- </xsl:call-template>
+ <xsl:variable name="tempvar">
+ <xsl:text>__soap_call_</xsl:text>
+ <xsl:value-of select="generate-id(.)"/>
</xsl:variable>
- <xscript:variable name="soap:call">
+ <xscript:variable scope="request" name="{$tempvar}">
<xsl:choose>
<xsl:when test="soap:env">
<xsl:apply-templates select="soap:env"/>
@@ -120,29 +120,29 @@
</xsl:otherwise>
</xsl:choose>
</xscript:variable>
- <xsl:variable name="object">
- <xsl:call-template name="xscript-get">
- <xsl:with-param name="name" select="'soap:call'"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="as" select="'object'"/>
- </xsl:call-template>
- </xsl:variable>
+
<xsp:logic>
- getLogger().debug("XScriptObject for soap:call is\n" + <xsl:value-of
select="$object"/>);
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("XScriptObject for soap:call is\n" +
+ <xscript:get scope="request" name="{$tempvar}" as="object"/> +
+ ", sending request to: " + <xsl:value-of select="$url"/>);
+ }
try {
- xscriptManager.put(pageScope, objectModel, "soap:call",
- ((new SOAPHelper(manager,
- XSPRequestHelper.getRequestedURL(objectModel),
- <xsl:value-of select="$url"/>,
- <xsl:value-of select="$method"/>,
- <xsl:value-of select="$object"/>
- )).invoke()),
- <xsl:value-of select="$creation-scope"/>);
- getLogger().debug("SOAP result is\n" + <xsl:value-of
select="$object"/>);
- <xscript:get name="soap:call"/>
+ xscriptManager.put(pageScope, objectModel, "<xsl:value-of
select="$tempvar"/>",
+ new SOAPHelper(manager,
+ XSPRequestHelper.getRequestedURL(objectModel),
+ String.valueOf(<xsl:value-of select="$url"/>),
+ <xsl:value-of select="$method"/>,
+ <xscript:get scope="request" name="{$tempvar}"
as="object"/>).invoke(),
+ <xsl:value-of select="$scope"/>);
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("SOAP result is\n" +
+ <xscript:get scope="request"
name="{$tempvar}" as="object"/>);
+ }
+ <xscript:get scope="request" name="{$tempvar}"/>
} catch (Exception ex) {
- <soap-err:error
xmlns:soap-err="http://apache.org/xsp/soap/3.0"><xsp:expr>ex</xsp:expr></soap-err:error>
- getLogger().error(ex.toString(), ex);
+ <soap-err:error
xmlns:soap-err="http://apache.org/xsp/soap/3.0"><xsp:expr>ex</xsp:expr></soap-err:error>
+ getLogger().error("SOAP call failed", ex);
}
</xsp:logic>
</xsl:template>
1.2 +4 -3
cocoon-2.0/src/java/org/apache/cocoon/components/language/markup/xsp/java/xscript-lib.xsl
Index: xscript-lib.xsl
===================================================================
RCS file:
/home/cvs/cocoon-2.0/src/java/org/apache/cocoon/components/language/markup/xsp/java/xscript-lib.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xscript-lib.xsl 9 Mar 2003 00:02:01 -0000 1.1
+++ xscript-lib.xsl 22 May 2003 21:26:26 -0000 1.2
@@ -106,7 +106,7 @@
</xsl:variable>
<xsl:choose>
<xsl:when test="$as = 'object'">
- <xsp:logic><xsl:value-of select="$object"/></xsp:logic>
+ <xsp:expr><xsl:value-of select="$object"/></xsp:expr>
</xsl:when>
<xsl:otherwise>
<!-- insert the content of the XScript variable in the SAX
@@ -197,6 +197,7 @@
<xsl:value-of select="$scope"/>);
</xsp:logic>
</xsl:template>
+
<xsl:template name="xscript-variable-inline">
<!-- PUBLIC: create an XScript variable from inline XML -->
1.2 +7 -9
cocoon-2.0/src/java/org/apache/cocoon/components/language/markup/xsp/java/xscript.xsl
Index: xscript.xsl
===================================================================
RCS file:
/home/cvs/cocoon-2.0/src/java/org/apache/cocoon/components/language/markup/xsp/java/xscript.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xscript.xsl 9 Mar 2003 00:02:01 -0000 1.1
+++ xscript.xsl 22 May 2003 21:26:26 -0000 1.2
@@ -122,13 +122,11 @@
</xsl:call-template>
</xsl:variable>
- <xsp:logic>
- <xsl:call-template name="xscript-get">
- <xsl:with-param name="name" select="@name"/>
- <xsl:with-param name="as" select="@as"/>
- <xsl:with-param name="scope" select="$scope"/>
- </xsl:call-template>;
- </xsp:logic>
+ <xsl:call-template name="xscript-get">
+ <xsl:with-param name="name" select="@name"/>
+ <xsl:with-param name="as" select="@as"/>
+ <xsl:with-param name="scope" select="$scope"/>
+ </xsl:call-template>
</xsl:template>
1.2 +35 -37
cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp/java/soap.xsl
Index: soap.xsl
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp/java/soap.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- soap.xsl 9 Mar 2003 00:08:57 -0000 1.1
+++ soap.xsl 22 May 2003 21:26:26 -0000 1.2
@@ -63,14 +63,14 @@
-->
<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsp="http://apache.org/xsp"
- xmlns:xscript="http://apache.org/xsp/xscript/1.0"
- xmlns:soap="http://apache.org/xsp/soap/3.0"
- >
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:xscript="http://apache.org/xsp/xscript/1.0"
+ xmlns:soap="http://apache.org/xsp/soap/3.0">
<xsl:include href="xscript-lib.xsl"/>
+
<xsl:template match="xsp:page">
<xsp:page>
<xsl:apply-templates select="@*"/>
@@ -81,6 +81,7 @@
</xsp:page>
</xsl:template>
+
<xsl:template match="soap:call">
<xsl:variable name="url">
<xsl:choose>
@@ -99,18 +100,17 @@
</xsl:variable>
<xsl:variable name="scope">
- <xsl:call-template name="xscript-get-scope">
- <xsl:with-param name="scope" select="@scope"/>
+ <xsl:call-template name="xscript-get-scope-for-creation">
+ <xsl:with-param name="scope" select="'request'"/>
</xsl:call-template>
</xsl:variable>
- <xsl:variable name="creation-scope">
- <xsl:call-template name="xscript-get-scope-for-creation">
- <xsl:with-param name="scope" select="@scope"/>
- </xsl:call-template>
+ <xsl:variable name="tempvar">
+ <xsl:text>__soap_call_</xsl:text>
+ <xsl:value-of select="generate-id(.)"/>
</xsl:variable>
- <xscript:variable name="soap:call">
+ <xscript:variable scope="request" name="{$tempvar}">
<xsl:choose>
<xsl:when test="soap:env">
<xsl:apply-templates select="soap:env"/>
@@ -120,35 +120,33 @@
</xsl:otherwise>
</xsl:choose>
</xscript:variable>
- <xsl:variable name="object">
- <xsl:call-template name="xscript-get">
- <xsl:with-param name="name" select="'soap:call'"/>
- <xsl:with-param name="scope" select="$scope"/>
- <xsl:with-param name="as" select="'object'"/>
- </xsl:call-template>
- </xsl:variable>
+
<xsp:logic>
- getLogger().debug(
- "XScriptObject for soap:call is\n" + <xsl:value-of
select="$object"/> +
- ", sending request to: " + <xsl:value-of select="$url"/>
- );
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("XScriptObject for soap:call is\n" +
+ <xscript:get scope="request" name="{$tempvar}" as="object"/> +
+ ", sending request to: " + <xsl:value-of select="$url"/>);
+ }
try {
- xscriptManager.put(pageScope, objectModel, "soap:call",
- ((new SOAPHelper(manager,
- XSPRequestHelper.getRequestedURL(objectModel),
- String.valueOf(<xsl:value-of select="$url"/>),
- <xsl:value-of select="$method"/>,
- <xsl:value-of select="$object"/>
- )).invoke()),
- <xsl:value-of select="$creation-scope"/>);
- getLogger().debug("SOAP result is\n" + <xsl:value-of
select="$object"/>);
- <xscript:get name="soap:call"/>
+ xscriptManager.put(pageScope, objectModel, "<xsl:value-of
select="$tempvar"/>",
+ new SOAPHelper(manager,
+ XSPRequestHelper.getRequestedURL(objectModel),
+ String.valueOf(<xsl:value-of select="$url"/>),
+ <xsl:value-of select="$method"/>,
+ <xscript:get scope="request" name="{$tempvar}"
as="object"/>).invoke(),
+ <xsl:value-of select="$scope"/>);
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("SOAP result is\n" +
+ <xscript:get scope="request"
name="{$tempvar}" as="object"/>);
+ }
+ <xscript:get scope="request" name="{$tempvar}"/>
} catch (Exception ex) {
- <soap-err:error
xmlns:soap-err="http://apache.org/xsp/soap/3.0"><xsp:expr>ex</xsp:expr></soap-err:error>
- getLogger().error(ex.toString(), ex);
+ <soap-err:error
xmlns:soap-err="http://apache.org/xsp/soap/3.0"><xsp:expr>ex</xsp:expr></soap-err:error>
+ getLogger().error("SOAP call failed", ex);
}
</xsp:logic>
</xsl:template>
+
<xsl:template match="soap:env" name="soap-env">
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
1.2 +4 -3
cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp/java/xscript-lib.xsl
Index: xscript-lib.xsl
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp/java/xscript-lib.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xscript-lib.xsl 9 Mar 2003 00:08:57 -0000 1.1
+++ xscript-lib.xsl 22 May 2003 21:26:26 -0000 1.2
@@ -106,7 +106,7 @@
</xsl:variable>
<xsl:choose>
<xsl:when test="$as = 'object'">
- <xsp:logic><xsl:value-of select="$object"/></xsp:logic>
+ <xsp:expr><xsl:value-of select="$object"/></xsp:expr>
</xsl:when>
<xsl:otherwise>
<!-- insert the content of the XScript variable in the SAX
@@ -197,6 +197,7 @@
<xsl:value-of select="$scope"/>);
</xsp:logic>
</xsl:template>
+
<xsl:template name="xscript-variable-inline">
<!-- PUBLIC: create an XScript variable from inline XML -->
1.2 +7 -9
cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp/java/xscript.xsl
Index: xscript.xsl
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/language/markup/xsp/java/xscript.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xscript.xsl 9 Mar 2003 00:08:57 -0000 1.1
+++ xscript.xsl 22 May 2003 21:26:26 -0000 1.2
@@ -122,13 +122,11 @@
</xsl:call-template>
</xsl:variable>
- <xsp:logic>
- <xsl:call-template name="xscript-get">
- <xsl:with-param name="name" select="@name"/>
- <xsl:with-param name="as" select="@as"/>
- <xsl:with-param name="scope" select="$scope"/>
- </xsl:call-template>;
- </xsp:logic>
+ <xsl:call-template name="xscript-get">
+ <xsl:with-param name="name" select="@name"/>
+ <xsl:with-param name="as" select="@as"/>
+ <xsl:with-param name="scope" select="$scope"/>
+ </xsl:call-template>
</xsl:template>