You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ha...@apache.org on 2002/09/06 11:52:43 UTC
cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java esql.xsl
haul 2002/09/06 02:52:43
Modified: src/java/org/apache/cocoon/components/language/markup/xsp/java
esql.xsl
Log:
Patch thanks to neil <nb...@aisoftware.com.au>
- removes reflexion in favour of verbatim copy
- adds paging for results obtained from column
Revision Changes Path
1.32 +21 -4 xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl
Index: esql.xsl
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/esql.xsl,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- esql.xsl 9 Aug 2002 08:28:14 -0000 1.31
+++ esql.xsl 6 Sep 2002 09:52:43 -0000 1.32
@@ -978,13 +978,28 @@
<xspdoc:desc>creates a nested query like block that uses the result set obtained from a column as current result set.</xspdoc:desc>
<xsl:template name="use-results" match="esql:use-results[child::esql:result]">
+ <xsl:variable name="maxrows"><xsl:call-template name="get-nested-string"><xsl:with-param name="content" select="esql:max-rows"/></xsl:call-template></xsl:variable>
+ <xsl:variable name="skiprows"><xsl:call-template name="get-nested-string"><xsl:with-param name="content" select="esql:skip-rows"/></xsl:call-template></xsl:variable>
<xsp:logic>
// nested result set
if (_esql_query != null) {
_esql_queries.push(_esql_query);
}
_esql_query = new EsqlQuery((ResultSet) <xsl:apply-templates select="esql:result/*"/>);
- {
+
+ <xsl:if test="esql:max-rows">
+ try {
+ _esql_query.setMaxRows( Integer.parseInt(String.valueOf(<xsl:copy-of select="$maxrows"/>).trim()) );
+ } catch (NumberFormatException e) {}
+ </xsl:if>
+
+ <xsl:if test="esql:skip-rows">
+ try {
+ _esql_query.setSkipRows( Integer.parseInt(String.valueOf(<xsl:copy-of select="$skiprows"/>).trim()) );
+ } catch (NumberFormatException e) {}
+ </xsl:if>
+
+ {
<xsl:call-template name="do-results"/>
}
if (_esql_queries.empty()) {
@@ -1098,7 +1113,9 @@
<xsl:when test="$type='AsciiStream'">Types.LONGVARCHAR</xsl:when>
<xsl:when test="$type='UnicodeStream'">Types.LONGVARCHAR</xsl:when>
<xsl:when test="$type='BinaryStream'">Types.VARBINARY</xsl:when>
- <xsl:when test="contains($type,'.')">EsqlQuery.getType("<xsl:value-of select="$type"/>")</xsl:when>
+ <!-- handle DBMS specific types e.g. oracle.jdbc.driver.OracleTypes.CURSOR -->
+ <xsl:when test="contains($type,'.')"><xsl:value-of select="$type"/></xsl:when>
+ <!-- default to upper case type -->
<xsl:otherwise>Types.<xsl:value-of select="translate(@type,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/></xsl:otherwise>
</xsl:choose>
</xsl:template>
----------------------------------------------------------------------
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