SAXESS - Hussayn Dabbous wrote:

thank you for the very deep insight to several points here;
i take this all very serious and will keep it in mind. especially
because i consider my self beeing in the middle of step 3 (see below)
now and still have lots to learn about cocoon.

I'm still considering myself a beginner, so no conflict here.

the proposal is not a proposal for a beginners tutorial. It is a
proposal for a beginners documentation set, that should allow a newbie
to start digging into cocoon up to step 3 (i assume) of your
list...

I wonder, how much would be made clearer by keeping the introductory text on Cocoon (the somewhat philosophical overview) much the same and having a skeleton Cocoon installation?

For example, a sitemap with a bare minimum of components and just one pipeline and two matchers. See my example at the bottom.

Concerning the significance of avalon in XSP programming: i simply
never touched XSP in cocoon-2 until today (although i am quite
familiar with the concepts as i learned from cocoon-1 about two years ago, but it changed alot...). Hopefully XSP will be my next step
towards mastering cocoon-2. I thought from the ongoing discussion,
that the underlaying technology wouldn't be soo evident as you state.
as i said before i take you very serious and once i get to the
point i will remember your very valuable insight to the theme.

In Cocoon 1, I could see that. In Cocoon 2, I think you would be hard-pressed to avoid XSP for longer than a week if you were seriously trying to solve a problem by using Cocoon.


* Beginner sitemap example *

Is this the type of thing that people are talking about? I skipped most of the components. Also, I completely ommitted actions, views, and selectors. What other things would you want display to the absolute beginner? The following sitemap expects the following extra files:

index.html
dynamic1.xsp
dynamic2.xsp
request2html.xsl
xspoutput2html.xsl

where the XSP files would have a simple example like "hello world" and/or "The current time is..." and the index.html file is just a page of links to the other resources with a brief writeup.

- Miles



<?xml version="1.0" encoding="UTF-8"?>
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0";>

<!-- =========================== Components ================================ -->

<!-- This is where you define the components you want to use -->
<!-- You define the actual working pipelines at the bottom of the sitemap -->

<map:components>

<map:generators default="file">
<map:generator name="file" label="content,data" logger="sitemap.generator.file" pool-grow="4" pool-max="32" pool-min="8" src="org.apache.cocoon.generation.FileGenerator"/>
<map:generator name="serverpages" label="content,data" logger="sitemap.generator.serverpages" pool-grow="2" pool-max="32" pool-min="4" src="org.apache.cocoon.generation.ServerPagesGenerator"/>
</map:generators>

<map:transformers default="xslt">
<map:transformer name="xslt" logger="sitemap.transformer.xsltc" pool-grow="2" pool-max="32" pool-min="8" src="org.apache.cocoon.transformation.TraxTransformer">
<use-request-parameters>false</use-request-parameters>
<use-browser-capabilities-db>false</use-browser-capabilities-db>
<transformer-factory>org.apache.xalan.xsltc.trax.TransformerFactoryImpl</transformer-factory>
</map:transformer>
</map:tranformers>

<map:readers default="resource">
<map:reader name="resource" logger="sitemap.reader.resource" pool-max="32" src="org.apache.cocoon.reading.ResourceReader"/>
</map:readers>

<map:serializers default="xml">
<map:serializer name="xml" logger="sitemap.serializer.xml" mime-type="text/xml" src="org.apache.cocoon.serialization.XMLSerializer"/>
<map:serializer name="html" logger="sitemap.serializer.html" mime-type="text/html" pool-grow="4" pool-max="32" pool-min="4" src="org.apache.cocoon.serialization.HTMLSerializer">
<buffer-size>1024</buffer-size>
</map:serializer>
</map:serializers>

<map:matchers default="wildcard">
<map:matcher name="wildcard" logger="sitemap.matcher.wildcard" src="org.apache.cocoon.matching.WildcardURIMatcher"/>
</map:matchers>

<map:pipes default="caching">
<map:pipe name="caching" src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline"/>
</map:pipes>

</map:components>

<!-- =========================== Pipelines ================================ -->
<map:pipelines>

<map:pipeline>

<!-- The default page. Note: Unless you explicitly declare a matcher for "index.html",
you can only access it as "http://localhost:8080/"; and not "http://localhost:8080/index.html"; -->
<map:match pattern="">
<map:read src="index.html"/>
</map:match>

<!-- Returns the browser request information as XML -->
<map:match pattern="request.xml">
<map:generate type="request"/>
<map:serialize type="xml"/>
</map:match>

<!-- Uses the previous matcher to generate an HTML version of the browser request -->
<map:match pattern="request.html">
<map:generate src="cocoon:/request.xml"/>
<map:transform src="request2html.xsl"/>
<map:serialize type="html"/>
</map:match>

<!-- Read in the content from the referenced XSP file -->
<map:match pattern="dynamic*.xml">
<map:generate type="serverpages" src="dynamic{1}.xsp"/>
<map:serialize type="xml"/>
</map:match>

<!-- Uses the previous matcher to generate an HTML version of the XSP output -->
<map:match pattern="*.html">
<map:generate src="cocoon:/{1}.xml"/>
<map:transform src="xspoutput2html.xsl"/>
<map:serialize type="html"/>
</map:match>

</map:pipeline>

</map:pipelines>
</map:sitemap>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to