antonio 2004/04/17 00:18:47
Modified: src/blocks/itext/samples/cache-test xsp-sample-to-itext.xsl
src/blocks/itext/samples/misc samples.xml minimal.itext.xml
src/blocks/itext/samples sitemap.xmap
Log:
Fixing iText samples
Revision Changes Path
1.3 +47 -7
cocoon-2.1/src/blocks/itext/samples/cache-test/xsp-sample-to-itext.xsl
Index: xsp-sample-to-itext.xsl
===================================================================
RCS file:
/home/cvs//cocoon-2.1/src/blocks/itext/samples/cache-test/xsp-sample-to-itext.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- xsp-sample-to-itext.xsl 6 Mar 2004 02:26:07 -0000 1.2
+++ xsp-sample-to-itext.xsl 17 Apr 2004 07:18:47 -0000 1.3
@@ -20,6 +20,8 @@
in order to test caching of the whole pipeline, up to PDF
@author [EMAIL PROTECTED]
+
+ CVS $Id:
-->
<xsl:stylesheet
@@ -31,10 +33,10 @@
<xsl:template match="/">
<itext creationdate="Fri May 23 9:30:00 CEST 2003" producer="[EMAIL
PROTECTED]">
-
- <xsl:call-template name="repeatPages">
- <xsl:with-param name="nPages" select="$pages"/>
- </xsl:call-template>
+ <xsl:call-template name="explain"/>
+ <xsl:call-template name="repeatPages">
+ <xsl:with-param name="nPages" select="$pages"/>
+ </xsl:call-template>
<paragraph font="unknown" size="12.0" align="Default">
End of test document
@@ -48,7 +50,7 @@
<paragraph font="unknown" size="12.0" align="Default">
<newpage/>
- Dummy page, used to slow down FOP generation to test caching...
+ Dummy page, used to slow down iText generation to test caching...
<xsl:value-of select="$nPages"/> pages to go.
</paragraph>
@@ -59,6 +61,44 @@
</xsl:if>
</xsl:template>
+ <!-- explain this sample -->
+ <xsl:template name="explain">
+ <phrase leading="27.0" align="Default" font="Helvetica" size="18.0"
fontstyle="normal" red="0" green="64" blue="64">
+ What's this?
+ </phrase>
+ <newline/>
+ <paragraph font="unknown" size="12.0" align="Default">
+ This sample reuses the XSP cacheable sample page and allows you
+ to test caching all the way up to PDF generation.
+ </paragraph>
+ <paragraph font="unknown" size="12.0" align="Default">
+ Note that I was unable to get caching to work when using the
cocoon:/
+ protocol and the FileGenerator to access the output of the XSP
sample.
+ Using the XSP page directly with the serverpages generator works.
+ </paragraph>
+ <newline/><newline/>
+ <phrase leading="27.0" align="Default" font="Helvetica" size="18.0"
fontstyle="normal" red="0" green="64" blue="64">
+ How to test the cache
+ </phrase>
+ <newline/>
+ <paragraph font="unknown" size="12.0" align="Default">
+ Call this page as described below and use the information shown
in
+ <chunk font="Helvetica" size="14.0" fontstyle="normal" red="255"
green="0" blue="0">red</chunk> under
+ <chunk font="Helvetica" size="14.0" fontstyle="normal" red="255"
green="0" blue="0">original output</chunk>
+ below to check that the cache is working.
+ </paragraph>
+ <paragraph font="unknown" size="12.0" align="Default">
+ The sitemap log (or whatever log the FOPSerializer is configured
to write to) can also
+ be used to tell if FOP is converting the data or if its being
served from the Cocoon cache.
+ </paragraph>
+ <paragraph font="unknown" size="12.0" align="Default">
+ Different values of
+ <chunk font="Helvetica" size="14.0" fontstyle="normal" red="255"
green="0" blue="0">pageKey</chunk> should cause different versions of the
document to be cached.
+ </paragraph>
+ <paragraph font="unknown" size="12.0" align="Default">
+ The number at the end of the page name is the number of pages to
generate in the output PDF.
+ </paragraph>
+ </xsl:template>
<!-- minimal HTML scraping of input -->
<xsl:template match="*[starts-with(name(),'h')]|p">
@@ -79,5 +119,5 @@
<xsl:apply-templates/>
</chunk>
</xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
+
+</xsl:stylesheet>
1.6 +1 -0 cocoon-2.1/src/blocks/itext/samples/misc/samples.xml
Index: samples.xml
===================================================================
RCS file: /home/cvs//cocoon-2.1/src/blocks/itext/samples/misc/samples.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- samples.xml 5 Apr 2004 12:25:33 -0000 1.5
+++ samples.xml 17 Apr 2004 07:18:47 -0000 1.6
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<!-- CVS $Id: -->
<samples xmlns:xlink="http://www.w3.org/1999/xlink" name="iText Block
Samples">
<group name="Back">
1.3 +1 -0
cocoon-2.1/src/blocks/itext/samples/misc/minimal.itext.xml
Index: minimal.itext.xml
===================================================================
RCS file:
/home/cvs//cocoon-2.1/src/blocks/itext/samples/misc/minimal.itext.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- minimal.itext.xml 6 Mar 2004 02:25:49 -0000 1.2
+++ minimal.itext.xml 17 Apr 2004 07:18:47 -0000 1.3
@@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
+<!-- CVS $Id: -->
<!DOCTYPE ITEXT SYSTEM "http://www.lowagie.com/iText/itext.dtd">
<itext creationdate="Fri May 23 9:30:00 CEST 2003" producer="[EMAIL
PROTECTED]">
<paragraph font="unknown" size="18.0" align="Center">
1.4 +2 -2 cocoon-2.1/src/blocks/itext/samples/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs//cocoon-2.1/src/blocks/itext/samples/sitemap.xmap,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sitemap.xmap 6 Mar 2004 02:26:20 -0000 1.3
+++ sitemap.xmap 17 Apr 2004 07:18:47 -0000 1.4
@@ -83,7 +83,7 @@
<!-- reuse the XSP caching example for our caching test -->
<map:match pattern="cache-test-*.pdf">
<!-- note that caching didn't work when accessing the XSP using the
cocoon:/ protocol -->
- <map:generate src="../xsp/xsp/cacheable.xsp" type="serverpages"/>
+ <map:generate src="../xsp/java/cacheable.xsp" type="serverpages"/>
<map:transform src="cache-test/xsp-sample-to-itext.xsl">
<map:parameter name="pages" value="{1}"/>
</map:transform>