You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2001/07/28 05:13:54 UTC
cvs commit: xml-cocoon2/xdocs actions.xml caching.xml datasources.xml esql.xml httprequest.xml i18n-transformer.xml index.xml installing.xml logicsheet-forms.xml matchers_selectors.xml sessions.xml views.xml xsp-internals.xml
vgritsenko 01/07/27 20:13:54
Modified: xdocs actions.xml caching.xml datasources.xml esql.xml
httprequest.xml i18n-transformer.xml index.xml
installing.xml logicsheet-forms.xml
matchers_selectors.xml sessions.xml views.xml
xsp-internals.xml
Log:
fit documents on screen/printer
Revision Changes Path
1.8 +5 -2 xml-cocoon2/xdocs/actions.xml
Index: actions.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/actions.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- actions.xml 2001/07/24 09:49:22 1.7
+++ actions.xml 2001/07/28 03:13:53 1.8
@@ -13,7 +13,8 @@
</authors>
</header>
<body>
- <s1 title="What is an Action?">
+ <s1 title="The Actions">
+ <s2 title="What is an Action?">
<p>
@docname@ has a rich set of tools for publishing web documents, and while
XSP and Generators provide alot of functionality, they still mix content
@@ -34,6 +35,7 @@
any display data. <link href="actions.txt">actions.txt</link> contains
excerpts from discussions on the cocoon-dev@ mailing list regarding Actions.
</p>
+ </s2>
<s2 title="When to use an Action instead of XSP">
<p>
Sometimes it is going to be quicker for you to create and handle
@@ -54,7 +56,8 @@
<esql:connection>
<esql:dbpool>mypool</esql:dbpool>
<esql:execute-query>
- <esql:query>SELECT userid FROM users WHERE name=<esql:parameter>name</esql:parameter>
+ <esql:query>SELECT userid FROM users
+ WHERE name=<esql:parameter>name</esql:parameter>
AND password=<esql:parameter>password</esql:parameter></esql:query>
<esql:row-results>
<xsp:logic>
1.10 +16 -13 xml-cocoon2/xdocs/caching.xml
Index: caching.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/caching.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- caching.xml 2001/07/19 13:47:19 1.9
+++ caching.xml 2001/07/28 03:13:53 1.10
@@ -182,20 +182,22 @@
components which can be configured in the cocoon.xconf:</p>
<source>
<![CDATA[
- <event-pipeline class="org.apache.cocoon.components.pipeline.CachingEventPipeline"/>
+<event-pipeline
+ class="org.apache.cocoon.components.pipeline.CachingEventPipeline"/>
- <stream-pipeline class="org.apache.cocoon.components.pipeline.CachingStreamPipeline"/>
-
+<stream-pipeline
+ class="org.apache.cocoon.components.pipeline.CachingStreamPipeline"/>
]]>
</source>
<p>If you want to completely turn off caching, use the following
definitions:</p>
<source>
<![CDATA[
- <event-pipeline class="org.apache.cocoon.components.pipeline.NonCachingEventPipeline"/>
-
- <stream-pipeline class="org.apache.cocoon.components.pipeline.NonCachingStreamPipeline"/>
+<event-pipeline
+ class="org.apache.cocoon.components.pipeline.NonCachingEventPipeline"/>
+<stream-pipeline
+ class="org.apache.cocoon.components.pipeline.NonCachingStreamPipeline"/>
]]>
</source> </s2>
<s2 title="The XMLSerializer/XMLDeserializer">
@@ -203,10 +205,11 @@
can be configured in the cocoon.xconf:</p>
<source>
<![CDATA[
- <xml-serializer class="org.apache.cocoon.components.sax.XMLByteStreamCompiler"/>
-
- <xml-deserializer class="org.apache.cocoon.components.sax.XMLByteStreamInterpreter"/>
+<xml-serializer
+ class="org.apache.cocoon.components.sax.XMLByteStreamCompiler"/>
+<xml-deserializer
+ class="org.apache.cocoon.components.sax.XMLByteStreamInterpreter"/>
]]>
</source>
<p>You must assure that the correct (or matching) deserializer is
@@ -217,12 +220,12 @@
can be configured in the cocoon.xconf:</p>
<source>
<![CDATA[
- <event-cache class="org.apache.cocoon.caching.EventMemoryCache"/>
+<event-cache class="org.apache.cocoon.caching.EventMemoryCache"/>
- <stream-cache class="org.apache.cocoon.caching.StreamMemoryCache"/>
-
+<stream-cache class="org.apache.cocoon.caching.StreamMemoryCache"/>
]]>
- </source> </s2>
+ </source>
+ </s2>
</s1>
<s1 title="Java APIs">
<p>For more information on the java apis refer directly to the
1.4 +10 -5 xml-cocoon2/xdocs/datasources.xml
Index: datasources.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/datasources.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- datasources.xml 2001/07/19 13:47:19 1.3
+++ datasources.xml 2001/07/28 03:13:53 1.4
@@ -65,14 +65,16 @@
<component name="org.apache.avalon.util.datasource.DataSourceComponentSelector"
class="org.apache.cocoon.CocoonComponentSelector">
- <component-instance name="MyConnectionName" class="org.apache.avalon.util.datasource.JdbcDataSource">
+ <component-instance name="MyConnectionName"
+ class="org.apache.avalon.util.datasource.JdbcDataSource">
<pool-controller min="5" max="10"/>
<dburl>jdbc:oracle:thin:@localhost:1521:mydatabase</dburl>
<user>mylogin</user>
<password>myPassword</password>
</component-instance>
- <component-instance name="MyJ2eeConnection" class="org.apache.avalon.util.datasource.J2eeDataSource">
+ <component-instance name="MyJ2eeConnection"
+ class="org.apache.avalon.util.datasource.J2eeDataSource">
<dbname>cocoonDB</dbname>
</component-instance>
</component>
@@ -84,14 +86,16 @@
<source>
<![CDATA[
<datasources>
- <component-instance name="MyConnectionName" class="org.apache.avalon.util.datasource.JdbcDataSource">
+ <component-instance name="MyConnectionName"
+ class="org.apache.avalon.util.datasource.JdbcDataSource">
<pool-controller min="5" max="10"/>
<dburl>jdbc:oracle:thin:@localhost:1521:mydatabase</dburl>
<user>mylogin</user>
<password>myPassword</password>
</component-instance>
- <component-instance name="MyJ2eeConnection" class="org.apache.avalon.util.datasource.J2eeDataSource">
+ <component-instance name="MyJ2eeConnection"
+ class="org.apache.avalon.util.datasource.J2eeDataSource">
<dbname>cocoonDB</dbname>
</component-instance>
</datasources>
@@ -163,7 +167,8 @@
private DataSourceComponent datasource;
public void compose(ComponentManager manager) {
- ComponentSelector selector = (ComponentSelector) manager.lookup(Roles.DB_CONNECTION);
+ ComponentSelector selector =
+ (ComponentSelector) manager.lookup(Roles.DB_CONNECTION);
this.datasource = (DataSourceComponent) selector.select("MyConnectionName");
}
1.7 +6 -5 xml-cocoon2/xdocs/esql.xml
Index: esql.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/esql.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- esql.xml 2001/07/27 14:40:01 1.6
+++ esql.xml 2001/07/28 03:13:53 1.7
@@ -29,11 +29,12 @@
<s1 title="Installation">
<p>Check your cocoon.properties for this line and add it if it's not already there:</p>
<source><![CDATA[
- <builtin-logicsheet>
- <parameter name="prefix" value="esql"/>
- <parameter name="uri" value="http://apache.org/cocoon/SQL/v2"/>
- <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/esql.xsl"/>
- </builtin-logicsheet>
+<builtin-logicsheet>
+ <parameter name="prefix" value="esql"/>
+ <parameter name="uri" value="http://apache.org/cocoon/SQL/v2"/>
+ <parameter name="href"
+ value="resource://org/apache/cocoon/components/language/markup/xsp/java/esql.xsl"/>
+</builtin-logicsheet>
]]></source>
</s1>
1.5 +18 -15 xml-cocoon2/xdocs/httprequest.xml
Index: httprequest.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/httprequest.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- httprequest.xml 2001/07/19 13:47:19 1.4
+++ httprequest.xml 2001/07/28 03:13:53 1.5
@@ -102,6 +102,7 @@
<p>It can be found in <code>${cocoon}/cocoon.xconf</code>.</p>
<source><![CDATA[
<?xml version="1.0"?>
+
<cocoon version="2.0">
<!-- ===================== General Components =========================== -->
@@ -111,57 +112,59 @@
<component role="org.apache.cocoon.components.store.Store"
class="org.apache.cocoon.components.store.MemoryStore"/>
- <component role="org.apache.cocoon.components.language.programming.ProgrammingLanguageSelector"
- class="org.apache.cocoon.CocoonComponentSelector">
+ <component
+ role="org.apache.cocoon.components.language.programming.ProgrammingLanguageSelector"
+ class="org.apache.cocoon.CocoonComponentSelector">
<component-instance name="java"
- class="org.apache.cocoon.components.language.programming.java.JavaLanguage">
+ class="org.apache.cocoon.components.language.programming.java.JavaLanguage">
<parameter name="compiler"
- value="org.apache.cocoon.components.language.programming.java.Javac"/>
+ value="org.apache.cocoon.components.language.programming.java.Javac"/>
<parameter name="code-formatter"
- value="org.apache.cocoon.components.language.programming.java.JstyleFormatter"/>
+ value="org.apache.cocoon.components.language.programming.java.JstyleFormatter"/>
<parameter name="class-loader"
- value="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>
+ value="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>
</component-instance>
</component>
<component role="org.apache.cocoon.components.classloader.ClassLoaderManager"
- class="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>
+ class="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>
- <component role="org.apache.cocoon.components.language.markup.MarkupLanguageSelector"
- class="org.apache.cocoon.CocoonComponentSelector">
+ <component
+ role="org.apache.cocoon.components.language.markup.MarkupLanguageSelector"
+ class="org.apache.cocoon.CocoonComponentSelector">
<component-instance name="xsp"
- class="org.apache.cocoon.components.language.markup.xsp.XSPMarkupLanguage">
+ class="org.apache.cocoon.components.language.markup.xsp.XSPMarkupLanguage">
<parameter name="prefix" value="xsp"/>
<parameter name="uri" value="http://apache.org/xsp"/>
<target-language name="java">
<parameter name="core-logicsheet"
- value="resource://org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl"/>
+value="resource://org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl"/>
<builtin-logicsheet>
<parameter name="prefix" value="xsp-request"/>
<parameter name="uri" value="http://apache.org/xsp/request/2.0"/>
<parameter name="href"
- value="resource://org/apache/cocoon/components/language/markup/xsp/java/request.xsl"/>
+value="resource://org/apache/cocoon/components/language/markup/xsp/java/request.xsl"/>
</builtin-logicsheet>
<builtin-logicsheet>
<parameter name="prefix" value="xsp-response"/>
<parameter name="uri" value="http://apache.org/xsp/response/2.0"/>
<parameter name="href"
- value="resource://org/apache/cocoon/components/language/markup/xsp/java/response.xsl"/>
+value="resource://org/apache/cocoon/components/language/markup/xsp/java/response.xsl"/>
</builtin-logicsheet>
</target-language>
</component-instance>
<component-instance name="sitemap"
- class="org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage">
+ class="org.apache.cocoon.components.language.markup.sitemap.SitemapMarkupLanguage">
<parameter name="prefix" value="map"/>
<parameter name="uri" value="http://apache.org/cocoon/sitemap/1.0"/>
<target-language name="java">
<parameter name="core-logicsheet"
- value="resource://org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl"/>
+value="resource://org/apache/cocoon/components/language/markup/sitemap/java/sitemap.xsl"/>
</target-language>
</component-instance>
</component>
1.5 +36 -26 xml-cocoon2/xdocs/i18n-transformer.xml
Index: i18n-transformer.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/i18n-transformer.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- i18n-transformer.xml 2001/07/19 13:47:19 1.4
+++ i18n-transformer.xml 2001/07/28 03:13:53 1.5
@@ -184,11 +184,14 @@
</p>
<source><![CDATA[
<i18n:translate>
- <i18n:text>You have to pay {0} for {1} pounds or {2} of your profit. Valid from {3}</i18n:text>
- <i18n:param type="number" sub-type="currency" pattern="$#,##0.00">102.5</i18n:param>
- <i18n:param type="number" value="2.5">
- <i18n:param type="number" sub-type="percent" value="0.10" />
- <i18n:param type="date" pattern="dd-MMM-yy" />
+ <i18n:text>
+ You have to pay {0} for {1} pounds or {2} of your profit. Valid from {3}
+ </i18n:text>
+ <i18n:param type="number" sub-type="currency"
+ pattern="$#,##0.00">102.5</i18n:param>
+ <i18n:param type="number" value="2.5">
+ <i18n:param type="number" sub-type="percent" value="0.10" />
+ <i18n:param type="date" pattern="dd-MMM-yy" />
</i18n:translate>]]></source>
<p>
Result will be like this: <code>You have to pay $102.5 for 2.5 pounds or 10% of your profit. Valid from 13-Jun-01</code>
@@ -203,11 +206,11 @@
</p>
<source><![CDATA[
<translations>
- <entry>
- <key>Some {0} was inserted {1}.</key>
- <translation lang="en">Some {0} was {1} inserted.</translation>
- <translation lang="de">Etwas {0} wurde {1} eingesetzt.</translation>
- </entry>
+ <entry>
+ <key>Some {0} was inserted {1}.</key>
+ <translation lang="en">Some {0} was {1} inserted.</translation>
+ <translation lang="de">Etwas {0} wurde {1} eingesetzt.</translation>
+ </entry>
</translations>]]></source>
<p>
For each text, we want to translate, we must provide a key, where
@@ -257,21 +260,22 @@
</p>
<source><![CDATA[
<map:transformers default="xslt">
- <map:transformer name="i18n" src="org.apache.cocoon.transformation.I18nTransformer"/>
+ <map:transformer name="i18n"
+ src="org.apache.cocoon.transformation.I18nTransformer"/>
</map:transformers>]]></source>
<p>
Then, a <code>match</code> must be declared, something like this:
</p>
<source><![CDATA[
<map:match pattern="file">
- <map:generate src="{1}"/>
- <map:transform type="i18n">
- <parameter name="available_lang_1" value="en"/>
- <parameter name="available_lang_2" value="ru"/>
- <parameter name="src" value="translations/dictionary.xml"/>
- </map:transform>
- <map:transform src="stylesheet.xsl"/>
- <map:serialize />
+ <map:generate src="{1}"/>
+ <map:transform type="i18n">
+ <parameter name="available_lang_1" value="en"/>
+ <parameter name="available_lang_2" value="ru"/>
+ <parameter name="src" value="translations/dictionary.xml"/>
+ </map:transform>
+ <map:transform src="stylesheet.xsl"/>
+ <map:serialize />
</map:match>]]></source>
</s2>
<s2 title="Simple i18n file">
@@ -284,10 +288,11 @@
<source><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:i18n="http://apache.org/cocoon/i18n/2.0">
- <elem title="main_title" i18n:attr="title">
- <i18n:text>Text to be translated</i18n:text>
- </elem>
-</root>]]></source>
+ <elem title="main_title" i18n:attr="title">
+ <i18n:text>Text to be translated</i18n:text>
+ </elem>
+</root>]]>
+ </source>
<p>
A more interesting example of usage you can find in the samples/i18n directory.
</p>
@@ -313,9 +318,11 @@
Command line for Xalan (Of course, Xerces and Xalan must be in your classpath):
</p>
- <source><![CDATA[
-java org.apache.xalan.xslt.Process -IN simple_dict.xml -XSL merge.xsl -OUT simple_dict_es.xml -PARAM mode keys -PARAM new-lang es -PARAM keep-lang en
+ <source><![CDATA[
+java org.apache.xalan.xslt.Process -IN simple_dict.xml -XSL merge.xsl \
+-OUT simple_dict_es.xml -PARAM mode keys -PARAM new-lang es -PARAM keep-lang en
]]></source>
+ <font size="-1">(Windows users: Do not enter '\' symbol, continue typing on the same line.)</font>
<p>
This will create a file simple_dict_es.xml with entries, keys and placeholders.
</p>
@@ -343,8 +350,11 @@
Command line for Xalan:
</p>
<source><![CDATA[
-java org.apache.xalan.xslt.Process -IN simple_dict.xml -XSL merge.xsl -OUT simple_dict_new.xml -PARAM mode merge -PARAM new-lang es -PARAM new-dict simple_dict_es.xml
+java org.apache.xalan.xslt.Process -IN simple_dict.xml -XSL merge.xsl \
+-OUT simple_dict_new.xml -PARAM mode merge -PARAM new-lang es \
+-PARAM new-dict simple_dict_es.xml
]]></source>
+ <font size="-1">(Windows users: Do not enter '\' symbol, continue typing on the same line.)</font>
</s2>
</s1>
<s1 title="Finally">
1.8 +5 -4 xml-cocoon2/xdocs/index.xml
Index: index.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/index.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- index.xml 2001/07/19 13:47:19 1.7
+++ index.xml 2001/07/28 03:13:53 1.8
@@ -323,12 +323,13 @@
typing:</p>
<source>
- cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login
- Password: anoncvs
+cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login
+Password: anoncvs
- cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic checkout -r cocoon_20_branch xml-cocoon2
+cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic \
+checkout -r cocoon_20_branch xml-cocoon2
</source>
-
+ <font size="-1">(Windows users: Do not enter '\' symbol, continue typing on the same line.)</font>
<p>For more information on CVS access, refer to the CVS docs on this web site.</p>
<note>To get the current version of @docname@ 2 you have to checkout the
branch called cocoon_20_branch. The HEAD of the cvs repository is used
1.17 +6 -4 xml-cocoon2/xdocs/installing.xml
Index: installing.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/installing.xml,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- installing.xml 2001/07/22 21:49:02 1.16
+++ installing.xml 2001/07/28 03:13:53 1.17
@@ -139,8 +139,10 @@
directory.
</p>
<source>
-[unix] ./build.sh -Dinclude.webapp.libs=yes -Dinstall.war={path-to-webapps-dir} install
-[win32] .\build.bat -Dinclude.webapp.libs=yes -Dinstall.war={path-to-webapps-dir} install
+[unix]
+./build.sh -Dinclude.webapp.libs=yes -Dinstall.war={path-to-webapps-dir} install
+[win32]
+.\build.bat -Dinclude.webapp.libs=yes -Dinstall.war={path-to-webapps-dir} install
</source>
<p>
Please note that this might not work with all servlet engines
@@ -432,8 +434,8 @@
<strong># Change it to Xerces for C2</strong>
JBOSS_CLASSPATH=$JBOSS_CLASSPATH:<strong>../lib/xerces-XXX.jar</strong>
<strong># Remove the following two lines</strong>
-<em>JAXP=-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.crimson.jaxp.DocumentBuilderFactoryImpl
-JAXP="$JAXP -Djavax.xml.parsers.SAXParserFactory=org.apache.crimson.jaxp.SAXParserFactoryImpl"</em>
+<font size="-1">JAXP=-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.crimson.jaxp.DocumentBuilderFactoryImpl
+JAXP="$JAXP -Djavax.xml.parsers.SAXParserFactory=org.apache.crimson.jaxp.SAXParserFactoryImpl"</font>
[...]
</source>
<note>Windows users have to change <code>run.bat</code> accordingly.
1.7 +32 -26 xml-cocoon2/xdocs/logicsheet-forms.xml
Index: logicsheet-forms.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/logicsheet-forms.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- logicsheet-forms.xml 2001/07/20 15:22:58 1.6
+++ logicsheet-forms.xml 2001/07/28 03:13:53 1.7
@@ -41,15 +41,16 @@
<?xml version="1.0"?>
<root>
- <parameter name="persons" type="long" min="1" default="4" nullable="no"/>
- <parameter name="deposit" type="double" min="10.0" max="999.99"/>
- <parameter name="email" type="string" max-len="50" matches-regex="^[\d\w][\d\w\-_\.]*@([\d\w\-_]+\.)\w\w\w?$">
+ <parameter name="persons" type="long" min="1" default="4" nullable="no"/>
+ <parameter name="deposit" type="double" min="10.0" max="999.99"/>
+ <parameter name="email" type="string" max-len="50"
+ matches-regex="^[\d\w][\d\w\-_\.]*@([\d\w\-_]+\.)\w\w\w?$">
- <constraint-set name="car-reservation">
- <validate name="persons"/>
- <validate name="deposit" min="50.0"/>
- <validate name="email"/>
- </constraint-set>
+ <constraint-set name="car-reservation">
+ <validate name="persons"/>
+ <validate name="deposit" min="50.0"/>
+ <validate name="email"/>
+ </constraint-set>
</root>
]]>
@@ -185,9 +186,10 @@
</p>
<source>
<![CDATA[
- <xsp-formval:descriptor name="descriptor.xml" constraint-set="reservation">
- deposit must be at least EUR <xsp-formval:get-attribute parameter="deposit" name="min"/>
- </xsp-formval:descriptor>
+<xsp-formval:descriptor name="descriptor.xml" constraint-set="reservation">
+ deposit must be at least EUR
+ <xsp-formval:get-attribute parameter="deposit" name="min"/>
+</xsp-formval:descriptor>
]]>
</source>
<p>
@@ -205,21 +207,25 @@
</p>
<source>
<![CDATA[
- <xsp-formval:descriptor name="descriptor.xml" constraint-set="car-reservation">
- <xsp-formval:validate name="deposit">
- <xsp:logic>
- if (<xsp-formval:is-null/>) {
- <myapp:error> (you must specify a deposit)) </myapp:error>
- } else if ( <xsp-formval:is-toosmall/> ) {
- <myapp:error> (deposit is too small (< <xsp-formval:get-attribute name="min"/>))</myapp:error>
- } else if ( <xsp-formval:is-toolarge/> ) {
- <myapp:error> (deposit is too large (> <xsp-formval:get-attribute name="max"/>))</myapp:error>
- } else {
- <myapp:error> (ERROR) </myapp:error>
- };
- </xsp:logic>
- </xsp-formval:validate>
- </xsp-formval:descriptor>
+<xsp-formval:descriptor name="descriptor.xml" constraint-set="car-reservation">
+ <xsp-formval:validate name="deposit">
+ <xsp:logic>
+ if (<xsp-formval:is-null/>) {
+ <myapp:error> (you must specify a deposit)) </myapp:error>
+ } else if ( <xsp-formval:is-toosmall/> ) {
+ <myapp:error>
+ (deposit is too small (< <xsp-formval:get-attribute name="min"/>))
+ </myapp:error>
+ } else if ( <xsp-formval:is-toolarge/> ) {
+ <myapp:error>
+ (deposit is too large (> <xsp-formval:get-attribute name="max"/>))
+ </myapp:error>
+ } else {
+ <myapp:error> (ERROR) </myapp:error>
+ };
+ </xsp:logic>
+ </xsp-formval:validate>
+</xsp-formval:descriptor>
]]>
</source>
</s2>
1.4 +10 -5 xml-cocoon2/xdocs/matchers_selectors.xml
Index: matchers_selectors.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/matchers_selectors.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- matchers_selectors.xml 2001/07/19 14:20:23 1.3
+++ matchers_selectors.xml 2001/07/28 03:13:53 1.4
@@ -114,9 +114,11 @@
...
<map:matchers default="wildcard">
- <map:matcher name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
+ <map:matcher name="wildcard"
+ src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
...
- <map:matcher name="next-page" src="org.apache.cocoon.matching.WildcardParameterValueMatcherFactory">
+ <map:matcher name="next-page"
+ src="org.apache.cocoon.matching.WildcardParameterValueMatcherFactory">
<map:parameter name="parameter-name" value="next-state"/>
</map:matcher>
</map:matchers>
@@ -191,13 +193,16 @@
<map:components>
...
<map:selectors default="browser">
- <map:selector name="browser" src="org.apache.cocoon.selection.BrowserSelectorFactory">
+ <map:selector name="browser"
+ src="org.apache.cocoon.selection.BrowserSelectorFactory">
<browser name="explorer" useragent="MSIE"/>
<browser name="lynx" useragent="Lynx"/>
<browser name="netscape" useragent="Mozilla"/>
</map:selector>
- <map:selector name="coded" src="org.apache.cocoon.selection.CodedSelectorFactory"/>
- <map:selector name="parameter" src="org.apache.cocoon.selection.ParameterSelectorFactory"/>
+ <map:selector name="coded"
+ src="org.apache.cocoon.selection.CodedSelectorFactory"/>
+ <map:selector name="parameter"
+ src="org.apache.cocoon.selection.ParameterSelectorFactory"/>
</map:selectors>
...
1.5 +47 -42 xml-cocoon2/xdocs/sessions.xml
Index: sessions.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/sessions.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- sessions.xml 2001/07/19 14:20:23 1.4
+++ sessions.xml 2001/07/28 03:13:53 1.5
@@ -72,20 +72,22 @@
<p>Here is the fragment for the <code>session:encode-url</code> from session.xsl:</p>
<source><![CDATA[
- <!-- encode an URL with the session ID -->
- <xsl:template match="session:encode-url">
- <xsl:variable name="href">
- "<xsl:value-of select="@href"/>"
- </xsl:variable>
-
- <xsp:element name="a">
- <xsp:attribute name="href">
- <xsp:expr>response.encodeURL(String.valueOf(<xsl:copy-of select="$href"/>))</xsp:expr>
- </xsp:attribute>
- <xsl:value-of select="."/>
- </xsp:element>
+<!-- encode an URL with the session ID -->
+<xsl:template match="session:encode-url">
+ <xsl:variable name="href">
+ "<xsl:value-of select="@href"/>"
+ </xsl:variable>
+
+ <xsp:element name="a">
+ <xsp:attribute name="href">
+ <xsp:expr>
+ response.encodeURL(String.valueOf(<xsl:copy-of select="$href"/>))
+ </xsp:expr>
+ </xsp:attribute>
+ <xsl:value-of select="."/>
+ </xsp:element>
- </xsl:template>
+</xsl:template>
]]></source>
<p>
@@ -178,12 +180,12 @@
<page>
<title>A Simple URI-based Session Example</title>
<content>
- <para> <xsp-request:get-uri as="xml"/> </para>
- <para> Session ID = <session:get-id as="xml"/> </para>
- <para>
- Encode URL Test =
- <session:encode-url href="sessionpage.xsp">Follow me!</session:encode-url>
- </para>
+ <para> <xsp-request:get-uri as="xml"/> </para>
+ <para> Session ID = <session:get-id as="xml"/> </para>
+ <para>
+ Encode URL Test =
+ <session:encode-url href="sessionpage.xsp">Follow me!</session:encode-url>
+ </para>
</content>
</page>
@@ -199,31 +201,34 @@
</p>
<source><![CDATA[
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/WD-html-in-xml/DTD/xhtml1-strict.dtd">
+<!DOCTYPE HTML PUBLIC
+ "-//W3C//DTD HTML 4.0//EN"
+ "http://www.w3.org/TR/WD-html-in-xml/DTD/xhtml1-strict.dtd">
<html><head><title>
- A Simple URI Session Example
- </title></head><body vlink="blue" link="blue" alink="red" bgcolor="white">
+ A Simple URI Session Example
+ </title></head><body vlink="blue" link="blue" alink="red" bgcolor="white">
- <h2 style="color: navy; text-align: center">
- A Simple URI Session Example
- </h2>
-
- <content>
-
- <p align="left"><i>
- <b xmlns:xsp-response="http://apache.org/xsp/response/2.0" xmlns:xsp-request="http://apache.org/xsp/request/2.0">sessionpage.xsp</b>
- </i></p>
-
- <p align="left"><i>
- Session ID =
- <session:id>F3E9575442D1899760A0B231D0042281</session:id>
- </i></p>
-
- <p align="left"><i>
- Encode URL Test =
- <a href="sessionpage.xsp;jsessionid=F3E9575442D1899760A0B231D0042281">Follow me!</a>
- </i></p>
- </content>
+ <h2 style="color: navy; text-align: center">
+ A Simple URI Session Example
+ </h2>
+
+ <content>
+
+ <p align="left"><i>
+ <b xmlns:xsp-response="http://apache.org/xsp/response/2.0"
+ xmlns:xsp-request="http://apache.org/xsp/request/2.0">sessionpage.xsp</b>
+ </i></p>
+
+ <p align="left"><i>
+ Session ID =
+ <session:id>F3E9575442D1899760A0B231D0042281</session:id>
+ </i></p>
+
+ <p align="left"><i>
+ Encode URL Test =
+ <a href="sessionpage.xsp;jsessionid=F3E9575442D1899760A0B231D0042281">Follow me!</a>
+ </i></p>
+ </content>
</body></html>
]]></source>
1.2 +78 -70 xml-cocoon2/xdocs/views.xml
Index: views.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/views.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- views.xml 2001/07/18 15:06:01 1.1
+++ views.xml 2001/07/28 03:13:53 1.2
@@ -10,97 +10,105 @@
</authors>
</header>
<body>
- <s1 title="Itroduction">
- <p> Views are yet another sitemap component. Unlike the rest, they
- are othogonal to the resource and pipeline definitions. In the
- following I will not distinguish between resources and pipelines
- because their differences are not relevant here. So, when I talk
- about pipelines the said is valid for resources as well.
- </p>
-
- <p>Basically, views let you specify exit points of your pipelines
- that are taken whenever a particular view is requested. The
- processing continues with the definitions in the requested view. The
- advantage over selectors that could achieve the same is, that these
- exit points are not necessarily declared for each pipeline
- individually, but once per sitemap.</p>
-
- <p>Views are very useful while debugging your web application but
- they can as well be used to render different views to the same
- document.</p>
-
- <p><em>Since views are orthogonal to pipelines, keep in mind to
- remove any unwanted view from a deployed application.</em></p>
-
- <s2 title="Define a view">
- <s3 title="View Processing">
- <p>The samples sitemap contains two view definitions. One of them
- looks like the excerpt below.</p>
+ <s1 title="The Views">
+ <s2 title="Itroduction">
+ <p> Views are yet another sitemap component. Unlike the rest, they
+ are othogonal to the resource and pipeline definitions. In the
+ following I will not distinguish between resources and pipelines
+ because their differences are not relevant here. So, when I talk
+ about pipelines the said is valid for resources as well.
+ </p>
+
+ <p>Basically, views let you specify exit points of your pipelines
+ that are taken whenever a particular view is requested. The
+ processing continues with the definitions in the requested view. The
+ advantage over selectors that could achieve the same is, that these
+ exit points are not necessarily declared for each pipeline
+ individually, but once per sitemap.</p>
+
+ <p>Views are very useful while debugging your web application but
+ they can as well be used to render different views to the same
+ document.</p>
+
+ <p><em>Since views are orthogonal to pipelines, keep in mind to
+ remove any unwanted view from a deployed application.</em></p>
+ </s2>
+
+ <s2 title="Define a view">
+ <s3 title="View Processing">
+ <p>The samples sitemap contains two view definitions. One of them
+ looks like the excerpt below.</p>
-<source>
+ <source>
<![CDATA[
<map:views>
<map:view name="content" from-label="content">
<map:serialize type="xml"/>
</map:view>
]]>
-</source>
+ </source>
+
+ <p>It only defines what processing steps should be taken, after some
+ exit point labelled "content" is reached. In all this case just a
+ serializer is used to further process the document.</p>
+ </s3>
+
+ <s3 title="Exit Points">
+ <p>A look at the pipelines reveals no label "content". But a closer
+ look at the defined components show this:</p>
- <p>It only defines what processing steps should be taken, after some
- exit point labelled "content" is reached. In all this case just a
- serializer is used to further process the document.</p>
- </s3>
-
- <s3 title="Exit Points">
- <p>A look at the pipelines reveals no label "content". But a closer
- look at the defined components show this:</p>
-<source>
+ <source>
<![CDATA[
<map:components>
<map:generators default="file">
- <map:generator name="file" src="org.apache.cocoon.generation.FileGenerator" label="content"/>
- <map:generator name="directory" src="org.apache.cocoon.generation.DirectoryGenerator" label="content"/>
- <map:generator name="serverpages" src="org.apache.cocoon.generation.ServerPagesGenerator" label="content"/
- [...]
+ <map:generator name="file"
+ src="org.apache.cocoon.generation.FileGenerator"
+ label="content"/>
+ <map:generator name="directory"
+ src="org.apache.cocoon.generation.DirectoryGenerator"
+ label="content"/>
+ <map:generator name="serverpages"
+ src="org.apache.cocoon.generation.ServerPagesGenerator"
+ label="content"/>
+ ...
]]>
-</source>
- <p>Here a number of generators are declared, each one has a label
- attribute. Now, everytime one of these generators is used in a
- pipeline, an exit point "content" is generated, just after the
- generator has been executed.</p>
+ </source>
- <p>This is not limited to generators but every sitemap component can
- be augmented with a view label.</p>
-
- <p>Two special labels exist: "first" and "last". These are
- automatically declared for every pipeline, after the first component
- and after the last respectively. This is used by the second view in
- the samples sitemap.</p>
+ <p>Here a number of generators are declared, each one has a label
+ attribute. Now, everytime one of these generators is used in a
+ pipeline, an exit point "content" is generated, just after the
+ generator has been executed.</p>
+
+ <p>This is not limited to generators but every sitemap component can
+ be augmented with a view label.</p>
+
+ <p>Two special labels exist: "first" and "last". These are
+ automatically declared for every pipeline, after the first component
+ and after the last respectively. This is used by the second view in
+ the samples sitemap.</p>
-<source>
+ <source>
<![CDATA[
<map:view name="links" from-position="last">
<map:serialize type="links"/>
</map:view>
]]>
-</source>
-
- <p>There is also another way to specify these exit points:
- <code><map:label name="mylabel"></code>. Such a tag can be
- embedded in a pipeline at any place.</p>
- </s3>
-
- <s3 title="How a view is requested">
- <p>Currently, the applicable view is chosen by the engine based on
- the value of a request parameter named "cocoon-view".</p>
-
- <p><em>Since views are orthogonal to pipelines, keep in mind to
- remove any unwanted view from a deployed application.</em></p>
-
- </s3>
- </s2>
+ </source>
+ <p>There is also another way to specify these exit points:
+ <code><map:label name="mylabel"></code>. Such a tag can be
+ embedded in a pipeline at any place.</p>
+ </s3>
+
+ <s3 title="How a view is requested">
+ <p>Currently, the applicable view is chosen by the engine based on
+ the value of a request parameter named "cocoon-view".</p>
+
+ <p><em>Since views are orthogonal to pipelines, keep in mind to
+ remove any unwanted view from a deployed application.</em></p>
+ </s3>
+ </s2>
</s1>
</body>
</document>
1.5 +68 -70 xml-cocoon2/xdocs/xsp-internals.xml
Index: xsp-internals.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/xdocs/xsp-internals.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- xsp-internals.xml 2001/07/19 14:20:23 1.4
+++ xsp-internals.xml 2001/07/28 03:13:53 1.5
@@ -623,7 +623,8 @@
<source><![CDATA[
<component-instance name="java"
- class="org.apache.cocoon.components.language.programming.java.JavaLanguage"> . . .
+ class="org.apache.cocoon.components.language.programming.java.JavaLanguage">
+ . . .
<parameter name="compiler"
value="org.apache.cocoon.components.language.programming.java.Jikes"/>
. . .
@@ -1251,28 +1252,28 @@
<component-type name="markup-language">
<component-instance name="xsp"
class="org.apache.cocoon.components.language.markup.xsp.XSPMarkupLanguage">
- <parameter name="prefix" value="xsp"/>
- <parameter name="uri" value="http://xml.apache.org/xsp"/>
-
- <target-language name="java">
- <parameter name="core-logicsheet"
- value="resource://org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl"/>
+ <parameter name="prefix" value="xsp"/>
+ <parameter name="uri" value="http://xml.apache.org/xsp"/>
- <builtin-logicsheet>
- <parameter name="prefix" value="xsp-request"/>
- <parameter name="uri" value="http://xml.apache.org/xsp/request/2.0"/>
- <parameter name="href"
- value="resource://org/apache/cocoon/components/language/markup/xsp/java/request.xsl"/>
- </builtin-logicsheet>
-
- <builtin-logicsheet>
- <parameter name="prefix" value="xsp-response"/>
- <parameter name="uri"
- value="http://xml.apache.org/xsp/response/2.0"/>
- <parameter name="href"
- value="resource://org/apache/cocoon/components/language/markup/xsp/java/request.xsl"/>
- </builtin-logicsheet>
- </target-language>
+ <target-language name="java">
+ <parameter name="core-logicsheet"
+value="resource://org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl"/>
+
+ <builtin-logicsheet>
+ <parameter name="prefix" value="xsp-request"/>
+ <parameter name="uri" value="http://xml.apache.org/xsp/request/2.0"/>
+ <parameter name="href"
+value="resource://org/apache/cocoon/components/language/markup/xsp/java/request.xsl"/>
+ </builtin-logicsheet>
+
+ <builtin-logicsheet>
+ <parameter name="prefix" value="xsp-response"/>
+ <parameter name="uri"
+ value="http://xml.apache.org/xsp/response/2.0"/>
+ <parameter name="href"
+value="resource://org/apache/cocoon/components/language/markup/xsp/java/request.xsl"/>
+ </builtin-logicsheet>
+ </target-language>
</component-instance>
</component-type>
]]></source>
@@ -1678,61 +1679,58 @@
<source><![CDATA[
<component role="factory"
- class="org.apache.avalon.NamedComponentManagerImpl">
+ class="org.apache.avalon.NamedComponentManagerImpl">
- <component-type name="programming-language">
+ <component-type name="programming-language">
+ <component-instance name="java"
+ class="org.apache.cocoon.components.language.programming.java.JavaLanguage">
+ <parameter name="compiler"
+ value="org.apache.cocoon.components.language.programming.java.Javac"/>
+ <parameter name="code-formatter"
+ value="org.apache.cocoon.components.language.programming.java.JstyleFormatter"/>
+ <parameter name="class-loader"
+ value="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>
+ <parameter name="delete-sources" value="false"/>
+ </component-instance>
+ </component-type>
- <component-instance name="java"
- class="org.apache.cocoon.components.language.programming.java.JavaLanguage">
- <parameter name="compiler"
- value="org.apache.cocoon.components.language.programming.java.Javac"/>
- <parameter name="code-formatter"
- value="org.apache.cocoon.components.language.programming.java.JstyleFormatter"/>
- <parameter name="class-loader"
- value="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>
- <parameter name="delete-sources" value="false"/>
- </component-instance>
-
- </component-type>
-
- <component-type name="markup-language">
-
- <component-instance name="xsp"
- class="org.apache.cocoon.components.language.markup.xsp.XSPMarkupLanguage">
- <parameter name="prefix" value="xsp"/>
- <parameter name="uri" value="http://xml.apache.org/xsp"/>
-
- <target-language name="java">
- <parameter name="core-logicsheet"
- value="resource://org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl"/>
-
- <builtin-logicsheet>
- <parameter name="prefix" value="xsp-request"/>
- <parameter name="uri" value="http://xml.apache.org/xsp/request/2.0"/>
- <parameter name="href"
- value="resource://org/apache/cocoon/components/language/markup/xsp/java/request.xsl"/>
- </builtin-logicsheet>
-
- <builtin-logicsheet>
- <parameter name="prefix" value="xsp-response"/>
- <parameter name="uri"
- value="http://xml.apache.org/xsp/response/2.0"/>
- <parameter name="href"
- value="resource://org/apache/cocoon/components/language/markup/xsp/java/request.xsl"/>
- </builtin-logicsheet>
- </target-language>
- </component-instance>
- </component-type>
+ <component-type name="markup-language">
+ <component-instance name="xsp"
+ class="org.apache.cocoon.components.language.markup.xsp.XSPMarkupLanguage">
+ <parameter name="prefix" value="xsp"/>
+ <parameter name="uri" value="http://xml.apache.org/xsp"/>
+
+ <target-language name="java">
+ <parameter name="core-logicsheet"
+value="resource://org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl"/>
+
+ <builtin-logicsheet>
+ <parameter name="prefix" value="xsp-request"/>
+ <parameter name="uri" value="http://xml.apache.org/xsp/request/2.0"/>
+ <parameter name="href"
+value="resource://org/apache/cocoon/components/language/markup/xsp/java/request.xsl"/>
+ </builtin-logicsheet>
+
+ <builtin-logicsheet>
+ <parameter name="prefix" value="xsp-response"/>
+ <parameter name="uri"
+ value="http://xml.apache.org/xsp/response/2.0"/>
+ <parameter name="href"
+value="resource://org/apache/cocoon/components/language/markup/xsp/java/request.xsl"/>
+ </builtin-logicsheet>
+ </target-language>
+ </component-instance>
+ </component-type>
</component>
-<component
- role="program-generator"
+<component role="program-generator"
class="org.apache.cocoon.components.language.generator.ProgramGeneratorImpl">
- <parameter name="repository" value="/tmp/repository"/>
- <parameter name="auto-reload" value="true"/>
+ <parameter name="repository" value="/tmp/repository"/>
+ <parameter name="auto-reload" value="true"/>
</component>
-<generator name="serverpages" class="org.apache.cocoon.generators.ServerPagesGenerator"/>
+<generator name="serverpages"
+ class="org.apache.cocoon.generators.ServerPagesGenerator"/>
<!--
<component
----------------------------------------------------------------------
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