cziegeler 01/10/05 00:15:24
Modified: . build.xml
documentation sitemap.xmap
documentation/xdocs book.xml
documentation/xdocs/userdocs/generators book.xml
generators.xml
webapp sitemap.xmap
webapp.site sitemap.xmap
Added: documentation/images create-dept.jpg create-empl.jpg
edit-dept.jpg edit-empl.jpg results-dept.jpg
results-empl.jpg search-dept.jpg search-empl.jpg
documentation/stylesheets/printer_skin copyover.xsl
document2html.xsl simple.css site2xhtml.xsl
documentation/xdocs tutorial.xml
documentation/xdocs/userdocs/generators
profile-generator.xml xmldb-generator.xml
xmldbcollection-generator.xml
Removed: documentation/images label_background_a.gif
xdocs 3rdparty.xml IMPORTANT actions.txt actions.xml
avalon.xml caching.xml catalog.xml
cinclude-transformer.xml contrib.xml
datasources.xml dictionary.xml
directory-generator.xml docs-book.xml
emotional-landscapes.xml esql.xml extending.xml
extractor-generator.xml extractor-transformer.xml
faq.xml file-generator.xml filter-transformer.xml
generators.xml hosting.xml html-generator.xml
html-serializer.xml httprequest.xml
i18n-transformer.xml imagedirectory-generator.xml
index.xml installing.xml jars.xml jsp-generator.xml
ldap-transformer.xml license.xml
link-serializer.xml livesites.xml
log-transformer.xml logicsheet-concepts.xml
logicsheet-forms.xml logicsheet.xml
mail-archives.xml mail-lists.xml
matchers_selectors.xml mrustore.xml overview.xml
parent-component-manager.xml patches.xml
pcl-serializer.xml pdf-serializer.xml
php-generator.xml profile-generator.xml
ps-serializer.xml readdomsession-transformer.xml
request-generator.xml request.xml
script-generator.xml serializers.xml
serverpages-generator.xml session.xml sessions.xml
site-book.xml sitemap.xml sql-transformer.xml
status-generator.xml storejanitor.xml
stream-generator.xml svg-serializer.xml
svgjpeg-serializer.xml svgpng-serializer.xml
svgxml-serializer.xml telnet.txt
text-serializer.xml transformers.xml tutorial.xml
uc2.xml velocity-generator.xml views.xml
vrml-serializer.xml wap-serializer.xml who.xml
writedomsession-transformer.xml
xinclude-transformer.xml xml-serializer.xml
xmldb-generator.xml xmldbcollection-generator.xml
xslt-transformer.xml xsp-internals.xml xsp.xml
xt-transformer.xml
xdocs/drafts cocoon-working-draft.xconf cocoon2-docbook.xml
sitemap-working-draft.xmap
sitemap-working-draft.xsd
xdocs/dtd XMLSchema.dtd changes-v10.dtd characters.ent
datatypes.dtd document-v10.dtd faq-v10.dtd
javadoc-v04draft.dtd sitemap.dtd
specification-v10.dtd todo-v10.dtd
xdocs/images add.jpg architecture.gif basic-mechanism.gif
cocoon2-small.jpg cocoon2.gif create-dept.jpg
create-empl.jpg data-mapping.gif edit-dept.jpg
edit-empl.jpg fix.jpg generator.gif
get_hello_html.png initialize_Cocoon.png
interaction-sequence.gif pipeline.gif pipeline2.gif
pyramid-model.gif remove.jpg results-dept.jpg
results-empl.jpg search-dept.jpg search-empl.jpg
update.jpg xsp-way.gif xsp-way2.gif xsp-way3.gif
Log:
Installed new doc system
Revision Changes Path
1.74 +154 -319 xml-cocoon2/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/build.xml,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- build.xml 2001/10/04 07:42:01 1.73
+++ build.xml 2001/10/05 07:15:18 1.74
@@ -185,10 +185,8 @@
<property name="test.dir" value="./test"/>
<property name="lib.dir" value="./lib"/>
<property name="bin.dir" value="./bin"/>
- <property name="docs.dir" value="./xdocs"/>
- <property name="dtd.dir" value="./xdocs/dtd"/>
- <property name="skins.dir" value="./skins"/>
- <property name="images.dir" value="./xdocs/images"/>
+ <property name="docs.dir" value="./documentation/xdocs"/>
+ <property name="images.dir" value="./documentation/images"/>
<property name="webapp.dir" value="./webapp"/>
<property name="webapp.site.dir" value="./webapp.site"/>
<property name="webapp.tutorial.dir" value="./webapp.tutorial"/>
@@ -196,12 +194,6 @@
<property name="packages" value="org.apache.*"/>
<property name="context.dir" value="./documentation"/>
- <property name="browser.skin" value="${skins.dir}/xml.apache.org/"/>
- <property name="printer.skin" value="${skins.dir}/printer/"/>
- <property name="browser.projfile" value="docs-book.xml"/>
- <property name="site.projfile" value="site-book.xml"/>
- <property name="doc.generator" value="org.apache.stylebook.StyleBook"/>
-
<property name="build.root" value="./build"/>
<property name="build.dir" value="${build.root}/${name}"/>
<property name="build.src" value="${build.dir}/src"/>
@@ -211,7 +203,7 @@
<property name="build.xdocs" value="${build.dir}/xdocs"/>
<property name="build.docs.printer" value="${build.dir}/printer-docs"/>
<property name="build.war" value="${build.dir}/webapp"/>
- <property name="build.site.war" value="${build.dir}/${name}-site"/>
+ <property name="build.sitewebapp" value="${build.dir}/sitewebapp"/>
<property name="build.tutorial.war" value="${build.dir}/tutorial"/>
<property name="build.javadocs" value="${build.dir}/javadocs"/>
<property name="build.context" value="${build.dir}/documentation"/>
@@ -446,9 +438,87 @@
</target>
<!-- ===================================================================
-->
+ <!-- Prepares the docs
-->
+ <!-- ===================================================================
-->
+ <target name="prepare-docs" depends="init">
+
+ <mkdir dir="${build.context}"/>
+ <mkdir dir="${build.context}/images"/>
+ <mkdir dir="${build.docs}"/>
+ <mkdir dir="${build.dir}/work"/>
+
+ <!-- make filtered copy of XML docs -->
+ <copy todir="${build.context}" filtering="on">
+ <fileset dir="${context.dir}">
+ <exclude name="images/**"/>
+ </fileset>
+ </copy>
+
+ <!-- Add changes and todo -->
+ <copy file="changes.xml" tofile="${build.context}/xdocs/changes.xml"
filtering="on"/>
+ <copy file="todo.xml" tofile="${build.context}/xdocs/todo.xml"
filtering="on"/>
+ <replace file="${build.context}/xdocs/changes.xml" token="./xdocs/dtd/"
value="dtd/"/>
+ <replace file="${build.context}/xdocs/todo.xml" token="./xdocs/dtd/"
value="dtd/"/>
+
+ <!-- Copy images -->
+ <copy todir="${build.context}/images" filtering="off">
+ <fileset dir="${context.dir}/images"/>
+ </copy>
+
+ </target>
+
+
+ <!-- ===================================================================
-->
+ <!-- Set a variable if the generated docs are already up-to-date.
-->
+ <!-- ===================================================================
-->
+ <target name="docs_check" depends="init">
+ <uptodate property="docs.notrequired"
targetfile="${build.docs}/index.html" >
+ <srcfiles dir="." includes="changes.xml,todo.xml"/>
+ <srcfiles dir="${context.dir}/xdocs" includes="*.xml"
excludes="${site.projfile}"/>
+ </uptodate>
+ </target>
+
+ <!-- ===================================================================
-->
+ <!-- If generated docs is already up-to-date, print a message saying so.
-->
+ <!-- ===================================================================
-->
+ <target name="docs_done" if="docs.notrequired">
+ <echo
message="-------------------------------------------------------------"/>
+ <echo message="Not rebuilding docs, as they are up-to-date:"/>
+ <echo message=" ${build.docs}/index.html is more recent than"/>
+ <echo message=" todo.xml, changes.xml, ${context.dir}/xdocs/*.xml"/>
+ <echo
message="-------------------------------------------------------------"/>
+ </target>
+
+ <!-- ===================================================================
-->
+ <!-- The documentation system (nearly beta...)
-->
+ <!-- ===================================================================
-->
+ <target name="docs"
+ depends="package, prepare-docs, docs_check, docs_done"
+ unless="docs.notrequired"
+ description="Generates the documentation">
+
+ <java classname="org.apache.cocoon.Main" fork="true"
dir="${build.context}">
+ <arg value="-c."/>
+ <arg value="-d../docs"/>
+ <arg value="-w../work"/>
+ <arg value="-l../work/cocoon.log"/>
+ <arg value="-uINFO"/>
+ <arg value="index.html"/>
+ <classpath>
+ <path refid="classpath"/>
+ <fileset dir="${build.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement location="${tools.jar}"/>
+ </classpath>
+ </java>
+
+ </target>
+
+ <!-- ===================================================================
-->
<!-- Copies the webapp directories
-->
<!-- ===================================================================
-->
- <target name="copy-webapp" depends="prepare,compile">
+ <target name="copy-webapp" depends="prepare-docs, prepare, compile">
<mkdir dir="${build.war}"/>
<mkdir dir="${build.war}/WEB-INF/classes"/>
@@ -473,43 +543,22 @@
<include name="**/*.png"/>
</fileset>
</copy>
-
- <copy todir="${build.war}/docs/xdocs" filtering="on">
- <fileset dir="${docs.dir}">
- <include name="*.xml"/>
- <include name="**/*.dtd"/>
- <include name="**/*.ent"/>
- <exclude name="*-book.xml"/>
- </fileset>
- </copy>
-
- <copy file="changes.xml" tofile="${build.war}/docs/xdocs/changes.xml"
filtering="on"/>
- <copy file="todo.xml" tofile="${build.war}/docs/xdocs/todo.xml"
filtering="on"/>
-
- <replace file="${build.war}/docs/xdocs/changes.xml" token="./xdocs/dtd/"
value="dtd/"/>
- <replace file="${build.war}/docs/xdocs/todo.xml" token="./xdocs/dtd/"
value="dtd/"/>
-
- <copy todir="${build.war}/docs/xdocs/images" filtering="off">
- <fileset dir="${images.dir}">
- <include name="*.gif"/>
- <include name="*.jpg"/>
- <include name="*.png"/>
- </fileset>
- </copy>
-
- <copy todir="${build.war}/docs/xdocs/internal" filtering="on">
- <fileset dir="${docs.dir}">
- <include name="site-book.xml"/>
- </fileset>
- </copy>
- <copy todir="${build.war}/stylesheets/documents" filtering="on">
- <fileset dir="${browser.skin}/stylesheets">
- <include name="*2document.xsl"/>
- <include name="copyover.xsl"/>
+ <!-- copy the documentation, it's already prepared in the build context
dir -->
+ <mkdir dir="${build.war}/documentation"/>
+ <copy todir="${build.war}/documentation" filtering="off">
+ <fileset dir="${build.context}">
</fileset>
</copy>
+ <!-- change the image src for xvg -->
+ <replace file="${build.war}/documentation/svg/label.xml"
+ token="file:images/label-background_b.gif"
+ value="file:documentation/images/label-background_b.gif"/>
+ <replace file="${build.war}/documentation/svg/separator.xml"
+ token="file:images/separator.gif"
+ value="file:documentation/images/images/separator.gif"/>
+ <!-- copy i18n sample webapp-->
<copy todir="${build.war}/i18n" filtering="off">
<fileset dir="${webapp.dir}/i18n">
</fileset>
@@ -543,64 +592,6 @@
</target>
<!-- ===================================================================
-->
- <!-- Copies the site webapp directories
-->
- <!-- ===================================================================
-->
- <target name="copy-sitewebapp" depends="javadocs, prepare">
- <mkdir dir="${build.site.war}"/>
-
- <copy todir="${build.site.war}" filtering="on">
- <fileset dir="${webapp.site.dir}">
- <include name="sitemap.xmap"/>
- <include name="cocoon.xconf"/>
- <include name="WEB-INF/web.xml"/>
- </fileset>
- </copy>
-
- <copy todir="${build.site.war}/style" filtering="on">
- <fileset dir="${webapp.dir}/stylesheets/documents"/>
- <fileset dir="${browser.skin}/stylesheets">
- <include name="*2document.xsl"/>
- <include name="copyover.xsl"/>
- </fileset>
- </copy>
-
- <copy todir="${build.site.war}/content/xdocs" filtering="on">
- <fileset dir="${docs.dir}">
- <include name="*.xml"/>
- <include name="**/*.dtd"/>
- <include name="**/*.ent"/>
- <exclude name="*-book.xml"/>
- </fileset>
- </copy>
-
- <copy file="changes.xml"
tofile="${build.site.war}/content/xdocs/changes.xml" filtering="on"/>
- <copy file="todo.xml"
tofile="${build.site.war}/content/xdocs/todo.xml" filtering="on"/>
-
- <replace file="${build.site.war}/content/xdocs/changes.xml"
token="./xdocs/dtd/" value="dtd/"/>
- <replace file="${build.site.war}/content/xdocs/todo.xml"
token="./xdocs/dtd/" value="dtd/"/>
-
- <copy todir="${build.site.war}/resources/images" filtering="off">
- <fileset dir="${images.dir}">
- <include name="*.gif"/>
- <include name="*.jpg"/>
- <include name="*.png"/>
- </fileset>
- </copy>
-
- <copy todir="${build.site.war}/content" filtering="on">
- <fileset dir="${docs.dir}">
- <include name="site-book.xml"/>
- </fileset>
- </copy>
-
- <mkdir dir="${build.site.war}/content/javadocs"/>
- <copy todir="${build.site.war}/content/javadocs" filtering="off">
- <fileset dir="${build.javadocs}">
- </fileset>
- </copy>
- </target>
-
- <!-- ===================================================================
-->
<!-- Prepares the webapp sitemap if php is available
-->
<!-- ===================================================================
-->
<target name="prepare-webapp-php" depends="copy-webapp" if="php.present">
@@ -706,13 +697,6 @@
</target>
<!-- ===================================================================
-->
- <!-- Prepares the sitewebapp directories
-->
- <!-- ===================================================================
-->
- <target name="prepare-sitewebapp" depends="copy-sitewebapp">
- <!-- Simply do nothing, just invoke all dependencies -->
- </target>
-
- <!-- ===================================================================
-->
<!-- Prepares the tutorialwebapp directories
-->
<!-- ===================================================================
-->
<target name="prepare-tutorialwebapp" depends="copy-tutorialwebapp">
@@ -768,20 +752,21 @@
</target>
<!-- ===================================================================
-->
- <!-- Prepares the libraries for the sitemap war package
-->
+ <!-- Prepares the libraries for the tutorial war package
-->
<!-- ===================================================================
-->
- <target name="prepare-sitewebapp-libs" depends="package">
- <copy todir="${build.site.war}/WEB-INF/lib">
- <fileset dir="${lib.dir}">
- <include name="avalon*.jar"/>
- <include name="logkit*.jar"/>
- <include name="maybeupload*.jar"/>
- <include name="velocity*.jar"/>
- <include name="xalan*.jar"/>
- <include name="xerces*.jar"/>
- </fileset>
+ <target name="prepare-sitewebapp" depends="prepare-docs, package">
+ <mkdir dir="${build.sitewebapp}"/>
+ <copy todir="${build.sitewebapp}" filtering="off">
+ <fileset dir="${build.context}"/>
</copy>
- <copy file="${build.dir}/${name}.jar"
tofile="${build.site.war}/WEB-INF/lib/${name}-${version}.jar"/>
+ <copy todir="${build.sitewebapp}" filtering="off" overwrite="yes">
+ <fileset dir="${webapp.site.dir}"/>
+ </copy>
+ <copy todir="${build.sitewebapp}/WEB-INF/lib">
+ <fileset dir="${lib.dir}"/>
+ </copy>
+ <copy file="${build.dir}/${name}.jar"
tofile="${build.sitewebapp}/WEB-INF/lib/${name}-${version}.jar"/>
+ <copy file="${tools.jar}"
tofile="${build.sitewebapp}/WEB-INF/lib/javac.jar"/>
</target>
<!-- ===================================================================
-->
@@ -817,8 +802,8 @@
<!-- ===================================================================
-->
<!-- Creates the war file
-->
<!-- ===================================================================
-->
- <target name="sitewebapp" depends="prepare-sitewebapp,
prepare-sitewebapp-libs" description="Generates the site war package">
- <jar jarfile="${build.dir}/${name}-site.war" basedir="${build.site.war}"
includes="**"/>
+ <target name="sitewebapp" depends="prepare-sitewebapp"
description="Generates the site war package">
+ <jar jarfile="${build.dir}/${name}-site.war"
basedir="${build.sitewebapp}" includes="**"/>
</target>
<!-- ===================================================================
-->
@@ -854,87 +839,12 @@
</target>
<!-- ===================================================================
-->
- <!-- Prepares the docs
-->
- <!-- ===================================================================
-->
- <target name="prepare-docs" depends="init">
- <mkdir dir="${build.xdocs}"/>
-
- <!-- make filtered copy of XML docs -->
- <copy todir="${build.xdocs}" filtering="on">
- <fileset dir="${docs.dir}">
- <exclude name="**/*.gif"/>
- <exclude name="**/*.png"/>
- <exclude name="**/*.jpg"/>
- </fileset>
- </copy>
-
- <copy todir="${build.xdocs}" filtering="off">
- <fileset dir="${docs.dir}">
- <include name="**/*.gif"/>
- <include name="**/*.png"/>
- <include name="**/*.jpg"/>
- </fileset>
- </copy>
-
- <copy todir="${build.docs}" filtering="off">
- <fileset dir="${docs.dir}">
- <include name="**/*.gif"/>
- <include name="**/*.png"/>
- <include name="**/*.jpg"/>
- <include name="**/*.txt"/>
- </fileset>
- </copy>
-
- <copy file="changes.xml" tofile="${build.xdocs}/changes.xml"
filtering="on"/>
- <copy file="todo.xml" tofile="${build.xdocs}/todo.xml"/>
-
- <replace file="${build.xdocs}/changes.xml" token="./xdocs/dtd/"
value="dtd/"/>
- <replace file="${build.xdocs}/todo.xml" token="./xdocs/dtd/"
value="dtd/"/>
- </target>
-
-
- <!-- ===================================================================
-->
- <!-- Set a variable if the generated docs are already up-to-date.
-->
- <!-- ===================================================================
-->
- <target name="docs_check" depends="init">
- <uptodate property="docs.notrequired"
targetfile="${build.docs}/index.html" >
- <srcfiles dir="." includes="changes.xml,todo.xml"/>
- <srcfiles dir="${docs.dir}" includes="*.xml"
excludes="${site.projfile}"/>
- </uptodate>
- </target>
-
- <!-- ===================================================================
-->
- <!-- If generated docs is already up-to-date, print a message saying so.
-->
- <!-- ===================================================================
-->
- <target name="docs_done" if="docs.notrequired">
- <echo
message="-------------------------------------------------------------"/>
- <echo message="Not rebuilding docs, as they are up-to-date:"/>
- <echo message=" ${build.docs}/index.html is more recent than"/>
- <echo message=" todo.xml, changes.xml, ${docs.dir}/*.xml"/>
- <echo
message="-------------------------------------------------------------"/>
- </target>
-
- <!-- ===================================================================
-->
- <!-- Generate HTML docs
-->
- <!-- ===================================================================
-->
- <target name="docs" depends="prepare-docs, docs_check, docs_done"
- unless="docs.notrequired"
- description="Generates the documentation">
- <mkdir dir="${build.docs}"/>
- <copy file="${build.xdocs}/docs-book.xml"
tofile="${build.xdocs}/book.xml"/>
- <java classname="${doc.generator}" fork="yes">
- <classpath refid="classpath"/>
- <arg line="targetDirectory=${build.docs} ${build.xdocs}/book.xml
${browser.skin}"/>
- </java>
- </target>
-
- <!-- ===================================================================
-->
<!-- Set a variable if the generated printer docs are already up-to-date.
-->
<!-- ===================================================================
-->
<target name="printer-docs_check" depends="init">
<uptodate property="printer-docs.notrequired"
targetfile="${build.docs.printer}/index.html" >
<srcfiles dir="." includes="changes.xml,todo.xml"/>
- <srcfiles dir="${docs.dir}" includes="*.xml"
excludes="${site.projfile}"/>
+ <srcfiles dir="${docs.dir}" includes="*.xml"/>
</uptodate>
</target>
@@ -962,58 +872,60 @@
</target>
<!-- ===================================================================
-->
- <!-- Generate printer-friendly HTML docs
-->
+ <!-- Prepares the printer-docs
-->
<!-- ===================================================================
-->
- <target name="printer-docs" depends="prepare-docs, printer-docs_check,
printer-docs_done"
- unless="printer-docs.notrequired"
- description="Generates printer-friendly documentation">
- <mkdir dir="${build.docs.printer}"/>
- <copy file="${build.xdocs}/${browser.projfile}"
tofile="${build.xdocs}/book.xml"/>
- <java classname="${doc.generator}" fork="yes">
- <classpath refid="classpath"/>
- <arg line="targetDirectory=${build.docs.printer}
${build.xdocs}/book.xml ${printer.skin}"/>
- </java>
- </target>
+ <target name="prepare-printer-docs" depends="prepare-docs">
- <!-- ===================================================================
-->
- <!-- Set a variable if the generated site is already up-to-date.
-->
- <!-- ===================================================================
-->
- <target name="site_check" depends="init">
- <uptodate property="site.notrequired" targetfile="${site}/index.html" >
- <srcfiles dir="." includes="changes.xml,todo.xml"/>
- <srcfiles dir="${docs.dir}" includes="*.xml"
excludes="${browser.projfile}"/>
- </uptodate>
+ <mkdir dir="${build.dir}/printer_documentation"/>
+
+ <!-- copy prepared docs -->
+ <copy todir="${build.dir}/printer_documentation" filtering="off">
+ <fileset dir="${build.context}">
+ </fileset>
+ </copy>
+
+ <!-- copy printer skin -->
+ <copy todir="${build.dir}/printer_documentation/stylesheets"
filtering="off" overwrite="yes">
+ <fileset dir="${build.context}/stylesheets/printer_skin">
+ </fileset>
+ </copy>
+
</target>
+
<!-- ===================================================================
-->
- <!-- If generated site is already up-to-date, print a message saying so.
-->
+ <!-- Generate printer-friendly HTML docs
-->
<!-- ===================================================================
-->
- <target name="site_done" if="site.notrequired">
- <echo
message="-------------------------------------------------------------"/>
- <echo message="Not rebuilding site, as it is up-to-date:"/>
- <echo message=" ${site}/index.html is more recent than"/>
- <echo message=" todo.xml, changes.xml, ${docs.dir}/*.xml"/>
- <echo
message="-------------------------------------------------------------"/>
+ <target name="printer-docs" depends="package, prepare-printer-docs,
printer-docs_check, printer-docs_done"
+ unless="printer-docs.notrequired"
+ description="Generates printer-friendly documentation">
+ <mkdir dir="${build.docs.printer}"/>
+
+ <java classname="org.apache.cocoon.Main" fork="true"
dir="${build.dir}/printer_documentation">
+ <arg value="-c."/>
+ <arg value="-d../printer-docs"/>
+ <arg value="-w../work-printer"/>
+ <arg value="-l../work-printer/cocoon.log"/>
+ <arg value="-uINFO"/>
+ <arg value="index.html"/>
+ <classpath>
+ <path refid="classpath"/>
+ <fileset dir="${build.dir}">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement location="${tools.jar}"/>
+ </classpath>
+ </java>
</target>
<!-- ===================================================================
-->
<!-- Creates the web site
-->
<!-- ===================================================================
-->
- <target name="site" depends="prepare-docs, site_check, site_done"
- unless="site.notrequired"
+ <target name="site" depends="docs"
description="Generates the web site (for site maintainers only)">
<mkdir dir="${site}"/>
- <copy file="${build.xdocs}/${site.projfile}"
tofile="${build.xdocs}/book.xml"/>
- <java classname="${doc.generator}" fork="yes">
- <classpath refid="classpath"/>
- <arg line="targetDirectory=${site} ${build.xdocs}/book.xml
${browser.skin}"/>
- </java>
<copy todir="${site}" filtering="off">
- <fileset dir="${build.xdocs}">
- <include name="**/*.gif"/>
- <include name="**/*.png"/>
- <include name="**/*.jpg"/>
- <include name="**/*.txt"/>
+ <fileset dir="${build.docs}">
</fileset>
</copy>
</target>
@@ -1068,6 +980,7 @@
<mkdir dir="${dist.dir}/bin"/>
<mkdir dir="${dist.dir}/lib"/>
<mkdir dir="${dist.dir}/src"/>
+ <mkdir dir="${dist.dir}/documentation"/>
<mkdir dir="${dist.dir}/docs"/>
<mkdir dir="${dist.dir}/docs/api"/>
<mkdir dir="${dist.dir}/resources"/>
@@ -1098,6 +1011,9 @@
<fileset dir="${lib.dir}"/>
</copy>
+ <copy todir="${dist.dir}/documentation">
+ <fileset dir="${build.context}"/>
+ </copy>
<copy todir="${dist.dir}/docs">
<fileset dir="${build.docs}"/>
</copy>
@@ -1114,9 +1030,6 @@
<include name="changes.xml, todo.xml"/>
</fileset>
</copy>
- <copy todir="${dist.dir}/skins">
- <fileset dir="${skins.dir}"/>
- </copy>
<copy todir="${dist.dir}/resources">
<fileset dir="${resource.dir}"/>
</copy>
@@ -1215,84 +1128,6 @@
</fileset>
</batchtest>
</junit>
- </target>
-
- <!-- ===================================================================
-->
- <!-- Prepares the docs
-->
- <!-- ===================================================================
-->
- <target name="prepare-newdocs" depends="init">
-
- <mkdir dir="${build.context}"/>
- <mkdir dir="${build.context}/images"/>
- <mkdir dir="${build.docs}"/>
- <mkdir dir="${build.dir}/work"/>
-
- <!-- make filtered copy of XML docs -->
- <copy todir="${build.context}" filtering="on">
- <fileset dir="${context.dir}">
- <exclude name="images/**"/>
- </fileset>
- </copy>
-
- <!-- Add changes and todo -->
- <copy file="changes.xml" tofile="${build.context}/xdocs/changes.xml"
filtering="on"/>
- <copy file="todo.xml" tofile="${build.context}/xdocs/todo.xml"
filtering="on"/>
- <replace file="${build.context}/xdocs/changes.xml" token="./xdocs/dtd/"
value="dtd/"/>
- <replace file="${build.context}/xdocs/todo.xml" token="./xdocs/dtd/"
value="dtd/"/>
-
- <!-- Copy images -->
- <copy todir="${build.context}/images" filtering="off">
- <fileset dir="${context.dir}/images"/>
- </copy>
-
- </target>
-
-
- <!-- ===================================================================
-->
- <!-- Set a variable if the generated docs are already up-to-date.
-->
- <!-- ===================================================================
-->
- <target name="newdocs_check" depends="init">
- <uptodate property="newdocs.notrequired"
targetfile="${build.docs}/index.html" >
- <srcfiles dir="." includes="changes.xml,todo.xml"/>
- <srcfiles dir="${context.dir}/xdocs" includes="*.xml"
excludes="${site.projfile}"/>
- </uptodate>
- </target>
-
- <!-- ===================================================================
-->
- <!-- If generated docs is already up-to-date, print a message saying so.
-->
- <!-- ===================================================================
-->
- <target name="newdocs_done" if="newdocs.notrequired">
- <echo
message="-------------------------------------------------------------"/>
- <echo message="Not rebuilding docs, as they are up-to-date:"/>
- <echo message=" ${build.docs}/index.html is more recent than"/>
- <echo message=" todo.xml, changes.xml, ${context.dir}/xdocs/*.xml"/>
- <echo
message="-------------------------------------------------------------"/>
- </target>
-
- <!-- ===================================================================
-->
- <!-- The documentation system (nearly beta...)
-->
- <!-- ===================================================================
-->
- <target name="newdocs"
- depends="package, prepare-newdocs, newdocs_check, newdocs_done"
- unless="newdocs.notrequired"
- description="Generates the documentation">
-
- <java classname="org.apache.cocoon.Main" fork="true"
dir="${build.context}">
- <arg value="-c."/>
- <arg value="-d../docs"/>
- <arg value="-w../work"/>
- <arg value="-l../work/cocoon.log"/>
- <arg value="-uINFO"/>
- <arg value="index.html"/>
- <classpath>
- <path refid="classpath"/>
- <fileset dir="${build.dir}">
- <include name="*.jar"/>
- </fileset>
- <pathelement location="${tools.jar}"/>
- </classpath>
- </java>
-
</target>
</project>
1.13 +4 -0 xml-cocoon2/documentation/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-cocoon2/documentation/sitemap.xmap,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- sitemap.xmap 2001/10/04 08:12:28 1.12
+++ sitemap.xmap 2001/10/05 07:15:19 1.13
@@ -120,6 +120,10 @@
<map:read src="xdocs/{1}.txt" mime-type="text"/>
</map:match>
+ <map:match pattern="**.css">
+ <map:read src="{1}.css" mime-type="text"/>
+ </map:match>
+
<map:match pattern="**images/*.png">
<map:read src="images/{2}.png" mime-type="image/png"/>
</map:match>
1.1 xml-cocoon2/documentation/images/create-dept.jpg
<<Binary file>>
1.1 xml-cocoon2/documentation/images/create-empl.jpg
<<Binary file>>
1.1 xml-cocoon2/documentation/images/edit-dept.jpg
<<Binary file>>
1.1 xml-cocoon2/documentation/images/edit-empl.jpg
<<Binary file>>
1.1 xml-cocoon2/documentation/images/results-dept.jpg
<<Binary file>>
1.1 xml-cocoon2/documentation/images/results-empl.jpg
<<Binary file>>
1.1 xml-cocoon2/documentation/images/search-dept.jpg
<<Binary file>>
1.1 xml-cocoon2/documentation/images/search-empl.jpg
<<Binary file>>
1.1
xml-cocoon2/documentation/stylesheets/printer_skin/copyover.xsl
Index: copyover.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="@*|*|text()|processing-instruction()">
<xsl:copy>
<xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
1.1
xml-cocoon2/documentation/stylesheets/printer_skin/document2html.xsl
Index: document2html.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- ======================================================================
-->
<!-- document section -->
<!-- ======================================================================
-->
<xsl:template match="/">
<!-- checks if this is the included document to avoid neverending loop -->
<xsl:if test="not(book)">
<document>
<xsl:choose>
<xsl:when test="document/header/title">
<title><xsl:value-of
select="document/header/title"/></title>
</xsl:when>
<xsl:otherwise>
<title>NO TITLE</title>
</xsl:otherwise>
</xsl:choose>
<body text="#000000" link="#039acc" vlink="#0086b2" alink="#cc0000"
topmargin="4" leftmargin="4" marginwidth="4" marginheight="4"
bgcolor="#ffffff">
<xsl:apply-templates/>
</body>
</document>
</xsl:if>
<xsl:if test="book">
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
<!-- ======================================================================
-->
<!-- header section -->
<!-- ======================================================================
-->
<xsl:template match="header">
<!-- ignore on general document -->
</xsl:template>
<!-- ======================================================================
-->
<!-- body section -->
<!-- ======================================================================
-->
<xsl:template match="s1">
<div align="right">
<table border="0" width="98%" cellspacing="0" cellpadding="0">
<tr>
<td width="9" height="7" valign="bottom" align="right"><img
src="images/bar-top-left.gif" width="9" height="7" vspace="0" hspace="0"
border="0"/></td>
<td background="images/bar-border-top.gif"><img src="images/void.gif"
width="1" height="5" vspace="0" hspace="0" border="0"/></td>
<td width="9" height="7" valign="bottom" align="left"><img
src="images/bar-top-right.gif" width="9" height="7" vspace="0" hspace="0"
border="0"/></td>
</tr>
<tr>
<td width="9" background="images/bar-border-left.gif"><img
src="images/void.gif" width="9" height="1" vspace="0" hspace="0"
border="0"/></td>
<td width="100%" bgcolor="#0086b2">
<font size="+1" face="arial,helvetica,sanserif" color="#ffffff">
<img src="images/void.gif" width="5" height="5" vspace="0"
hspace="0" border="0"/><b><xsl:value-of select="@title"/></b></font>
</td>
<td width="9" background="images/bar-border-right.gif"><img
src="images/void.gif" width="9" height="1" vspace="0" hspace="0"
border="0"/></td>
</tr>
<tr>
<td width="9" height="12" valign="top" align="right"><img
src="images/bar-bottom-left.gif" width="9" height="12" vspace="0" hspace="0"
border="0"/></td>
<td background="images/bar-border-bottom.gif"><img
src="images/void.gif" height="12" vspace="0" hspace="0" border="0"/></td>
<td width="9" height="12" valign="top" align="left"><img
src="images/bar-bottom-right.gif" width="9" height="12" vspace="0" hspace="0"
border="0"/></td>
</tr>
</table>
<table border="0" width="98%" cellspacing="0" cellpadding="0">
<tr>
<td>
<font face="arial,helvetica,sanserif"
color="#000000"><xsl:apply-templates/></font>
</td>
</tr>
</table>
</div>
<br/>
</xsl:template>
<xsl:template match="s2">
<div align="right">
<table border="0" width="95%" cellspacing="0" cellpadding="0">
<tr>
<td width="9" height="7" valign="bottom" align="right"><img
src="images/bar-top-left.gif" width="9" height="7" vspace="0" hspace="0"
border="0"/></td>
<td background="images/bar-border-top.gif"><img src="images/void.gif"
width="1" height="5" vspace="0" hspace="0" border="0"/></td>
<td width="9" height="7" valign="bottom" align="left"><img
src="images/bar-top-right.gif" width="9" height="7" vspace="0" hspace="0"
border="0"/></td>
</tr>
<tr>
<td width="9" background="images/bar-border-left.gif"><img
src="images/void.gif" width="9" height="1" vspace="0" hspace="0"
border="0"/></td>
<td width="100%" bgcolor="#0086b2">
<font face="arial,helvetica,sanserif" color="#ffffff">
<img src="images/void.gif" width="5" height="5" vspace="0"
hspace="0" border="0"/><b><xsl:value-of select="@title"/></b></font>
</td>
<td width="9" background="images/bar-border-right.gif"><img
src="images/void.gif" width="9" height="1" vspace="0" hspace="0"
border="0"/></td>
</tr>
<tr>
<td width="9" height="12" valign="top" align="right"><img
src="images/bar-bottom-left.gif" width="9" height="12" vspace="0" hspace="0"
border="0"/></td>
<td background="images/bar-border-bottom.gif"><img
src="images/void.gif" width="1" height="12" vspace="0" hspace="0"
border="0"/></td>
<td width="9" height="12" valign="top" align="left"><img
src="images/bar-bottom-right.gif" width="9" height="12" vspace="0" hspace="0"
border="0"/></td>
</tr>
</table>
<table border="0" width="95%" cellspacing="0" cellpadding="0">
<tr>
<td>
<font face="arial,helvetica,sanserif"
color="#000000"><xsl:apply-templates/></font>
</td>
</tr>
</table>
</div>
<br/>
</xsl:template>
<xsl:template match="s3">
<div align="right">
<table border="0" width="90%" cellspacing="0" cellpadding="0">
<tr>
<td width="9" height="7" valign="bottom" align="right"><img
src="images/bar-top-left.gif" width="9" height="7" vspace="0" hspace="0"
border="0"/></td>
<td background="images/bar-border-top.gif"><img src="images/void.gif"
width="1" height="5" vspace="0" hspace="0" border="0"/></td>
<td width="9" height="7" valign="bottom" align="left"><img
src="images/bar-top-right.gif" width="9" height="7" vspace="0" hspace="0"
border="0"/></td>
</tr>
<tr>
<td width="9" background="images/bar-border-left.gif"><img
src="images/void.gif" width="9" height="1" vspace="0" hspace="0"
border="0"/></td>
<td width="100%" bgcolor="#0086b2">
<font size="-1" face="arial,helvetica,sanserif" color="#ffffff">
<img src="images/void.gif" width="5" height="5" vspace="0"
hspace="0" border="0"/><b><xsl:value-of select="@title"/></b></font>
</td>
<td width="9" background="images/bar-border-right.gif"><img
src="images/void.gif" width="9" height="1" vspace="0" hspace="0"
border="0"/></td>
</tr>
<tr>
<td width="9" height="12" valign="top" align="right"><img
src="images/bar-bottom-left.gif" width="9" height="12" vspace="0" hspace="0"
border="0"/></td>
<td background="images/bar-border-bottom.gif"><img
src="images/void.gif" width="1" height="12" vspace="0" hspace="0"
border="0"/></td>
<td width="9" height="12" valign="top" align="left"><img
src="images/bar-bottom-right.gif" width="9" height="12" vspace="0" hspace="0"
border="0"/></td>
</tr>
</table>
<table border="0" width="90%" cellspacing="0" cellpadding="0">
<tr>
<td>
<font face="arial,helvetica,sanserif"
color="#000000"><xsl:apply-templates/></font>
</td>
</tr>
</table>
</div>
<br/>
</xsl:template>
<xsl:template match="s4">
<div align="right">
<table border="0" width="85%" cellspacing="0" cellpadding="0">
<tr>
<td width="9" height="7" valign="bottom" align="right"><img
src="images/bar-top-left.gif" width="9" height="7" vspace="0" hspace="0"
border="0"/></td>
<td background="images/bar-border-top.gif"><img src="images/void.gif"
width="1" height="5" vspace="0" hspace="0" border="0"/></td>
<td width="9" height="7" valign="bottom" align="left"><img
src="images/bar-top-right.gif" width="9" height="7" vspace="0" hspace="0"
border="0"/></td>
</tr>
<tr>
<td width="9" background="images/bar-border-left.gif"><img
src="images/void.gif" width="9" height="1" vspace="0" hspace="0"
border="0"/></td>
<td width="100%" bgcolor="#0086b2">
<font size="-2" face="arial,helvetica,sanserif" color="#ffffff">
<img src="images/void.gif" width="5" height="5" vspace="0"
hspace="0" border="0"/><b><xsl:value-of select="@title"/></b></font>
</td>
<td width="9" background="images/bar-border-right.gif"><img
src="images/void.gif" width="9" height="1" vspace="0" hspace="0"
border="0"/></td>
</tr>
<tr>
<td width="9" height="12" valign="top" align="right"><img
src="images/bar-bottom-left.gif" width="9" height="12" vspace="0" hspace="0"
border="0"/></td>
<td background="images/bar-border-bottom.gif"><img
src="images/void.gif" width="1" height="12" vspace="0" hspace="0"
border="0"/></td>
<td width="9" height="12" valign="top" align="left"><img
src="images/bar-bottom-right.gif" width="9" height="12" vspace="0" hspace="0"
border="0"/></td>
</tr>
</table>
<table border="0" width="85%" cellspacing="0" cellpadding="0">
<tr>
<td>
<font face="arial,helvetica,sanserif"
color="#000000"><xsl:apply-templates/></font>
</td>
</tr>
</table>
</div>
<br/>
</xsl:template>
<!-- ======================================================================
-->
<!-- footer section -->
<!-- ======================================================================
-->
<xsl:template match="footer">
<!-- ignore on general documents -->
</xsl:template>
<!-- ======================================================================
-->
<!-- paragraph section -->
<!-- ======================================================================
-->
<xsl:template match="p">
<p align="justify"><xsl:apply-templates/></p>
</xsl:template>
<xsl:template match="note">
<p>
<table width="100%" cellspacing="3" cellpadding="0" border="0">
<tr>
<td width="28" valign="top">
<img src="images/note.gif" width="28" height="29" vspace="0"
hspace="0" border="0" alt="Note"/>
</td>
<td valign="top">
<font size="-1" face="arial,helvetica,sanserif" color="#000000">
<i>
<xsl:apply-templates/>
</i>
</font>
</td>
</tr>
</table>
</p>
</xsl:template>
<xsl:template match="source">
<div align="center">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#0086b2" width="1" height="1"><img src="images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#0086b2" height="1"><img src="images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#0086b2" width="1" height="1"><img src="images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#0086b2" width="1"><img src="images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre><xsl:apply-templates/></pre></td>
<td bgcolor="#0086b2" width="1"><img src="images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#0086b2" width="1" height="1"><img src="images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#0086b2" height="1"><img src="images/void.gif" width="1"
height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#0086b2" width="1" height="1"><img src="images/void.gif"
width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
</xsl:template>
<xsl:template match="fixme">
<!-- ignore on documentation -->
</xsl:template>
<!-- ======================================================================
-->
<!-- list section -->
<!-- ======================================================================
-->
<xsl:template match="ul|ol|dl">
<blockquote>
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</blockquote>
</xsl:template>
<xsl:template match="li">
<xsl:copy>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="sl">
<ul>
<xsl:apply-templates/>
</ul>
</xsl:template>
<xsl:template match="dt">
<li>
<strong><xsl:value-of select="."/></strong>
<xsl:text> - </xsl:text>
<xsl:apply-templates select="dd"/>
</li>
</xsl:template>
<!-- ======================================================================
-->
<!-- table section -->
<!-- ======================================================================
-->
<xsl:template match="table">
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<caption><xsl:value-of select="caption"/></caption>
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="tr">
<tr><xsl:apply-templates/></tr>
</xsl:template>
<xsl:template match="th">
<td bgcolor="#039acc" colspan="[EMAIL PROTECTED]" rowspan="[EMAIL
PROTECTED]" valign="center" align="center">
<font color="#ffffff" size="-1" face="arial,helvetica,sanserif">
<b><xsl:apply-templates/></b> 
</font>
</td>
</xsl:template>
<xsl:template match="td">
<td bgcolor="#a0ddf0" colspan="[EMAIL PROTECTED]" rowspan="[EMAIL
PROTECTED]" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<xsl:apply-templates/> 
</font>
</td>
</xsl:template>
<xsl:template match="tn">
<td bgcolor="#ffffff" colspan="[EMAIL PROTECTED]" rowspan="[EMAIL
PROTECTED]">
 
</td>
</xsl:template>
<xsl:template match="caption">
<!-- ignore since already used -->
</xsl:template>
<!-- ======================================================================
-->
<!-- markup section -->
<!-- ======================================================================
-->
<xsl:template match="strong">
<b><xsl:apply-templates/></b>
</xsl:template>
<xsl:template match="em">
<i><xsl:apply-templates/></i>
</xsl:template>
<xsl:template match="code">
<code><font face="courier,
monospaced"><xsl:apply-templates/></font></code>
</xsl:template>
<!-- ======================================================================
-->
<!-- images section -->
<!-- ======================================================================
-->
<xsl:template match="figure">
<p align="center"><img src="[EMAIL PROTECTED]" alt="[EMAIL PROTECTED]"
border="0" vspace="4" hspace="4"/></p>
</xsl:template>
<xsl:template match="img">
<img src="[EMAIL PROTECTED]" alt="[EMAIL PROTECTED]" border="0" vspace="4"
hspace="4" align="right"/>
</xsl:template>
<xsl:template match="icon">
<img src="[EMAIL PROTECTED]" alt="[EMAIL PROTECTED]" border="0"
align="absmiddle"/>
</xsl:template>
<!-- ======================================================================
-->
<!-- links section -->
<!-- ======================================================================
-->
<xsl:template match="link">
<a href="[EMAIL PROTECTED]"><xsl:apply-templates/></a>
</xsl:template>
<xsl:template match="connect">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="jump">
<a href="[EMAIL PROTECTED]@anchor}"><xsl:apply-templates/></a>
</xsl:template>
<xsl:template match="fork">
<a href="[EMAIL PROTECTED]" target="_blank"><xsl:apply-templates/></a>
</xsl:template>
<xsl:template match="anchor">
<a name="[EMAIL PROTECTED]"><xsl:comment>anchor</xsl:comment></a>
</xsl:template>
<!-- ======================================================================
-->
<!-- specials section -->
<!-- ======================================================================
-->
<xsl:template match="br">
<br/>
</xsl:template>
</xsl:stylesheet>
1.1
xml-cocoon2/documentation/stylesheets/printer_skin/simple.css
Index: simple.css
===================================================================
body {
background: white fixed no-repeat left top;
color: black;
font-family: sans-serif;
margin: 2em 1em 2em 1em;
}
h1 {
text-align: left;
color: #005a9c;
font: 170% sans-serif;
}
h2 {
text-align: left;
color: #005a9c;
font: 140% sans-serif;
}
h3 {
text-align: left;
color: #005a9c;
font: 120% sans-serif;
}
h4 {
text-align: left;
color: #005a9c;
font: bold 100% sans-serif;
}
#main-panel {}
#side-bar {}
#content-panel {}
#s1
#s2
#s3
#s4
p {
padding: 10px 10px 10px 10px;
margin: 10px 20px 10px 20px;
text-align: justify;
}
p.note {
font-style: italic;
}
p.source {
font-family: monospace;
}
a:link { color: #005a9c }
a:visited { color: #a00000 }
a:active { color: #00a000 }
a:hover { background: #ffa }
1.1
xml-cocoon2/documentation/stylesheets/printer_skin/site2xhtml.xsl
Index: site2xhtml.xsl
===================================================================
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name="header"/>
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="/site/document/title"/></title>
</head>
<body text="#000000" link="#039acc" vlink="#0086b2" alink="#cc0000"
topmargin="4" leftmargin="4" marginwidth="4" marginheight="4"
bgcolor="#ffffff">
<!-- THE TOP BAR (HEADER) -->
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td width="135" height="60" rowspan="3" valign="top" align="left">
<img width="135" height="60" src="images/logo.gif" hspace="0"
vspace="0" border="0"/>
</td>
<td width="100%" height="5" valign="top" align="left" colspan="2"
background="images/line.gif">
<img width="1" height="5" src="images/line.gif" hspace="0"
vspace="0" border="0" align="left"/>
</td>
<td width="29" height="60" rowspan="3" valign="top" align="left">
<img width="29" height="60" src="images/right.gif" hspace="0"
vspace="0" border="0"/>
</td>
</tr>
<tr>
<td width="100%" height="35" valign="top" align="right"
colspan="2" bgcolor="#0086b2">
<img src="{$header}?label={/site/document/title}" hspace="0"
vspace="0" border="0" alt="{/site/document/title}" align="right"/>
</td>
</tr>
<tr>
<td width="100%" height="20" valign="top" align="left"
bgcolor="#0086b2" background="images/bottom.gif">
<img width="3" height="20" src="images/bottom.gif" hspace="0"
vspace="0" border="0" align="left"/>
</td>
<td align="right" bgcolor="#0086b2" height="20" valign="top"
width="288" background="images/bottom.gif">
<table border="0" cellpadding="0" cellspacing="0" width="288">
<tr>
<td width="96" height="20" valign="top" align="left">
<a href="http://xml.apache.org/" target="new">
<img alt="http://xml.apache.org/" width="96"
height="20" src="images/button-xml-lo.gif"
name="xml" hspace="0" vspace="0" border="0"/>
</a>
</td>
<td width="96" height="20" valign="top" align="left">
<a href="http://www.apache.org/" target="new">
<img alt="http://www.apache.org/" width="96"
height="20" src="images/button-asf-lo.gif"
name="asf" hspace="0" vspace="0" border="0"/>
</a>
</td>
<td width="96" height="20" valign="top" align="left">
<a href="http://www.w3.org/" target="new">
<img alt="http://www.w3.org/" width="96" height="20"
src="images/button-w3c-lo.gif"
name="w3c" hspace="0" vspace="0" border="0"/>
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr width="100%">
<td width="120" valign="top">
<table border="0" cellpadding="0" cellspacing="0"
width="120">
<tr>
<td align="left" valign="top">
<img border="0" height="14"
hspace="0" src="images/join.gif" vspace="0" width="120"/>
<br/>
</td>
</tr>
<xsl:copy-of select="/site/menu/node()|@*"/>
<tr>
<td valign="top" align="left">
<img border="0" height="14"
hspace="0" src="images/close.gif" vspace="0" width="120"/>
<br/>
</td>
</tr>
</table>
</td>
<td>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td width="100%" height="10"/></tr>
<tr><td><xsl:copy-of
select="/site/document/body/node()|@*"/></td></tr>
</table>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#0086b2">
<img height="1" src="images/dot.gif" width="1"/>
</td>
</tr>
<tr>
<td align="center">
<font color="#0086b2" face="arial,helvetica,sanserif" size="-1">
<i>Copyright © 1999-2001 The Apache Software Foundation. All
Rights Reserved.</i>
</font>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
1.5 +2 -2 xml-cocoon2/documentation/xdocs/book.xml
Index: book.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/documentation/xdocs/book.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- book.xml 2001/10/04 07:42:01 1.4
+++ book.xml 2001/10/05 07:15:19 1.5
@@ -19,12 +19,12 @@
<menu label="Cocoon">
<menu-item label="Overview" href="overview.html"/>
<menu-item label="Concepts" href="uc2.html"/>
+ <menu-item label="Tutorial" href="tutorial.html"/>
<menu-item label="Sitemap" href="sitemap.html"/>
<menu-item label="Views" href="views.html"/>
<menu-item label="Actions" href="actions.html"/>
<menu-item label="Matchers and Selectors"
href="matchers_selectors.html"/>
-
- <menu-item label="User Documentation" href="userdocs/index.html"/>
+ <menu-item label="User Documentation" href="userdocs/index.html"/>
<menu-item label="Flow" href="httprequest.html"/>
<menu-item label="Caching" href="caching.html"/>
<menu-item label="MRUMemoryStore" href="mrustore.html"/>
1.1 xml-cocoon2/documentation/xdocs/tutorial.xml
Index: tutorial.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN"
"dtd/document-v10.dtd">
<document>
<header>
<title>How to develop Web Applications</title>
<authors>
<person name="Berin Loritsch" email="[EMAIL PROTECTED]"/>
<person name="John Morrison" email="[EMAIL PROTECTED]"/>
</authors>
</header>
<body>
<s1 title="Introduction">
<p>Cocoon is an XML publishing framework. It allows you to define XML
documents and transformations to be applied on it, to eventually
generate a presentation format of your choice (HTML, PDF, SVG, etc.).
Cocoon also gives you the possibility to have logic in your XML files
(so that the XML file itself can become dynamically generated).</p>
<p>Cocoon is developed on top of the Avalon Server Framework, which is a
stable and scalable framework. You can find out more about Avalon in
this document: (ref: Avalon White Paper). I highly suggest reading
this white paper as it covers many concepts that are key to Cocoon,
namely Separation of Concerns (SOC) and Inversion of Control (IoC).
It also covers foundational aspects of the Avalon Framework, so you
can have a better understanding on how Cocoon is structured.</p>
<p>Cocoon helps you separate out concern areas for web development.
The areas addressed are Logic, Content, Style, and Management. There
are different mechanisms for each. In order to learn how to use Cocoon,
make sure you install it properly. Please consult the appendix for this,
or the Cocoon site (http://xml.apache.org/cocoon2).</p>
<s2 title="Separating Concerns">
<p>Apache Cocoon is designed to allow Developers, Business Analysts,
Designers, and Administrators to work with each other without breaking
the other person's contribution. The problem with using just JSPs,
ASPs,
or ColdFusion templates is that all of the look, feel, and logic are
intertwined. That means that maintenance is much more difficult, and
the
project's true costs are delayed until the customer wants feature
enhancements or bugs fixed. This also means that if the site design is
introduced late in the game, the cost of revamping the site becomes
much
higher.</p>
<s3 title="Developers">
<p>Developer's jobs are to create the business logic and object model
behind the web application. They are more concerned with
functionality
than with layout or the words displayed on a screen. These are the
people that will develop the Actions (Components that only process
information) and the hooks for how to get the necessary information
from business objects.</p>
</s3>
<s3 title="Business Analysts">
<p>The Business Analysts are the people who are concerned with the words
displayed on the screen, and to a certain extent, the layout.
Typically, they will be using the work done by the developer to put
together a generic markup that will be transformed into the results.
In small development environments, many times the developer takes on
both this role and the developer role. Typically, the business
analyst
will be working with the markup language that goes into the
generator.</p>
</s3>
<s3 title="Designers">
<p>The designer is the person or group of people who are responsible to
provide the final look and feel of a site. The designer does all the
graphics and HTML code. In Cocoon, they will be working with the
Transformers that take an input and structure it in a final
presentation.</p>
</s3>
<s3 title="Administrators">
<p>The administrator is responsible for the sitemap which maps the URI
space to the different pipelines in Cocoon. A pipeline is a path
from
a Generator to a Serializer. This means, that the administrator
decides that all requests for a resource with a ".html"
extension starts out as XML and ends up as HTML. The Administrator
will work closely with the Designers and the Developers. In the
absence of a dedicated administrator, one developer should assume
that
role. It is important that developers do not get bogged down in this
one Component.</p>
</s3>
</s2>
<s2 title="Development Style">
<p>You have to decide early on whether you will develop from a Business
Markup perspective, or develop from a Document Markup perspective.
They
have different ways of approaching the same problem. Both approaches
have its tradeoffs. In the end, you will find that you will need a
combination of different aspects of the two approaches.</p>
<s3 title="Business Markup Centric">
<p>This approach makes the Business Object the center of attention for
development. This approach formalizes your business objects, and
makes
sure that you always represent a business object in a standard
manner.
It's limitations come to bear when you have cases when you need
two different objects that need to be represented on the same logical
page.</p>
</s3>
<s3 title="Document Markup Centric">
<p>This approach feels the most natural to developers who come from
backgrounds with scripting languages. This approach is a bit more
flexible in that you represent a page logically, with the wording as
the center of attention. With this approach, it is up to the
developer
to ensure that the business object is represented in a consistent
manner.</p>
</s3>
<s3 title="Hybrid Approach">
<p>We will develop a hybrid approach to development in this paper. What
this means is that we start with a Document Markup Centric approach,
and add in support for specific Business Markup as it is needed. In
the end, this is the most flexible and maintainable method for
development.</p>
</s3>
</s2>
<s2 title="The Concept">
<p>For the sake of this paper, we are going to develop a very simple
database-backed application that manages users and departments. Each
element has a name and an identifier. A department can have many
employees, but each employee can only have one department. We will be
able to create, change, and delete both employees and departments.</p>
<s3 title="The SQL">
<source>
<![CDATA[
CREATE TABLE department {
department_id INT NOT NULL,
department_name VARCHAR (64) NOT NULL
};
CREATE TABLE employee {
employee_id INT NOT NULL,
employee_name VARCHAR (64) NOT NULL,
department_id INT NOT NULL
};
ALTER TABLE department ADD
PRIMARY KEY pkDepartment (department_id);
ALTER TABLE employee ADD
PRIMARY KEY pkEmployee (employee_id);
ALTER TABLE employee ADD
FOREIGN KEY department_id (department.department_id);
]]>
</source>
</s3>
<s3 title="Facilities">
<ol>
<li>Create Department (need name only)</li>
<li>Update Department (change name, reassign potential employees to
department, create employee for department)</li>
<li>Delete Department</li>
<li>Find Department (by name, or by ID)</li>
<li>Create Employee (need name and department-create department if
needed)</li>
<li>Update Employee (change name, reassign department-create
department if needed)</li>
<li>Delete Employee</li>
<li>Find Employees (by name, by ID, or by Department)</li>
</ol>
</s3>
<s3 title="Layouts">
<s4 title="Create Department">
<figure src="images/create-dept.jpg" alt="Create Department"/>
</s4>
<s4 title="Update Department">
<figure src="images/edit-dept.jpg" alt="Update Department"/>
</s4>
<s4 title="Create Employee">
<figure src="images/create-empl.jpg" alt="Create Employee"/>
</s4>
<s4 title="Update Employee">
<figure src="images/edit-empl.jpg" alt="Update Employee"/>
</s4>
<s4 title="Find Department">
<figure src="images/search-dept.jpg" alt="Find Department"/>
</s4>
<s4 title="Find Department Results">
<figure src="images/results-dept.jpg" alt="Find Department Results"/>
</s4>
<s4 title="Find Employee">
<figure src="images/search-empl.jpg" alt="Find Employee"/>
</s4>
<s4 title="Find Employee Results">
<figure src="images/results-empl.jpg" alt="Find Employee Results"/>
</s4>
</s3>
</s2>
</s1>
<s1 title="Diving In">
<p>In order to do anything in Cocoon, you will need a sitemap. At this
point
we will not go into detail but we will show you how to put an entry in so
you can see your stuff. In most development situations, the sitemap will
be set up for you. Since we want to start with a clean slate, take the
sitemap that comes with Cocoon's samples and clear out everything under
the <code><map:pipelines></code> tag. Next, you will add an entry
in the same location that looks like this:</p>
<source>
<![CDATA[
<map:pipeline>
<map:match pattern="">
<map:redirect-to uri="home.html"/>
</map:match>
<map:match pattern="**.xml">
<map:generate src="docs/{1}.xml"/>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="**.html">
<map:generate src="docs/{1}.xml"/>
<map:transform src="stylesheets/ipms.xsl"/>
<map:serialize/>
</map:match>
<map:match pattern="images/**.gif">
<map:read src="resources/images/{1}.gif" mime-type="image/gif"/>
</map:match>
<map:match pattern="images/**.jpg">
<map:read src="resources/images/{1}.jpg" mime-type="image/jpg"/>
</map:match>
<map:match pattern="images/**.png">
<map:read src="resources/images/{1}.png" mime-type="image/png"/>
</map:match>
<map:match pattern="resources/**.css">
<map:read src="resources/styles/{1}.css" mime-type="text/css"/>
</map:match>
<map:match pattern="resources/**.js">
<map:read src="resource/styles/{1}.js"
mime-type="application/x-javascript"/>
</map:match>
<map:handle-errors>
<map:transform src="stylesheets/system/error2html.xsl"/>
<map:serialize status-code="500"/>
</map:handle-errors>
</map:pipeline>
]]>
</source>
<p>What this does is tell the sitemap that we want to capture all URLs
with a ".xml" extension, and find an equivalent file in the
"docs" subdirectory. We are not performing any
transformations
at this time. The Sitemap is really a site administrator's job to
maintain. There are some exceptions to this general rule, but we will
discuss them when needed. We will use the Document Markup specified in
the StyleBook DTD format.</p>
<s2 title="Creating the Pages">
<p>Since we are only looking at XML right now, we need to make sure our
pages conform to the markup standards. You will see how well this
comes
in handy for debugging XSP (XML Server Pages) markup. Since we already
have the Layout specified, and the database created, we will create our
markup.</p>
<p>Our home page is going to be really simple: a list of links that take
us
to the main pages.</p>
<source>
<![CDATA[
<document>
<header>
<title>Home Page</title>
</header>
<body>
<s1 title="Welcome to Personnel Administrator">
<p>
Welcome to our Personnel Administrator. You
can perform one of the following functions:
</p>
<ul>
<li>
<link href="search-dept.html">Search Departments</link>
</li>
<li>
<link href="search-empl.html">Search Employees</link>
</li>
<li>
<link href="create-dept.html">Create Departments</link>
</li>
<li>
<link href="edit-dept.html">Edit a Department</link>
</li>
<li>
<link href="create-empl.html">Create Employee</link>
</li>
<li>
<link href="edit-empl.html">Edit an Employee</link>
</li>
</ul>
</s1>
</body>
</document>
]]>
</source>
<p>Even though this doesn't look like much right now, we have two
entries: "**.xml" and "**.html" for the same
resource. Look at "home.html", and see how it looks now.
Quite a difference. Don't remove the entry for viewing the page
as XML yet. We need to use it to debug our XSP pages later.</p>
<s3 title="Our First Form">
<p>For now, we are going to skip the search functionality, and jump to
our "create" templates. It is important to realize the
proper method of form handling. While it is possible to create XSP
pages that perform the logic for you, this approach is not very
maintainable. We also have to choose whether we will directly
access
the database, or encapsulate that logic in objects.</p>
<p>The tradeoffs are that the direct SQL access is faster to get
started,
but that it is harder to maintain in the end. You may decide to
start
with the direct SQL access at the beginning of a project, and build
the objects later. With that in mind, we will use some
functionality
that Cocoon has built in to make this approach a little easier.
Cocoon has a group of Database actions that allow you to map form
fields to dynamically created SQL calls. It also has a logicsheet
that makes creating SQL bound pages a little easier.</p>
<p>Our first form is the "Create a Department" form. The
website specification is missing the tags for form building, we will
provide an example here:</p>
<source>
<![CDATA[
<document>
<header>
<title>Department</title>
</header>
<body>
<s1 title="Create a Department">
<form handler="create-dept.html">
<p>
You can create a department by typing in the
name and pressing the "submit" button.
</p>
<p>
Name: <text name="name" size="30" required="true"/>
</p>
<submit name="Create Department"/>
<note>
* These fields are required.
</note>
</form>
</s1>
</body>
</document>
]]>
</source>
<p>It is important to note that the "submit" tag is
transformed
into an HTML submit button with the name "cocoon-action".
The "cocoon-action" form parameter is a magic value that
Cocoon uses to select a specific action from a group of actions that
only gets executed during that time. You will find that this page
displays correctly, but does not do anything yet. The handler is
where the navigation goes once you click on the
"Create Department" button on the screen. What we are
going
to do is create one confirmation page for all the Department and
Employee pages.</p>
<p>Cocoon has a FormValidatorAction that will take care of ensuring the
input results are acceptable. It also has the following database
actions for your convenience: DatabaseAddAction,
DatabaseUpdateAction,
DatabaseDeleteAction, and DatabaseAuthenticatorAction. We will only
need the Add, Update, and Delete actions for our simple webapp. In
order to prepare them, we create an XML configuration file that
tells
the actions how to map request parameters to database tables and
place
constraints on the parameters. For the Department form group, it
will
look like this:</p>
<source>
<![CDATA[
<root>
<!-
The "parameter" elements identify the root constraints for
the FormValidatorAction. We are specifying that the "id"
parameter is an integer (it limits to "long", "double",
"boolean", and "string"). We are specifying that the "name"
parameter is a string that is at least 5 characters--but no
more than 64 characters.
-->
<parameter name="id" type="long"/>
<parameter name="name" type="string" min-len="5" max-len="64"/>
<!-
Each constraint set is used when we are defining a new way
of validating a form. We define our constraint sets by
function. Since we have the same basic form that is driving
the FormValidator, we have an update set and an add set.
Note that you can impose additional constraints than the
default constraints listed above. Also, you do not "have"
to enforce a constraint. Each "validate" element below
identifies the parameter constraints we are enforcing.
For more information view the JavaDocs for
AbstractValidatorAction
-->
<constraint-set name="update">
<validate name="name"/>
<validate name="id" nullable="no" min="1"/>
</constraint-set>
<constraint-set name="add">
<validate name="name"/>
</constraint-set>
<!--
This is where we identify our table mappings so that the
Database Actions can work their magic. Note that the
parameter names are the same as above--as well as the same
as form parameter names.
First we tell the Database Actions that we are using the
"personnel" connection pool we set up in Cocoon.xconf. This
file should be set up by the site administrator.
We also tell the Database Actions the structure of the table
we will be populating. The keys are used to identify which
columns will be treated as keys--they are treated different
when the different SQL statements are created. Note that
there is a "mode" attribute in the key element. The mode
refers to how new keys will be generated. There are three
modes: "automatic" keys are generated by the database,
"manual" keys are generated by manually finding the largest
value and incrementing it, and finally "form" keys take the
key value from a parameter on the form.
Both keys and values serve to map parameter names to table
columns, converting the value into the native type. For a
list of supported types check out the JavaDocs for
AbstractDatabaseAction.
-->
<connection>personnel</connection>
<table name="department">
<keys>
<key param="id" dbcol="department_id" type="int" mode="manual"/>
</keys>
<values>
<value param="name" dbcol="department_name" type="string"/>
</values>
</table>
</root>
]]>
</source>
<p>After you create the descriptor file, you will have to create some
entries in the Sitemap so you can take advantage of the form
descriptor. First, the Sitemap has to be able to know how to
reference the Actions we want. To do that, alter the
"map:actions" section to list all the actions we need:</p>
<source>
<![CDATA[
<map:actions>
<map:action name="dbAdd"
src="org.apache.cocoon.acting.DatabaseAddAction"/>
<map:action name="dbDel"
src="org.apache.cocoon.acting.DatabaseDeleteAction"/>
<map:action name="dbUpd"
src="org.apache.cocoon.acting.DatabaseUpdateAction"/>
<map:action name="form"
src="org.apache.cocoon.acting.FormValidatorAction"/>
</map:actions>
]]>
</source>
<p>Lastly, we want to create an action set. An action set is a group
of
actions that will be applied at once. If the action set entry has
an
"action" parameter, then the specific action is only
executed when the magic "cocoon-action" request parameter
matches the value of the "action" parameter. For our
purposes, the action set we are defining is listed below (defined in
the sitemap):</p>
<source>
<![CDATA[
<map:action-sets>
<map:action-set name="process">
<map:act type="form" action="Create Department">
<map:parameter name="validate-set" value="add"/>
<map:act type="dbAdd"/>
</map:act>
<map:act type="form" action="Update Department">
<map:parameter name="validate-set" value="update"/>
<map:act type="dbUpd"/>
</map:act>
<map:act type="dbDel" action="Delete Department"/>
</map:action-set>
</map:action-sets>
]]>
</source>
<p>Now that we have defined the actions we want, with the parameters
that
control them during run-time, we can use it in our pipeline.</p>
<source>
<![CDATA[
<map:match pattern="*-dept.html">
<map:act set="process">
<map:parameter name="descriptor"
value="context://docs/department-form.xml"/>
<map:parameter name="form-descriptor"
value="context://docs/department-form.xml"/>
<map:generate type="serverpages" src="docs/confirm-dept.xsp"/>
<map:transform src="stylesheets/ipms.xsl"/>
<map:serialize/>
</map:act>
<map:generate type="serverpages" src="docs/{1}-dept.xsp"/>
<map:transform src="stylesheets/ipms.xsl"/>
<map:serialize/>
</map:match>
<map:match pattern="*-dept.xml">
<map:act set="process">
<map:parameter name="descriptor"
value="context://docs/department-form.xml"/>
<map:parameter name="form-descriptor"
value="context://docs/department-form.xml"/>
<map:generate type="serverpages" src="docs/confirm-dept.xsp"/>
<map:serialize type="xml"/>
</map:act>
<map:generate type="serverpages" src="docs/{1}-dept.xsp"/>
<map:serialize type="xml"/>
</map:match>
]]>
</source>
<p>This may not seem clear what is happening right now. The way
actions
work is if they return a null, nothing inside the
"map:act"
entry will execute, and the request processing will flow through to
the second "map:generate" section. This is a side affect
of
using the FormValidatorAction. If we choose to create our own
business objects and form validation framework (see the
"epos" repository in SourceSafe), we are not constrained
by
this construct.</p>
<p>In addition, we changed the type of generator we are using: we have
made it a "serverpages" (or XSP) generator. We made the
transition now so that we can report information on what failed to
the
user. First, we need to convert our "create-dept.xml"
file
to an XSP page so that we can see the page again (right now we will
get an error). To do this, simply add a new tag to the base of the
document called "xsp:page" declaring the XSP namespace.
The
change will look like this:</p>
<source>
<![CDATA[
<xsp:page xmlns:xsp="http://apache.org/xsp">
<!-- The original document will be embedded here -->
</xsp:page>
]]>
</source>
<p>To complete the transformation, we usually change the extension to
".xsp" so we know what we are dealing with at a glance.
Create a new file called "confirm.xsp" with the following
contents:</p>
<source>
<![CDATA[
<xsp:page xmlns:xsp="http://apache.org/xsp">
<document>
<header>
<title>Department</title>
</header>
<body>
<s1 title="Department Processed">
<p>
You have successfully processed the department.
</p>
</s1>
</body>
</document>
</xsp:page>
]]>
</source>
<s4 title="Adding support for Error Reporting">
<p>In order to successfully report errors processing the page, add
another namespace declaration to the "xsp:page" element.
The final form page will look like this:</p>
<source>
<![CDATA[
<xsp:page xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-formval="http://apache.org/xsp/form-validator/2.0">
<document>
<header>
<title>Department</title>
</header>
<body>
<s1 title="Create a Department">
<form handler="create-dept.html">
<p>
You can create a department by typing in the
name and pressing the "submit" button.
</p>
<p>
Name: <text name="name" size="30" required="true"/><br />
<xsp:logic>
if (<xsp-formval:is-toosmall name="name"/>) {
<xsp:text>"Name" must be at least 5 characters</xsp:text>
} else if (<xsp-formval:is-toolarge name="name"/>) {
<xsp:text>"Name" was too long</xsp:text>
}
</xsp:logic>
</p>
<submit name="Create Department"/>
<note>
* These fields are required.
</note>
</form>
</s1>
</body>
</document>
</xsp:page>
]]>
</source>
</s4>
</s3>
<s3 title="Adding Database Support with the ESQL Logicsheet">
<p>The "Create Employee" page is going to require database
access so that we know which Department a new employee is assigned
to.
This is fairly easy to accomplish with the ESQL Logicsheet. Again,
when you use the ESQL logicsheet, you lose some of your separation of
concerns.</p>
<source>
<![CDATA[
<xsp:page xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-formval="http://apache.org/xsp/form-validator/2.0"
xmlns:esql="http://apache.org/cocoon/SQL/v2">
<document>
<header>
<title>Employee</title>
</header>
<body>
<s1 title="Create an Employee">
<form handler="create-empl.html">
<p>
You can create a department by typing in the
name and pressing the "submit" button.
</p>
<p>
Name: <text name="name" size="30" required="true"/><br />
<xsp:logic>
if (<xsp-formval:is-null name="name"/>) {
<xsp:text>"Name" cannot be empty</xsp:text>
} else if (<xsp-formval:is-toolarge name="name"/>) {
<xsp:text>"Name" was too long</xsp:text>
}
</xsp:logic>
</p>
<p>
Department:
<select name="department">
<esql:connection>
<!-- declare the connection pool we are using -->
<esql:pool>personnel</esql:pool>
<!-- query execution blocks can be repeated -->
<esql:execute-query>
<!-- Find all departments and order them -->
<esql:query>
SELECT department_id, department_name
FROM department ORDER BY department_name
</esql:query>
<!-- What to do with the results -->
<esql:results>
<!--
A successful query that returns results
executes this block. You can also embed
more "execute-query" blocks inside the
row-results. That way you can have queries
that filter information based on the results
of other queries.
-->
<esql:row-results>
<option>
<xsp:attribute name="name">
<esql:get-string column="department_id"/>
</xsp:attribute>
<esql:get-string column="department_name"/>
</option>
</esql:row-results>
<!--
Other result types are "no-results" and
"error-results". A successful query that
does not return results (an empty resultset)
will use the XML embedded in the "no-results"
section. An unsuccessful query that throws
an exception will use the XML embedded in
the "error-results" section.
-->
</esql:results>
</esql:execute-query>
</esql:connection>
</select>
</p>
<submit name="Create Employee"/>
<note>
* These fields are required.
</note>
</form>
</s1>
</body>
</document>
</xsp:page>
]]>
</source>
<p>As you can see ESQL is flexible and powerful, but the cost of that
flexibility is a loss of readability. Using a logicsheet to wrap
information in a business object is another alternative. Notice how
ESQL works:</p>
<ul>
<li>First, we specify our connection information which will apply to
all queries in the ESQL structure.</li>
<li>Next, we specify our first query we are going to use. Note that
you can nest queries as well as have more than one in an
"esql:connection" element.</li>
<li>Lastly, we specify how we process the results. There are three
different types of results: "esql:row-results",
"esql:no-results", and "esql:error-results".
This allows you to handle different scenarios easily. It is
inside the individual results elements that we can nest new
queries to process.</li>
</ul>
<s4 title="A Note About Actions">
<p>Actions are the bread and butter of logic processing in Cocoon.
There are a number of approaches that you can take when developing
Actions. You can create a specific action for each piece of
business logic. This approach is very heavy handed and requires
you
to spend a lot of development time creating actions.</p>
<p>The preferred method for creating actions is to provide a generic
action that can handle a wide range of specific actions. The
Database Actions and Validator Actions are examples of this
approach.
They will read a configuration file specified by a parameter, and
they will modify the specific results based on the configuration
file. In order to take advantage of this for your own Actions, you
can extend the AbstractComplimentaryConfigurationAction. Basically
what it does is encapsulate the logic for reading and caching the
Configuration information for your Action.</p>
</s4>
</s3>
</s2>
<s2 title="Redirects">
<p>Most web developers agree that redirecting a user based on input is a
valuable and necessary part of web development. In Cocoon there are
only two locations where you can issue redirects: the Sitemap and
Actions. In essence, Cocoon does require you to plan so that
redirects
are only used when necessary.</p>
<p>One approach that is good to use is to require all traffic to go
through a URL controlling action. The Action will test to see if the
user is logged in, and if not will send them to the login page.
Another derivation on this approach is to test for a user's
role,
and if they do not have access redirect them to a different page.</p>
</s2>
<s2 title="Writing an Action">
<p>Writing an action is as simple as writing a Component that conforms to
the Action interface. Be sure to examine the different Actions that
are
in the org.apache.cocoon.acting package - you might find some abstract
actions that you can extend. Actions are Avalon Components, so you
may
want to read Avalon's Whitepaper for more information.</p>
<note>Actions will return a map that contains values that the sitemap
administrator can use in the sitemap. If the Action returns a
null,
then anything inside the "map:act" element will not be
executed.</note>
<s3 title="Return Values">
<p>The Action interface specifies that it returns a Map. This Map is
used for value substitution in the sitemap, and communicating
information to other Actions. When an Action is specified in the
sitemap, it uses the following syntax:</p>
<source>
<![CDATA[
<map:act type="my-action">
<map:generate src="{source}"/>
<map:transform src="doc2{theme}"/>
<map:serialize/>
</map:act>
]]>
</source>
<p>The above code snippet assumes you have an Action with the name
"my-action" already specified. It also assumes that there
are two "parameters" returned from the action in the Map.
The
sitemap queries the returned Map for the "source" and
"theme" values, and substitutes their values in place of
the
curly braces that referenced it. In other words, when it sees the
"map:generate" with an src attribute of
"{source}"
it looks in the Map. For our discussion, let us say the value stored
is "index.xml". The Sitemap will perform the substitution
so that the src attribute now containts "index.xml".</p>
<p>In the case that the above the action might return a null value. In
that case, everything inside the "map:act" element is
skipped. You can use this to good advantage like the
*ValidatorActions
do. If everything is validated correctly, they return a Map. If
there
is an error, they return a null, and place the information in Request
attributes.</p>
</s3>
</s2>
</s1>
<s1 title="Cocoon Supplied Components">
<p>Cocoon supplies a number of different Components for your use. The types
of Components we will discuss here are Generators, Transformers,
Serializers, Readers, and Actions. This are the important Components
that
allow you to do you job.</p>
<s2 title="Generators">
<p>A Generator will create SAX events for a SAX stream-whether it reads
from
an input stream or it generates it on the fly. All built in generators
are in the package "org.apache.cocoon.generation".</p>
<s3 title="DirectoryGenerator">
<p>Reads a directory, and builds an XML document based on the contents.
You can pass parameters to it to control how it behaves (note
parameter names are case sensitive):</p>
<ul>
<li>dateFormat - a format string that you would use in the Java
SimpleDateFormat object</li>
<li>depth - the maximum number of directories deep the generator will
look (defaults to 1)</li>
<li>root - a regular expression to find the root directory</li>
<li>include - a regular expression to declare the files/directories
that will be included in the list</li>
<li>exclude - a regular expression to declare the files/directories
that will not be included in the list</li>
</ul>
<p>When you use this Generator, you must have the Jakarta Regexp package
installed in your WEB-INF/libs directory. Also, the
DirectoryGenerator
is not Cacheable so the results will be generated fresh each
time.</p>
<p>The resulting XML looks like this:</p>
<source>
<![CDATA[
<?xml version="1.0"?>
<directory xmlns="http://apache.org/cocoon/directory/2.0"
name="C:\path\dir\"
lastModified="135432153351"
date="11 Jun 2001">
<file name="C:\path\dir\file.xml" lastModified="135432153351"
date="11 Jun 2001"/>
</directory>
]]>
</source>
</s3>
<s3 title="FileGenerator">
<p>This generator and the ServerPagesGenerator will be your most used
generators. The FileGenerator reads an XML file from an input
source,
and converts it into a SAX stream.</p>
<p>When you use this Generator, you must have a JAXP 1.1 compliant
parser
installed in your WEB-INF/libs directory. You may also use the
Xerces
parser bypassing the JAXP requirement. The FileGenerator is
Cacheable,
so the results will only be re-read when the file changes.</p>
</s3>
<s3 title="FragmentExtractorGenerator">
<p>This generator is used in conjunction with the
FragmentExtractorTransformer (more on that in the transformers
section). The FragmentExtractorTransformer splits an XML document
into
smaller parts so you can treat each smaller part as a unique
document.
To see this in action, check out the Cocoon supplied samples and
click
on the SVG Welcome page.</p>
<p>This Generator caches the results from the
FragmentExtractorTransformer
for quick retrieval later. It is Cacheable, so the fragments are
generated once and the cached version is read from that point
forward.</p>
</s3>
<s3 title="HTMLGenerator">
<p>This generator is used to read in an HTML file that may not be
properly
formatted to comply with XML standards. The result is properly
formatted XHTML.</p>
<p>This generator requires the Tidy.jar file installed in the
WEB-INF/libs directory. The HTMLGenerator is Cacheable, so the
results
can be cached for application speedup.</p>
</s3>
<s3 title="ImageDirectoryGenerator">
<p>This generator is an extension of the DirectoryGenerator, so it has
the
same requirements. It extends the markup to include two new
attributes
for the "file" element: "height" and
"width". The ImageDirectoryGenerator reads every GIF and
JPEG file to get the dimensions.</p>
<p>This generator is not Cacheable (just like the
DirectoryGenerator).</p>
</s3>
<s3 title="JspGenerator">
<p>This generator executes a JSP file and parses the result. The JSP
must
generate valid XML, and be a file in the context.</p>
<p>This generator requires a JAXP 1.1 compliant parser or Xerces if your
environment will not allow you to install one. It is also not
cacheable so the results are generated each time.</p>
</s3>
<s3 title="PhpGenerator">
<p>This generator functions just like the JspGenerator, but with PHP
templates. The PHP must generate valid XML, and be a file in the
context.</p>
<p>This generator requires a JAXP 1.1 compliant parser and the
phpservlet.jar file that comes from http://php.net. Install the
files
in the WEB-INF/libs directory. The PhpGenerator is not
Cacheable.</p>
</s3>
<s3 title="RequestGenerator">
<p>This generator converts the Request object into an XML
representation.
It is best used for debugging purposes. The resulting XML
follows:</p>
<source>
<![CDATA[
<request xmlns="http://xml.apache.org/cocoon/requestgenerator/2.0"
target="index.html" source="context://docs/index.xml">
<requestHeaders>
<header name="HOST_NAME">johny-bravo.infoplanning.com</header>
<!-- repeat for each header -->
</requestHeaders>
<requestParameters>
<parameter name="form-param">
<value>1</value>
<!-- repeat for each value in "form-param" -->
</parameter>
<!-- repeat for each parameter -->
</requestParameters>
<configurationParameters>
<parameter
name="configurations">context://WEB-INF/cocoon.xconf</parameter>
<!-- repeat for each parameter -->
</configurationParameters>
</request>
]]>
</source>
<p>The RequestGenerator does not have any special requirements for
libraries, and it is not Cacheable.</p>
</s3>
<s3 title="ScriptGenerator">
<p>The ScriptGenerator uses the Bean Scripting Framework (BSF) and an
associated interpreter to generate valid XML. If you add language
support, you will have to embed the following configuration
information:</p>
<source>
<![CDATA[
<add-languages>
<!-- repeat the following for each language: -->
<language name="kawa-scheme"
src="org.gnu.kawa.bsf.engines.KawaEngine">
<extension>scm</extension>
<!-- repeat for each file extension -->
</language>
</add-languages>
]]>
</source>
<p>The ScriptGenerator requires that you have the bsf.jar in your
WEB-INF/libs directory along with any jars for the script
interpreters
you use. The ScriptGenerator is not Cacheable.</p>
</s3>
<s3 title="ServerPagesGenerator">
<p>The ServerPagesGenerator is the XML Server Pages (XSP) engine. It
automatically compiles a new Generator at runtime based on an input
XML file.</p>
<p>This generator requires that you have a JAXP 1.1 compliant parser and
XSLT engine installed in your WEB-INF/libs directory. It also
requires
you to have the JDK's tools.jar file in your classpath. If you
reference any packages, they must also be in your classpath. The
created generator is not Cacheable.</p>
</s3>
<s3 title="StatusGenerator">
<p>The StatusGenerator is another debug tool. It provides status
information for the Cocoon engine. The resultant XML is in the
following format:</p>
<source>
<![CDATA[
<statusinfo xmlns="http://apache.org/cocoon/status/2.0"
xmlns:xlink="http://www.w3.org/1999/xlink"
host="johnny-bravo.infoplanning.com"
date="7/16/2001 1:16:42 pm">
<group name="vm">
<group name="memmory">
<value name="total"><line>5213255</line></value>
<value name="free"><line>12321211</line></value>
</group>
<group name="jre">
<value name="version"><line>1.3.1</line></value>
<value name="java-vendor"
xlink:type="simple"
xlink:href="http://java.sun.com/jdk/1.3/">
<line>Sun Microsystems Inc.</line>
</value>
</group>
<group name="operating-system">
<value name="name"><line>Windows 2000</line></value>
<value name="architecture"><line>x86</line></value>
<value name="version"><line>5.0</line></value>
</group>
</group>
<value name="classpath">
<line>C:\tomcat\lib\tomcat.jar</line>
<line>C:\jdk1.3.1\lib\tools.jar</line>
</value>
</statusinfo>
]]>
</source>
<p>The results are not cacheable, and do not require any special
libraries.</p>
</s3>
<s3 title="StreamGenerator">
<p>The StreamGenerator is used to convert the Request's InputStream
into a SAX XML stream. Alternately, it will accept the magic form
parameter "form-name" and read the input stream that the
parameter points to.</p>
<p>This generator requires the JAXP 1.1 compliant parser (or Xerces).
It
is not cacheable.</p>
</s3>
<s3 title="VelocityGenerator">
<p>The VelocityGenerator is used to convert the output from the Velocity
template engine to a valid XML stream.</p>
<p>This generator requires Jakarta Velocity and a JAXP 1.1 compliant
parser installed in WEB-INF/libs. It is not Cacheable.</p>
</s3>
</s2>
<s2 title="Transformers">
<p>Transformers read a SAX stream, manipulate the XML stream, and send the
results to the next Component in the chain. All built in generators
are
in the package "org.apache.cocoon.generation".</p>
<s3 title="CIncludeTransformer">
<p>The CIncludeTransformer looks for instances of the
"ci:include" element, and will embed another XML resource
in
your document. That resource can be in the sitemap so you can
include
the results of processed XSP pages. An example follows:</p>
<source>
<![CDATA[
<document xmlns:ci="http://apache.org/cocoon/include/1.0">
<ci:include src="cocoon://my-resource.xml"
element="body"
ns="http://mycompany.com/my-resource/1.0"
prefix="res"/>
</document>
]]>
</source>
<p>The Transformer will read the results from the sitemap, and embed it
into this document with a new root element "body" using a
new
namespace
(xmlns:res="http://mycompany.com/my-resource/1.0").
The results are not cached.</p>
</s3>
<s3 title="FilterTransformer">
<p>The FilterTransformer will look for instances of an element you
specify
using parameters, and will not forward any SAX events for that
element
or any child elements. You can pass parameters to it to control how
it
behaves (note parameter names are case sensitive):</p>
<ul>
<li>element-name - The name of the element to filter</li>
<li>count - the number of times the element will be filtered</li>
<li>blocknr - the element number that filtering begins</li>
</ul>
</s3>
<s3 title="FragmentExtractorTransformer">
<p>This is transformation half of the FragmentExtractor. This
transformer
sieves an incoming stream of xml with embedded SVG images and
replaces
the images with a xlink locator pointing to the image. Ultimately
this
could be much more general, but currently it is mainly an SVG
extraction.</p>
</s3>
<s3 title="I18nTransformer">
<p>This is Cocoon's port of Infozone Group's I18nProcessor.
The
word i18n is a shorthand for the longer word
"internationalization" (starts with 'i', ends
with
'n', and has 18 letters in the middle). The
internationalization transformer allows you to look up references by
key in an XML dictionary. This allows you to support your same
business processes in many different countries. You have to pass
parameters to it so that it knows how to process i18n requests:</p>
<ul>
<li>default_lang - The default language if the requested language does
not exist (two character country code)</li>
<li>avalailable_lang_X - Language available by the dictionary (two
character country code). Replace the 'X' in the
attribute with a number (1, 2, 3).</li>
<li>src - The location of the dictionary file.</li>
</ul>
<p>The I18nTransformer reads the request parameter "lang" to
determine which language to display to the user. To translate text
either embed the text inside the "i18n:text" element, or
the
attribute name inside the "i18n:attr" attribute.</p>
<source>
<![CDATA[
<document xmlns:i18n="http://apache.org/cocoon/i18n/2.0">
<body>
<s1 title="Test Title" i18n:attr="title">
<p>
<i18n:text>This is replaceable text.</i18n:text>
</p>
</s1>
</body>
</document>
]]>
</source>
</s3>
<s3 title="LDAPTransformer">
<p>The LDAPTransformer is a class that can be plugged into a pipeline to
transform the SAX events which passes through this transformer into
queries an responses to/from a LDAP interface.</p>
</s3>
</s2>
</s1>
<s1 title="The Sitemap">
<p>This section is meant primarily as a reference for the Sitemap Manager.
The person in this role needs to have a better understanding of the
sitemap
than any other role. The sitemap is a relatively new concept, and as
such
is subject to refinement. There have been a couple of proposals to
replace
it with something else, but nothing has been started yet.</p>
<p>The Sitemap is composed of three major parts: component declaration,
resource declaration, and pipeline declaration. You will only use a few
different types of components in the sitemap: Generators, Transformers,
Serializers, Readers, Matchers, Selectors, and Actions. Generators
create
XML and pass the results in a SAX stream. Transformers read a SAX stream
and manipulate the results on the way through. Serializers read a SAX
stream, and convert it into the servlet's output stream. Readers
read
an input stream and copy the results to the servlet's output
stream.
Matchers and Selectors are used to choose how to process an incoming
request. Lastly, Actions are used to perform logic only functions (no
display logic).</p>
<p>Below is the root element of all sitemaps:</p>
<source>
<![CDATA[
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
</map:sitemap>
]]>
</source>
<s2 title="Choosing your Components">
<p>As previously discussed, you may choose a number of components to use
in your own system. This section identifies the different components
you can use, and what they do. Before we begin, I must state that
every component is declared in the "map:components" element
of the Sitemap:</p>
<source>
<![CDATA[
<map:components>
</map:components>
]]>
</source>
<s3 title="Generators">
<p>All generators are declared within the "map:generators"
element that is a child of the "map:components"
element:</p>
<source>
<![CDATA[
<map:generators>
<map:generator name="file"
src="org.apache.cocoon.generation.FileGenerator"/>
</map:generators>
]]>
</source>
<p>Most Generators do not have configuration information, so the
"map:generator" element is left empty. If there were
configuration information to pass to the generator, it would be
placed inside the element. As you can see in the sitemap snippet
above, you declare a generator with the "map:generator"
element, a "name" attribute, and a "src"
attribute. The "name" attribute is how you will refer to
this specific type of generator from this point forward. The
"src" attribute is the fully qualified class name of the
Generator class. In fact this construct is the same for all
component types - the only thing that changes is the elements that
declare the type of Component we are dealing with.</p>
</s3>
</s2>
</s1>
</body>
</document>
1.3 +3 -0
xml-cocoon2/documentation/xdocs/userdocs/generators/book.xml
Index: book.xml
===================================================================
RCS file:
/home/cvs/xml-cocoon2/documentation/xdocs/userdocs/generators/book.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- book.xml 2001/10/04 08:24:37 1.2
+++ book.xml 2001/10/05 07:15:19 1.3
@@ -27,9 +27,12 @@
<menu-item label="Request Generator" href="request-generator.html"/>
<menu-item label="Status Generator" href="status-generator.html"/>
<menu-item label="Stream Generator" href="stream-generator.html"/>
+ <menu-item label="Profile Generator" href="profile-generator.html"/>
</menu>
<menu label="Optional">
<menu-item label="Php Generator" href="php-generator.html"/>
+ <menu-item label="XML:DB Generator" href="xmldb-generator.html"/>
+ <menu-item label="XML:DB Collection Generator"
href="xmldbcollection-generator.html"/>
</menu>
</book>
1.3 +3 -0
xml-cocoon2/documentation/xdocs/userdocs/generators/generators.xml
Index: generators.xml
===================================================================
RCS file:
/home/cvs/xml-cocoon2/documentation/xdocs/userdocs/generators/generators.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- generators.xml 2001/10/01 13:39:04 1.2
+++ generators.xml 2001/10/05 07:15:19 1.3
@@ -36,8 +36,11 @@
<li><link
href="velocity-generator.html">Velocity Generator</link></li>
<li><link href="request-generator.html">Request
Generator</link></li>
<li><link href="status-generator.html">Status
Generator</link></li>
+ <li><link href="profile-generator.html">Profile
Generator</link></li>
<li><link href="stream-generator.html">Stream
Generator</link></li>
<li><link href="php-generator.html">Php
Generator</link> (optional)</li>
+ <li><link href="xmldb-generator.html">XML:DB
Generator</link> (optional)</li>
+ <li><link
href="xmldbcollection-generator.html">XML:DB Collection Generator</link>
(optional)</li>
</ul>
</s1>
</body>
1.1
xml-cocoon2/documentation/xdocs/userdocs/generators/profile-generator.xml
Index: profile-generator.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN"
"../../dtd/document-v10.dtd">
<document>
<header>
<title>Profile Generator</title>
<subtitle>in @doctitle@</subtitle>
<version>0.9</version>
<type>Technical document</type>
<authors>
<person name="Carsten Ziegeler" email="[EMAIL PROTECTED]"/>
</authors>
<abstract>This document describes the profile generator of
@[EMAIL PROTECTED]</abstract>
</header>
<body>
<s1 title="Profile Generator">
<p>
The profile generator creates xml from the current profiler
measurement
results of cocoon.
</p>
<p>
The information is surrounded by the root element
<code>profilerinfo</code>
and grouped with the elements <code>pipeline</code>,
<code>average</code>, <code>result</code> and
<code>element</code>.
</p>
<p>
The <code>profilerinfo</code> element has the attribute
<code>date</code>.
The <code>pipeline</code> element has the attributes
<code>uri</code>, <code>count</code> and <code>time</code>.
The <code>average</code> element has the attribute
<code>time</code>.
The <code>element</code> element has the attributes
<code>role</code>, <code>source</code> and <code>time</code>.
</p>
<p>
A <code>pipeline</code> summarizes profile information of a
pipeline
as specified in the <code>sitemap</code>.
Each <code>pipeline</code> element consists of
an <code>average</code>, and a <code>result</code> element.
The <code>average</code> element describes the average time
values,
whereas the <code>result</code> element describes each pipeline
processing.
</p>
<p>
The <code>element</code> element describes the timing values
for each stage of
the pipeline processing.
</p>
<p>
All elements have the namespace
<code>http://apache.org/cocoon/profiler/1.0</code>.
</p>
<ul>
<li>Name : profile</li>
<li>Class:
org.apache.cocoon.components.profiler.ProfilerGenerator</li>
<li>Cacheable: no.</li>
</ul>
<s2 title="Configuraton of cocoon.xconf">
<p>Edit <code>cocoon.xconf</code>
</p>
<source><![CDATA[
...
<event-pipeline class="org.apache.cocoon.components.profiler.\
ProfilingNonCachingEventPipeline"/>
<sax-connector class="org.apache.cocoon.components.profiler.\
ProfilingSAXConnector"/>
...
<profiler/>
]]></source>
</s2>
<s2 title="Configuration sitemap.xmap">
<p>Edit <code>sitemap.xmap</code>
</p>
<source><![CDATA[
<map:generators default="file">
...
<map:generator name="profile"
src="org.apache.cocoon.components.profiler.ProfilerGenerator"
label="content"/>
</map:generators> ...
<map:match pattern="profile">
<map:generate type="profile"/>
<map:transform type="xslt" src="stylesheets/system/profile2html.xsl"/>
<map:serialize/>
</map:match>
]]></source>
</s2>
<p>
You may try <code>http://localhost/cocoon/profile</code>
several times.
</p>
</s1>
<s1 title="Configuration">
<p>The following parameter can be specified in the pipeline for
the generate command:
</p>
<ul>
<li>
sort (optional) : Sets how Profile Generator sorts
pipeline elements. You may set <code>sort</code> to
<code>uri</code>
to sort <code>pipeline</code> element by its <code>uri</code>
attribute,
setting <code>sort</code> to time sorts
<code>pipeline</code> elements by its <code>time</code>
attribute,
finally setting <code>sort</code> to count sorts
<code>pipeline</code> elements
by its <code>count</code> attribute.
</li>
</ul>
</s1>
<s1 title="DTD">
<p>XML generated by status generator uses namespace
<code>http://apache.org/cocoon/status/2.0</code>. The DTD of XML
generated by status generator:
</p>
<source><![CDATA[
<!ELEMENT profilerinfo (pipeline)*>
<!ATTLIST profilerinfo
date CDATA #IMPLIED
>
<!ELEMENT pipeline (average, result)*>
<!ATTLIST pipeline
uri CDATA #REQUIRED
count CDATA #REQUIRED
time CDATA #REQUIRED
>
<!ELEMENT average (element)*>
<!ATTLIST average
time CDATA #REQUIRED
>
<!ELEMENT result (element)*>
<!ATTLIST result
time CDATA #REQUIRED
>
<!ELEMENT element EMPTY>
<!ATTLIST element
role CDATA #REQUIRED
source CDATA #IMPLIED
time CDATA #REQUIRED
>
]]></source>
</s1>
<s1 title="Example">
<p>The profile generator may output information:
</p>
<source><![CDATA[
<profilerinfo xmlns="http://apache.org/cocoon/profiler/1.0"
date="01.09.2001 21:50:00">
<pipeline uri="welcome" count="1" time="481">
<average time="481">
<element role="file" source="docs/samples/samples.xml"
time="250"/>
<element role="xslt" source="stylesheets/simple-samples2html.xsl"
time="171"/>
<element role="org.apache.cocoon.serialization.HTMLSerializer"
time="60"/>
</average>
<result time="481">
<element role="file" source="docs/samples/samples.xml"
time="250"/>
<element role="xslt" source="stylesheets/simple-samples2html.xsl"
time="171"/>
<element role="org.apache.cocoon.serialization.HTMLSerializer"
time="60"/>
</result>
</pipeline>
<pipeline uri="profile" count="1" time="3355">
<average time="3355">
<element role="profile" time="2964"/>
<element role="xslt" source="stylesheets/system/profile2html.xsl"
time="180"/>
<element role="org.apache.cocoon.serialization.HTMLSerializer"
time="211"/>
</average>
<result time="3355">
<element role="profile" time="2964"/>
<element role="xslt" source="stylesheets/system/profile2html.xsl"
time="180"/>
<element role="org.apache.cocoon.serialization.HTMLSerializer"
time="211"/>
</result>
</pipeline>
</profilerinfo>
]]></source>
</s1>
</body>
</document>
1.1
xml-cocoon2/documentation/xdocs/userdocs/generators/xmldb-generator.xml
Index: xmldb-generator.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN"
"../../dtd/document-v10.dtd">
<document>
<header>
<title>XML:DB Generator</title>
<subtitle>in @doctitle@</subtitle>
<version>0.1</version>
<type>Technical document</type>
<authors>
<person name="Gianugo Rabellino" email="[EMAIL
PROTECTED]"/>
</authors>
<abstract>This document describes the XML:DB generator of
@[EMAIL PROTECTED]</abstract>
</header>
<body>
<s1 title="XML:DB Generator">
<p>
Generates XML documents out of an XML:DB compliant database. XML:DB
is a generic API developed by the XML:DB group in order to allow
access
via a consistent API to the upcoming XML databases such as dbXML,
Ozone and eXist (as of now only the first one has an almost compliant
API implementation).
For the sake of this document, an XML:DB compliant database can be
seen as a filesystem where directories are called "collections" and
files are called "resources".
</p>
<ul>
<li>Name: xmldb</li>
<li>Class: org.apache.cocoon.generation.XMLDBGenerator</li>
<li>Cacheable: no</li>
</ul>
<p>
The generator needs to be configured in a "JDBCish" way: a driver
(a class name) must be provided, together with a "base" URI. An
example
configuration, based on the stock dbXML implementation, will look
like
this:
</p>
<source>
<![CDATA[
<map:generator name="xmldb"
src="org.apache.cocoon.generation.XMLDBGenerator" label="content">
<driver>org.dbxml.client.xmldb.DatabaseImpl</driver>
<base>xmldb:dbxml:///db/</base>
</map:generator>
]]>
</source>
<p>
Note that the content of the "base" tag will be prepended to the
requested resource. It's important to keep a trailing slash at the
end of the <code>base</code> tag.
</p>
</s1>
</body>
</document>
1.1
xml-cocoon2/documentation/xdocs/userdocs/generators/xmldbcollection-generator.xml
Index: xmldbcollection-generator.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN"
"../../dtd/document-v10.dtd">
<document>
<header>
<title>XML:DB Collection Generator</title>
<subtitle>in @doctitle@</subtitle>
<version>0.1</version>
<type>Technical document</type>
<authors>
<person name="Gianugo Rabellino" email="[EMAIL
PROTECTED]"/>
</authors>
<abstract>This document describes the XML:DB
Collection generator of @[EMAIL PROTECTED]</abstract>
</header>
<body>
<s1 title="XML:DB Collection Generator">
<p>
As for the filesystem there are two generators provided (a file
generator and a directory generator), so is for XML:DB, which
can roughly be tought as an XML filesystem, where Collections
stand for directories and Resources stand for (XML) files.
</p>
<p>
This generator outputs a list of collections and resources
given a starting collection. It can be used together with
the XMLDBGeneratot, and coupled with the appropriate XSLT,
to easily navigate any XML:DB compliant database.
</p>
<ul>
<li>Name: xmldbcollection</li>
<li>Class: org.apache.cocoon.generation.XMLDBCollectionGenerator</li>
<li>Cacheable: no</li>
</ul>
<p>
The configuration is the same of the XMLDBGenerator: it needsi
a driver (a class name) and base URI. An example
configuration, based on the stock dbXML implementation, will look
like
this:
</p>
<source>
<![CDATA[
<map:generator name="xmldbcollection"
src="org.apache.cocoon.generation.XMLDBGenerator" label="content">
<driver>org.dbxml.client.xmldb.DatabaseImpl</driver>
<base>xmldb:dbxml:///db/</base>
</map:generator>
]]>
</source>
<p>
Note that the content of the "base" tag will be prepended to the
requested resource. It's important to keep a trailing slash at the
end of the <code>base</code> tag.
</p>
</s1>
</body>
</document>
1.54 +6 -47 xml-cocoon2/webapp/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-cocoon2/webapp/sitemap.xmap,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- sitemap.xmap 2001/09/24 06:27:12 1.53
+++ sitemap.xmap 2001/10/05 07:15:20 1.54
@@ -240,34 +240,16 @@
</map:pipeline>
<!-- C2 documentation pipeline -->
- <map:pipeline internal-only="true">
- <map:match pattern="shared/sidebar">
- <map:generate src="docs/xdocs/internal/site-book.xml"/>
- <map:transform src="stylesheets/documents/book2sidebar.xsl"/>
- <map:serialize/>
- </map:match>
-
- <map:match pattern="document/*.html">
- <map:generate src="docs/xdocs/{1}.xml"/>
- <map:act type="resource-exists">
- <map:parameter name="url"
value="context://stylesheets/documents/{1}2document.xsl"/>
- <map:transform src="stylesheets/documents/{../1}2document.xsl"/>
- </map:act>
- <map:serialize/>
+ <map:pipeline>
+ <map:match pattern="documents/index">
+ <map:redirect-to uri="index.html"/>
</map:match>
-
- <map:match pattern="document/*">
- <map:generate src="docs/xdocs/{1}.xml"/>
- <map:act type="resource-exists">
- <map:parameter name="url"
value="context://stylesheets/documents/{1}2document.xsl"/>
- <map:transform src="stylesheets/documents/{../1}2document.xsl"/>
- </map:act>
- <map:serialize/>
+ <map:match pattern="documents/**">
+ <map:mount uri-prefix="documents" src="documentation/"
check-reload="yes"/>
</map:match>
</map:pipeline>
- <map:pipeline>
-
+ <map:pipeline>
<map:match pattern="">
<map:redirect-to uri="welcome"/>
</map:match>
@@ -420,29 +402,6 @@
<map:generate src="docs/samples/catalog/test.xml"/>
<map:transform src="docs/samples/catalog/style.xsl"/>
<map:serialize type="html"/>
- </map:match>
-
- <!-- ======================== C2 Docs ============================== -->
-
- <map:match pattern="documents/*">
- <map:aggregate element="root">
- <map:part src="cocoon:/shared/sidebar"/>
- <map:part src="cocoon:/document/{1}"/>
- </map:aggregate>
- <map:transform src="stylesheets/documents/root2html.xsl"/>
- <map:serialize/>
- </map:match>
-
- <map:match pattern="documents/images/**.gif">
- <map:read src="docs/xdocs/images/{1}.gif" mime-type="image/gif"/>
- </map:match>
-
- <map:match pattern="documents/images/**.jpg">
- <map:read src="docs/xdocs/images/{1}.jpg" mime-type="image/jpg"/>
- </map:match>
-
- <map:match pattern="documents/images/**.png">
- <map:read src="docs/xdocs/images/{1}.png" mime-type="image/png"/>
</map:match>
<!-- ================ Static =========================== -->
1.7 +132 -81 xml-cocoon2/webapp.site/sitemap.xmap
Index: sitemap.xmap
===================================================================
RCS file: /home/cvs/xml-cocoon2/webapp.site/sitemap.xmap,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- sitemap.xmap 2001/09/06 14:19:46 1.6
+++ sitemap.xmap 2001/10/05 07:15:20 1.7
@@ -2,79 +2,6 @@
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
-<!-- =========================== Pipelines =================================
-->
-<map:pipelines>
-<map:pipeline>
-
-<map:match pattern="">
- <map:redirect-to uri="index"/>
-</map:match>
-
-<map:match pattern="*">
- <map:aggregate element="root">
- <map:part src="cocoon:/shared/sidebar"/>
- <map:part src="cocoon:/document/{1}"/>
- </map:aggregate>
-
- <map:transform src="style/root2html.xsl">
- <map:parameter name="path" value="{1}"/>
- </map:transform>
- <map:serialize/>
-</map:match>
-
-<map:match pattern="shared/sidebar">
- <map:generate src="content/site-book.xml"/>
- <map:transform src="style/book2sidebar.xsl"/>
- <map:serialize/>
-</map:match>
-
-<map:match pattern="document/*.html">
- <map:generate src="content/xdocs/{1}.xml"/>
- <map:act type="resource-exists">
- <map:parameter name="url" value="context://style/{1}2document.xsl"/>
- <map:transform src="style/{../1}2document.xsl"/>
- </map:act>
- <map:serialize/>
-</map:match>
-
-<map:match pattern="document/*">
- <map:generate src="content/xdocs/{1}.xml"/>
- <map:act type="resource-exists">
- <map:parameter name="url" value="context://style/{1}2document.xsl"/>
- <map:transform src="style/{../1}2document.xsl"/>
- </map:act>
- <map:serialize/>
-</map:match>
-
-<map:match pattern="images/*.gif">
- <map:read src="resources/images/{1}.gif" mime-type="image/gif"/>
-</map:match>
-
-<map:match pattern="images/*.jpg">
- <map:read src="resources/images/{1}.jpg" mime-type="image/jpeg"/>
-</map:match>
-
-<map:match pattern="images/*.png">
- <map:read src="resources/images/{1}.png" mime-type="image/png"/>
-</map:match>
-
-<!-- Javadocs -->
-<map:match pattern="apidocs/**.html">
- <map:read src="content/javadocs/{1}.html" mime-type="text/html"/>
-</map:match>
-
-<map:match pattern="apidocs/**.css">
- <map:read src="content/javadocs/{1}.css" mime-type="text/css"/>
-</map:match>
-
-
-<map:handle-errors>
- <map:transform src="style/system/error2html.xsl"/>
- <map:serialize status-code="500"/>
-</map:handle-errors>
-
-</map:pipeline>
-</map:pipelines>
<!-- =========================== Components ================================
-->
<map:components>
@@ -95,26 +22,150 @@
</map:readers>
<map:serializers default="html">
+ <map:serializer name="html" mime-type="text/html"
src="org.apache.cocoon.serialization.HTMLSerializer">
+ <encoding>iso8859-1</encoding>
+ </map:serializer>
<map:serializer name="xml" mime-type="text/xml"
src="org.apache.cocoon.serialization.XMLSerializer"/>
- <map:serializer name="html" mime-type="text/html"
src="org.apache.cocoon.serialization.HTMLSerializer"/>
+ <map:serializer name="links"
src="org.apache.cocoon.serialization.LinkSerializer"/>
+ <map:serializer name="svg2jpeg" mime-type="image/jpeg"
src="org.apache.cocoon.serialization.SVGSerializer"/>
+ <map:serializer name="svg2png" mime-type="image/png"
src="org.apache.cocoon.serialization.SVGSerializer"/>
</map:serializers>
<map:matchers default="wildcard">
<map:matcher name="wildcard"
src="org.apache.cocoon.matching.WildcardURIMatcherFactory"/>
</map:matchers>
-
- <map:actions>
- <map:action name="resource-exists"
src="org.apache.cocoon.acting.ResourceExistsAction"/>
- </map:actions>
-
</map:components>
<!-- =========================== Views ===================================
-->
-<!-- =========================== Resources =================================
-->
+ <map:views>
+ <map:view name="content" from-label="content">
+ <map:serialize type="xml"/>
+ </map:view>
+
+ <map:view name="links" from-position="last">
+ <map:transform src="stylesheets/filterlinks.xsl"/>
+ <map:serialize type="links"/>
+ </map:view>
-<!-- ========================== Action sets ================================
-->
+ </map:views>
+<!-- =========================== Pipelines =================================
-->
+
+ <map:pipelines>
+ <map:pipeline>
+ <map:match pattern="">
+ <map:redirect-to uri="index.html"/>
+ </map:match>
+
+ <map:match pattern="**book.xml">
+ <map:generate src="xdocs/{1}book.xml"/>
+ <map:transform src="stylesheets/book2menu.xsl"/>
+ <map:serialize type="xml"/>
+ </map:match>
+
+ <map:match pattern="body-todo.xml">
+ <map:generate src="xdocs/todo.xml"/>
+ <map:transform src="stylesheets/todo2document.xsl"/>
+ <map:transform src="stylesheets/document2html.xsl"/>
+ <map:serialize/>
+ </map:match>
+
+ <map:match pattern="body-changes.xml">
+ <map:generate src="xdocs/changes.xml"/>
+ <map:transform src="stylesheets/changes2document.xsl"/>
+ <map:transform src="stylesheets/document2html.xsl"/>
+ <map:serialize/>
+ </map:match>
+
+ <map:match pattern="body-faq.xml">
+ <map:generate src="xdocs/faq.xml"/>
+ <map:transform src="stylesheets/faq2document.xsl"/>
+ <map:transform src="stylesheets/document2html.xsl"/>
+ <map:serialize/>
+ </map:match>
+
+ <map:match pattern="body-**.xml">
+ <map:generate src="xdocs/{1}.xml"/>
+ <map:transform src="stylesheets/document2html.xsl"/>
+ <map:serialize/>
+ </map:match>
+
+ <map:match pattern="*.html">
+ <map:aggregate element="site">
+ <map:part src="cocoon:/book.xml"/>
+ <map:part src="cocoon:/body-{1}.xml"/>
+ </map:aggregate>
+ <map:transform src="stylesheets/site2xhtml.xsl">
+ <map:parameter name="use-request-parameters" value="true"/>
+ <map:parameter name="header" value="graphics/{1}-header.jpg"/>
+ </map:transform>
+ <map:serialize/>
+ </map:match>
+
+ <map:match pattern="**/*.html">
+ <map:aggregate element="site">
+ <map:part src="cocoon:/{1}/book.xml"/>
+ <map:part src="cocoon:/body-{1}/{2}.xml"/>
+ </map:aggregate>
+ <map:transform src="stylesheets/site2xhtml.xsl">
+ <map:parameter name="use-request-parameters" value="true"/>
+ <map:parameter name="header" value="{1}/graphics/{2}-header.jpg"/>
+ </map:transform>
+ <map:serialize/>
+ </map:match>
+
+ <!-- ================ Static =========================== -->
+ <map:match pattern="**.txt">
+ <map:read src="xdocs/{1}.txt" mime-type="text"/>
+ </map:match>
+
+ <map:match pattern="**.css">
+ <map:read src="{1}.css" mime-type="text"/>
+ </map:match>
+
+ <map:match pattern="**images/*.png">
+ <map:read src="images/{2}.png" mime-type="image/png"/>
+ </map:match>
+
+ <map:match pattern="**images/*.jpg">
+ <map:read src="images/{2}.jpg" mime-type="image/jpeg"/>
+ </map:match>
+
+ <map:match pattern="**images/*.gif">
+ <map:read src="images/{2}.gif" mime-type="image/gif"/>
+ </map:match>
+
+ <map:match pattern="**graphics/**-separator.jpg">
+ <map:generate src="svg/separator.xml"/>
+ <map:transform src="svg/addlabel.xsl">
+ <map:parameter name="use-request-parameters" value="true"/>
+ <map:parameter name="label" value="{2}"/>
+ </map:transform>
+ <map:serialize type="svg2jpeg"/>
+ </map:match>
+
+ <map:match pattern="**graphics/**-label.jpg">
+ <map:generate src="svg/label.xml"/>
+ <map:transform src="svg/addlabel.xsl">
+ <map:parameter name="use-request-parameters" value="true"/>
+ <map:parameter name="label" value="{2}"/>
+ </map:transform>
+ <map:serialize type="svg2jpeg"/>
+ </map:match>
+
+ <map:match pattern="**graphics/**-header.jpg">
+ <map:generate src="svg/header.xml"/>
+ <map:transform src="svg/addlabel.xsl">
+ <map:parameter name="use-request-parameters" value="true"/>
+ </map:transform>
+ <map:serialize type="svg2jpeg"/>
+ </map:match>
+
+ </map:pipeline>
+ </map:pipelines>
+
</map:sitemap>
<!-- end of file -->
+
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]