You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by di...@apache.org on 2001/04/16 19:59:46 UTC
cvs commit: xml-cocoon/webapp/stylesheets/page simple-page2html.xsl
dims 01/04/16 10:59:46
Modified: webapp Tag: xml-cocoon2 sitemap.xmap
webapp/docs/samples/forms Tag: xml-cocoon2 employee.xsp
webapp/docs/samples/slides Tag: xml-cocoon2 clean-page.xml
lib-page.xml page.xml slides.xml view-source.xsp
webapp/docs/samples/xsp Tag: xml-cocoon2 simple.xsp
upload.xsp
webapp/stylesheets/page Tag: xml-cocoon2
simple-page2html.xsl
Log:
Added view-source facility to most of the XSP driven pages. This will enable
users (read beginners) to quickly view the sample XSP sources.
Revision Changes Path
No revision
No revision
1.1.2.51 +22 -13 xml-cocoon/webapp/Attic/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-cocoon/webapp/Attic/sitemap.xmap,v
retrieving revision 1.1.2.50
retrieving revision 1.1.2.51
diff -u -r1.1.2.50 -r1.1.2.51
--- sitemap.xmap 2001/04/16 14:01:11 1.1.2.50
+++ sitemap.xmap 2001/04/16 17:59:43 1.1.2.51
@@ -279,15 +279,6 @@
<map:redirect-to resource="slides"/>
</map:match>
- <map:match pattern="slides/view-source/*">
- <map:read src="docs/samples/slides/{1}" mime-type="text/plain"/>
- </map:match>
-
- <map:match pattern="slides/view-source">
- <map:generate type="serverpages" src="docs/samples/slides/view-source.xsp"/>
- <map:serialize/>
- </map:match>
-
<map:match pattern="slides/">
<map:redirect-to resource="slides"/>
</map:match>
@@ -311,7 +302,9 @@
<!-- =========================== Dynamic ================================ -->
<map:match pattern="xsp/*">
<map:generate type="serverpages" src="docs/samples/xsp/{1}.xsp"/>
- <map:transform src="stylesheets/dynamic-page2html.xsl"/>
+ <map:transform src="stylesheets/dynamic-page2html.xsl">
+ <parameter name="view-source" value="docs/samples/xsp/{1}.xsp"/>
+ </map:transform>
<map:serialize/>
</map:match>
@@ -334,14 +327,18 @@
<map:act set="employee">
<parameter name="form-descriptor" value="context://docs/samples/forms/employee.xml"/>
<map:generate type="serverpages" src="docs/samples/forms/employee.xsp"/>
- <map:transform src="stylesheets/dynamic-page2html.xsl"/>
+ <map:transform src="stylesheets/dynamic-page2html.xsl">
+ <parameter name="view-source" value="docs/samples/forms/employee.xsp"/>
+ </map:transform>
<map:serialize/>
</map:act>
</map:match>
<map:match pattern="forms/*">
<map:generate type="serverpages" src="docs/samples/forms/{1}.xsp"/>
- <map:transform src="stylesheets/dynamic-page2html.xsl"/>
+ <map:transform src="stylesheets/dynamic-page2html.xsl">
+ <parameter name="view-source" value="docs/samples/forms/{1}.xsp"/>
+ </map:transform>
<map:serialize/>
</map:match>
@@ -352,8 +349,20 @@
<map:match pattern="session/*.xsp*">
<map:generate type="serverpages" src="docs/samples/session/{1}.xsp"/>
- <map:transform src="stylesheets/dynamic-page2html.xsl"/>
+ <map:transform src="stylesheets/dynamic-page2html.xsl">
+ <parameter name="view-source" value="docs/samples/session/{1}.xsp"/>
+ </map:transform>
<map:serialize/>
+ </map:match>
+
+ <!-- ========================== XSP Sources ============================== -->
+ <map:match pattern="view-source/*">
+ <map:read src="docs/samples/slides/{1}" mime-type="text/plain"/>
+ </map:match>
+
+ <map:match pattern="view-source">
+ <map:generate type="serverpages" src="docs/samples/slides/view-source.xsp"/>
+ <map:serialize/>
</map:match>
<!-- ========================= Server ================================ -->
No revision
No revision
1.1.2.9 +3 -1 xml-cocoon/webapp/docs/samples/forms/Attic/employee.xsp
Index: employee.xsp
===================================================================
RCS file: /home/cvs/xml-cocoon/webapp/docs/samples/forms/Attic/employee.xsp,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- employee.xsp 2001/02/27 17:08:14 1.1.2.8
+++ employee.xsp 2001/04/16 17:59:43 1.1.2.9
@@ -78,7 +78,9 @@
</select>
</para>
<xsp:logic>
- if (empID != null && !empID.equals("-1")) {
+ <![CDATA[
+ if (empID != null && !empID.equals("-1")) {
+ ]]>
<input type="submit" name="cocoon-action" value="Update"/>
<input type="submit" name="cocoon-action" value="Delete"/>
} else {
No revision
No revision
1.1.2.3 +3 -3 xml-cocoon/webapp/docs/samples/slides/Attic/clean-page.xml
Index: clean-page.xml
===================================================================
RCS file: /home/cvs/xml-cocoon/webapp/docs/samples/slides/Attic/clean-page.xml,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- clean-page.xml 2000/09/08 15:42:08 1.1.2.2
+++ clean-page.xml 2001/04/16 17:59:44 1.1.2.3
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- Author: Stefano Mazzocchi "stefano@apache.org" -->
-<!-- Version: $Id: clean-page.xml,v 1.1.2.2 2000/09/08 15:42:08 giacomo Exp $ -->
+<!-- Version: $Id: clean-page.xml,v 1.1.2.3 2001/04/16 17:59:44 dims Exp $ -->
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="page-xsp.xsl" type="text/xsl"?>
@@ -60,8 +60,8 @@
<p>All right, the first XSP page is over, but you can see the
dynamically syntax highlighted
- <link href="view-source.xml?filename=clean-page.xml">source of this page</link>
- and its <link href="view-source.xml?filename=page-xsp.xsl">logicsheet</link>
+ <link href="../view-source.xml?filename=clean-page.xml">source of this page</link>
+ and its <link href="../view-source.xml?filename=page-xsp.xsl">logicsheet</link>
provided to you by another XSP page.</p>
<p>Enjoy XSP!</p>
1.1.2.3 +2 -2 xml-cocoon/webapp/docs/samples/slides/Attic/lib-page.xml
Index: lib-page.xml
===================================================================
RCS file: /home/cvs/xml-cocoon/webapp/docs/samples/slides/Attic/lib-page.xml,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- lib-page.xml 2000/09/08 15:42:13 1.1.2.2
+++ lib-page.xml 2001/04/16 17:59:44 1.1.2.3
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- Author: Stefano Mazzocchi "stefano@apache.org" -->
-<!-- Version: $Id: lib-page.xml,v 1.1.2.2 2000/09/08 15:42:13 giacomo Exp $ -->
+<!-- Version: $Id: lib-page.xml,v 1.1.2.3 2001/04/16 17:59:44 dims Exp $ -->
<?cocoon-process type="xsp"?>
@@ -69,7 +69,7 @@
the taglib issue. -->
<p>All right, the first XSP page is over, but you can see the dynamically syntax highlighted
- <link href="view-source.xml?filename=lib-page.xml">source of this page</link>,
+ <link href="../view-source.xml?filename=lib-page.xml">source of this page</link>,
all provided to you by another XSP page.</p>
<p>Enjoy XSP!</p>
1.1.2.3 +2 -2 xml-cocoon/webapp/docs/samples/slides/Attic/page.xml
Index: page.xml
===================================================================
RCS file: /home/cvs/xml-cocoon/webapp/docs/samples/slides/Attic/page.xml,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- page.xml 2000/09/08 15:42:15 1.1.2.2
+++ page.xml 2001/04/16 17:59:44 1.1.2.3
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!-- Author: Stefano Mazzocchi "stefano@apache.org" -->
-<!-- Version: $Id: page.xml,v 1.1.2.2 2000/09/08 15:42:15 giacomo Exp $ -->
+<!-- Version: $Id: page.xml,v 1.1.2.3 2001/04/16 17:59:44 dims Exp $ -->
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
@@ -124,7 +124,7 @@
</xsp:logic>
<p>All right, the first XSP page is over, but you can see the
- <link href="view-source.xml?filename=page.xml">dynamically syntax highlighted</link>
+ <link href="../view-source.xml?filename=page.xml">dynamically syntax highlighted</link>
source of this page provided to you by another XSP page.</p>
<p>Enjoy XSP!</p>
1.1.2.6 +5 -5 xml-cocoon/webapp/docs/samples/slides/Attic/slides.xml
Index: slides.xml
===================================================================
RCS file: /home/cvs/xml-cocoon/webapp/docs/samples/slides/Attic/slides.xml,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- slides.xml 2001/04/03 10:26:29 1.1.2.5
+++ slides.xml 2001/04/16 17:59:44 1.1.2.6
@@ -319,17 +319,17 @@
<slide>
<title>Possible different scenarios</title>
<ul>
- <li><link uri="view-source?filename=/docs/samples/slides/page.xml">integrated xsp tags</link></li>
- <li><link uri="view-source?filename=/docs/samples/slides/clean-page.xml">custom tags transformed by your stylesheets</link></li>
- <li><link uri="view-source?filename=/docs/samples/slides/lib-page.xml">use of cocoon taglibs</link></li>
+ <li><link uri="../view-source?filename=/docs/samples/slides/page.xml">integrated xsp tags</link></li>
+ <li><link uri="../view-source?filename=/docs/samples/slides/clean-page.xml">custom tags transformed by your stylesheets</link></li>
+ <li><link uri="../view-source?filename=/docs/samples/slides/lib-page.xml">use of cocoon taglibs</link></li>
</ul>
</slide>
<slide>
<title>Other dynamic possibilities</title>
<ul>
- <li><link uri="view-source?filename=/docs/samples/slides/database-page.xml">SQLProcessor</link></li>
- <li><link uri="view-source?filename=/docs/samples/slides/ldap.xml">LDAPProcessor</link></li>
+ <li><link uri="../view-source?filename=/docs/samples/slides/database-page.xml">SQLProcessor</link></li>
+ <li><link uri="../view-source?filename=/docs/samples/slides/ldap.xml">LDAPProcessor</link></li>
<li>... add yours</li>
</ul>
</slide>
1.1.2.7 +6 -0 xml-cocoon/webapp/docs/samples/slides/Attic/view-source.xsp
Index: view-source.xsp
===================================================================
RCS file: /home/cvs/xml-cocoon/webapp/docs/samples/slides/Attic/view-source.xsp,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- view-source.xsp 2001/04/03 10:26:30 1.1.2.6
+++ view-source.xsp 2001/04/16 17:59:44 1.1.2.7
@@ -253,6 +253,12 @@
newParser.parse(is);
this.colorize(builder.getDocument(), document, this.contentHandler);
+ } catch (SAXException e){
+ getLogger().debug("SAXException in colorize", e);
+ throw e;
+ } catch (org.w3c.dom.DOMException e){
+ getLogger().debug("DOMException in colorize", e);
+ throw e;
} catch (Exception e) {
getLogger().error("Could not include page", e);
} finally {
No revision
No revision
1.1.2.7 +6 -2 xml-cocoon/webapp/docs/samples/xsp/Attic/simple.xsp
Index: simple.xsp
===================================================================
RCS file: /home/cvs/xml-cocoon/webapp/docs/samples/xsp/Attic/simple.xsp,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- simple.xsp 2000/11/28 18:39:51 1.1.2.6
+++ simple.xsp 2001/04/16 17:59:45 1.1.2.7
@@ -24,11 +24,15 @@
<ul>
<xsp:logic>
- for (int i = 0; i < 3; i++) {
+ <![CDATA[
+ for (int i=0; i<3; i++) {
+ ]]>
<li>
Item <xsp:expr>i</xsp:expr>
</li>
- }
+ <![CDATA[
+ }
+ ]]>
</xsp:logic>
</ul>
1.1.2.4 +5 -1 xml-cocoon/webapp/docs/samples/xsp/Attic/upload.xsp
Index: upload.xsp
===================================================================
RCS file: /home/cvs/xml-cocoon/webapp/docs/samples/xsp/Attic/upload.xsp,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- upload.xsp 2001/04/02 13:53:11 1.1.2.3
+++ upload.xsp 2001/04/16 17:59:45 1.1.2.4
@@ -32,11 +32,15 @@
<ul>
<xsp:logic>
String[] filelist = uploadDir.list();
- for (int i = 0; i < filelist.length; i++) {
+ <![CDATA[
+ for (int i = 0; i > filelist.length; i++) {
+ ]]>
<li>
<xsp:expr>filelist[i]</xsp:expr>
</li>
+ <![CDATA[
}
+ ]]>
</xsp:logic>
</ul>
</para>
No revision
No revision
1.1.2.4 +12 -1 xml-cocoon/webapp/stylesheets/page/Attic/simple-page2html.xsl
Index: simple-page2html.xsl
===================================================================
RCS file: /home/cvs/xml-cocoon/webapp/stylesheets/page/Attic/simple-page2html.xsl,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- simple-page2html.xsl 2000/08/31 14:54:16 1.1.2.3
+++ simple-page2html.xsl 2001/04/16 17:59:46 1.1.2.4
@@ -2,6 +2,8 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:param name="view-source"/>
+
<xsl:template match="page">
<html>
<head>
@@ -17,7 +19,16 @@
<xsl:template match="title">
<h2 style="color: navy; text-align: center">
- <xsl:apply-templates/>
+ <xsl:if test="not($view-source)">
+ <xsl:apply-templates/>
+ </xsl:if>
+ <xsl:if test="$view-source">
+ <A>
+ <xsl:attribute name="HREF">../view-source?filename=/<xsl:value-of select="$view-source"/></xsl:attribute>
+ <xsl:attribute name="TARGET">_blank</xsl:attribute>
+ <xsl:apply-templates/>
+ </A>
+ </xsl:if>
</h2>
</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