dims 01/06/01 11:58:42 Modified: xdocs uc2.xml Log: Patch for "Understanding Cocoon2 Presentation" from Ovidiu Peridescu ([EMAIL PROTECTED]) Revision Changes Path 1.2 +79 -52 xml-cocoon2/xdocs/uc2.xml Index: uc2.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/xdocs/uc2.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- uc2.xml 2001/06/01 15:49:19 1.1 +++ uc2.xml 2001/06/01 18:58:38 1.2 @@ -96,7 +96,7 @@ <ul> <li>A separate codebase to incorporate Cocoon1 learnings.</li> <li>Designed for execution speed/memory efficiency and scalability to process very large documents by switching processing model from DOM to SAX.</li> - <li>Centralizes the management functions by allowing processing pipeline specification in a sitemap ( an XML file ), replacing the embedded processing instruction model.</li> + <li>Centralizes the management functions by allowing processing pipeline specification in a sitemap (an XML file), replacing the embedded processing instruction model.</li> <li>Better support for pre-compilation, pre-generation and caching for better performance.</li> </ul> </s2> @@ -104,7 +104,7 @@ <anchor id="what-problems"/> <s1 title="What problem does Cocoon2 solve?"> <p>Basic problem to be solved:</p> - <s2 title="Separation of content, style, logic and management functions in an XML content based web site ( and web services )."> + <s2 title="Separation of content, style, logic and management functions in an XML content based web site (and web services)."> <figure src="images/pyramid-model.gif" alt="The @Name@ Pyramid Model of Contracts"/> </s2> <s2 title="Data Mapping"> @@ -116,8 +116,8 @@ <p>Basic mechanisms for processing XML documents:</p> <ul> <li>Dispatching based on Matchers.</li> - <li>Generation of XML documents ( from content, logic, Relation DB, objects or any combination ) through Generators</li> - <li>Transformation (to another XML, objects or any combination ) of XML documents through Transformers</li> + <li>Generation of XML documents (from content, logic, Relation DB, objects or any combination) through Generators</li> + <li>Transformation (to another XML, objects or any combination) of XML documents through Transformers</li> <li>Aggregation of XML documents through Aggregators</li> <li>Rendering XML through Serializers</li> </ul> @@ -167,7 +167,7 @@ </s1> <anchor id="c2-abstractions"/> <s1 title="Abstraction."> - <s2 title="eXtensible Server Pages ( XSPs )"> + <s2 title="eXtensible Server Pages (XSPs)"> <p>An XSP page is an XML page with following requirements:</p> <ul> <li>The document root must be <code><xsp:page></code></li> @@ -178,15 +178,14 @@ <source><![CDATA[ <?xml version="1.0" encoding="ISO-8859-1"?> -<xsp:page language="java" - xmlns:xsp="http://apache.org/xsp"> +<xsp:page language="java" xmlns:xsp="http://apache.org/xsp"> <xsp:logic> static private int counter = 0; private synchronized int count() - { + { return counter++; - } + } </xsp:logic> <page> @@ -198,7 +197,7 @@ <p>An XSP page is used by a generator to generate XML document.</p> </s2> - <s2 title="XSP Processing ( Code Generation )"> + <s2 title="XSP Processing (Code Generation)"> <source><![CDATA[ package org.apache.cocoon.www.docs.samples.xsp; @@ -218,7 +217,7 @@ AttributesImpl xspAttr = new AttributesImpl(); this.contentHandler.startPrefixMapping("xsp", "http://apache.org/xsp"); this.contentHandler.startElement("", "page", "page", xspAttr); - // Statements to build the XML document ( Omitted ) + // Statements to build the XML document (Omitted) this.contentHandler.endElement("", "page", "page"); this.contentHandler.endPrefixMapping("xsp"); this.contentHandler.endDocument(); @@ -236,7 +235,7 @@ </s3> <s3 title="Included Logicsheet"> <ul> - <li>Code is in a separate logicsheet ( an XSL file)</li> + <li>Code is in a separate logicsheet (an XSL file)</li> <li>Effective separation of content and logic</li> <li>Preferred way to create XSPs</li> </ul> @@ -301,10 +300,10 @@ <p>Matchers help in specifying a specific pipeline processing for a group of URIs.</p> <p>Sitemap entries for different types of matchers</p> <source><![CDATA[ - <map:matchers default="wildcard"> - <map:matcher name="wildcard" factory="org.apache.cocoon.matching.WildcardURIMatcherFactory"/> - <map:matcher name="regexp" factory="org.apache.cocoon.matching.RegexpURIMatcherFactory"/> - </map:matchers> +<map:matchers default="wildcard"> + <map:matcher name="wildcard" factory="org.apache.cocoon.matching.WildcardURIMatcherFactory"/> + <map:matcher name="regexp" factory="org.apache.cocoon.matching.RegexpURIMatcherFactory"/> +</map:matchers> ]]></source> <p>Pipeline entries in sitemap file</p> <source><![CDATA[ @@ -317,7 +316,7 @@ ]]></source> </s2> <s2 title="Generators"> - <p>A Generator is used to create an XML structure from an input source ( file, directory, stream ...)</p> + <p>A Generator is used to create an XML structure from an input source (file, directory, stream ...)</p> <figure src="images/xsp-way3.gif" alt="ways of creating xsp's"/> <p>Different types of generators:</p> <ul> @@ -332,11 +331,18 @@ <p>Sitemap entries for different types of generators</p> <source><![CDATA[ <map:generators default="file"> - <map:generator name="file" src="org.apache.cocoon.generation.FileGenerator" label="content"/> - <map:generator name="directory" src="org.apache.cocoon.generation.DirectoryGenerator" label="content"/> - <map:generator name="serverpages" src="org.apache.cocoon.generation.ServerPagesGenerator" label="content"/> - <map:generator name="request" src="org.apache.cocoon.generation.RequestGenerator"/> -... + <map:generator name="file" + src="org.apache.cocoon.generation.FileGenerator" + label="content"/> + <map:generator name="directory" + src="org.apache.cocoon.generation.DirectoryGenerator" + label="content"/> + <map:generator name="serverpages" + src="org.apache.cocoon.generation.ServerPagesGenerator" + label="content"/> + <map:generator name="request" + src="org.apache.cocoon.generation.RequestGenerator"/> + ... </map:generators> ]]></source> <p>A sample generator entries in a pipeline</p> @@ -367,27 +373,27 @@ <p>Sitemap entries for different types of transformers</p> <source><![CDATA[ <map:transformers default="xslt"> - <map:transformer name="xslt" src="org.apache.cocoon.transformation.TraxTransformer"> + <map:transformer name="xslt" src="org.apache.cocoon.transformation.TraxTransformer"> <use-store map:value="true"/> <use-request-parameters map:value="false"/> <use-browser-capabilities-db map:value="false"/> </map:transformer> - <map:transformer name="log" src="org.apache.cocoon.transformation.LogTransformer"/> + <map:transformer name="log" src="org.apache.cocoon.transformation.LogTransformer"/> ... </map:transformers> ]]></source> <p>A sample transformer entry in a pipeline</p> <source><![CDATA[ - <map:match pattern="hello.html"> - <map:generate src="docs/samples/hello-page.xml"/> - <map:transform src="stylesheets/page/simple-page2html.xsl"/> - <map:serialize type="html"/> - </map:match> +<map:match pattern="hello.html"> + <map:generate src="docs/samples/hello-page.xml"/> + <map:transform src="stylesheets/page/simple-page2html.xsl"/> + <map:serialize type="html"/> +</map:match> ]]></source> </s2> <s2 title="Serializers"> - <p>A Serializer is used to render an input XML structure into some other format ( not necessarily XML )</p> + <p>A Serializer is used to render an input XML structure into some other format (not necessarily XML)</p> <p>Different types of serializers:</p> <ul> <li>HTML Serializer</li> @@ -400,11 +406,19 @@ <p>Sitemap entries for different types of serializers</p> <source><![CDATA[ <map:serializers default="html"> - <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="fo2pdf" mime-type="application/pdf" src="org.apache.cocoon.serialization.FOPSerializer"/> - <map:serializer name="vrml" mime-type="model/vrml" src="org.apache.cocoon.serialization.TextSerializer"/> - ... + <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="fo2pdf" + mime-type="application/pdf" + src="org.apache.cocoon.serialization.FOPSerializer"/> + <map:serializer name="vrml" + mime-type="model/vrml" + src="org.apache.cocoon.serialization.TextSerializer"/> + ... </map:serializers> ]]></source> <p>A sample serializer entry in a pipeline</p> @@ -418,13 +432,13 @@ </s2> <s2 title="Pipeline Processing"> <p>The sitemap configuration allows dynamic setup of processing pipelines consisting of a generator, multiple transformers and a serializer.</p> - <p>Requests are dispatched to a pipeline based on request URI and the pipeline matching pattern ( either with wildcards or as a regexp )</p> - <p>The pipeline is setup in the generated file sitemap_xmap.java ( This file gets generated [ possibly asynchronously] everytime the sitemap.xmap is modified.</p> + <p>Requests are dispatched to a pipeline based on request URI and the pipeline matching pattern (either with wildcards or as a regexp)</p> + <p>The pipeline is setup in the generated file sitemap_xmap.java (This file gets generated [possibly asynchronously] everytime the sitemap.xmap is modified.</p> <figure src="images/pipeline2.gif" alt="Pipeline Entry"/> </s2> <s2 title="Logicsheets"> <p>Logicsheets are XSL files with an associated namespace.</p> - <p>Primary mechanism to add program logic ( code ) to XSPs.</p> + <p>Primary mechanism to add program logic (code) to XSPs.</p> <p>These need to be registered in configuration file cocoon.xconf.</p> <p>Logicsheets are used by the generator to transform XML structure before generating program.</p> <p>Cocoon comes with a no. of built-in logic sheets:</p> @@ -439,7 +453,11 @@ </ul> <p>Log.xsl structure</p> <source><![CDATA[ -<xsl:stylesheet version="1.0" xmlns:xsp="http://apache.org/xsp" xmlns:log="http://apache.org/xsp/log" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> +<xsl:stylesheet version="1.0" + xmlns:xsp="http://apache.org/xsp" + xmlns:log="http://apache.org/xsp/log" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:template match="log:logger"> ... variable and xsp:logic statements ... </xsl:template> @@ -458,8 +476,8 @@ <p>A sample use</p> <source><![CDATA[ <xsp:page language="java" - xmlns:xsp="http://apache.org/xsp" - xmlns:log="http://apache.org/xsp/log"> + xmlns:xsp="http://apache.org/xsp" + xmlns:log="http://apache.org/xsp/log"> <page> <log:logger name="test" filename="test.log"/> @@ -471,11 +489,11 @@ </s1> <anchor id="cocoon-configuration"/> <s1 title="@Name@ Configuration."> - <p>Cocoon is highly configurable. Main configuration files, assuming Cocoon deployment as a servlet in a servlet container, are ( directory locations assume Tomcat servlet container and Windows NT ):</p> + <p>Cocoon is highly configurable. Main configuration files, assuming Cocoon deployment as a servlet in a servlet container, are (directory locations assume Tomcat servlet container):</p> <ul> - <li>sitemap.xmap: the sitemap file. By default, located in %TOMCAT_HOME%\webapps\cocoon directory.</li> - <li>cocoon.xconf: configuration file having logicsheet registrations. Specifies, sitemap.xmap location and other such parameters. By default, located in %TOMCAT_HOME%\webapps\cocoon directory.</li> - <li>web.xml: servlet deployment descriptor. Specifies location of cocoon.xconf, log file location and other such parameters. Located in %TOMCAT_HOME%\webapps\cocoon\Web-inf directory.</li> + <li>sitemap.xmap: the sitemap file. By default, located in <code>%TOMCAT_HOME%/webapps/cocoon</code> directory.</li> + <li>cocoon.xconf: configuration file having logicsheet registrations. Specifies, sitemap.xmap location and other such parameters. By default, located in <code>%TOMCAT_HOME%/webapps/cocoon</code> directory.</li> + <li>web.xml: servlet deployment descriptor. Specifies location of cocoon.xconf, log file location and other such parameters. Located in <code>%TOMCAT_HOME%/webapps/cocoon/WEB-INF</code> directory.</li> <li>cocoon.roles: mapping file for Core Cocoon components name and implementation classes. For example, if you want to use a parser other than the default one, you need to modify this file.</li> </ul> </s1> @@ -483,16 +501,25 @@ <s1 title="@Name@ Work Area"> <p>Cocoon produces execution log entries for debugging/auditing.</p> <ul> - <li>The amount of data to be logged can be controlled by log-level parameter in web.xml file. The default is DEBUG ( maximum data ).</li> - <li>By default, the log file is: %TOMCAT_HOME%\webapps\cocoon\Web-inf\logs\cocoon.log.</li> + <li>The amount of data to be logged can be controlled by + log-level parameter in web.xml file. The default is DEBUG + (maximum data).</li> + <li>By default, the log file is: + <code>%TOMCAT_HOME%/webapps/cocoon/Web-inf/logs/cocoon.log</code>.</li> </ul> - <p>Cocoon keeps the generated .java files in a directory tree starting at ( by default ): %TOMCAT_HOME%\webapps\work\localhost_8080%2Fcocoon\org\apache\cocoon\www. You can find sitemap_xmap.java here.</p> - <p>Files created by LogTransformer are kept ( by default ) in %TOMCAT_HOME% directory.</p> + + <p>Cocoon keeps the generated .java files in a directory tree + starting at (by default):</p> + <code>%TOMCAT_HOME%/webapps/work/localhost_8080%2Fcocoon/org/apache/cocoon/www</code>. + +<p>You can find sitemap_xmap.java here.</p> + + <p>Files created by LogTransformer are kept (by default) in <code>%TOMCAT_HOME%</code> directory.</p> </s1> <anchor id="use-with-tomcat"/> <s1 title="Use with Tomcat"> <p>Download Tomcat from Apache site.</p> - <p>Download Cocoon sources from Apache CVS ( binaries not available for Cocoon2 yet ). Would require socksified CVS client for connection setup. [ Command assume UNIX shell prompt ]</p> + <p>Download Cocoon sources from Apache CVS (binaries not available for Cocoon2 yet). [Command assume UNIX Bourne shell]</p> <source><![CDATA[ export CVSROOT=:pserver:[EMAIL PROTECTED]:/home/cvspublic cvs login @@ -500,8 +527,8 @@ cvs checkout xml-cocoon2 ]]></source> <p>Build sources as per instruction in Install file.</p> - <p>Move the cocoon.war file to %TOMCAT_HOME%\webapps directory.</p> - <p>Start the servlet engine. Type-in the URL http://localhost:8080/cocoon in your browser. You should see the Cocoon welcome message.</p> + <p>Move the cocoon.war file to <code>%TOMCAT_HOME%/webapps</code> directory.</p> + <p>Start the servlet engine. Type-in the URL <code>http://localhost:8080/cocoon</code> in your browser. You should see the Cocoon welcome message.</p> <p>Consult Install file if you face problems.</p> </s1> </body> ---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]