cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vadim.gritse...@verizon.net>
Subject RE: [SITEMAP] Component declaration
Date Sat, 27 Apr 2002 17:00:23 GMT
> From: Konstantin Piroumian [mailto:kpiroumian@apache.org]
> 
> Hi, Cocooners!
> 
> A simple question: why in a sub sitemap we need to add <map:components
/> if
> we add anything to the list?

>From the sub sitemap:
  <map:generators default="file"/>

>From the sitemap.xsl:
      <xsl:with-param name="default-component"
select="/map:sitemap/map:components/map:generators/@default"/>


If you know better way how in XSLT get default component, you could
modify compiled sitemap engine so it does not requires <map:components
/> section.

Interpreted engine (IMHO) already should work without this section.
Evidence of this found in DefaultTreeBuilder:

if (type == null && selector instanceof ExtendedComponentSelector) {
    type = ((ExtendedComponentSelector)selector).getDefaultHint();
}

And because this engine going to be default in 2.1 series, I'm Ok just
to wait a bit, so issue will dissolve by itself as people move to
interpreted engine.

(Also I'm still not convinced that interpreted engine is faster then
compiled one ;)


> Isn't it possible to inherit components implicitly?

They are inherited. But you want to know the default.


> I ask this, because in response to multiple user requests for having
> something simple to start with in Cocoon and also for my colleagues
I'd like
> to create a very simple application template that can be easily used
for
> playing with Cocoon.
> 
> Sample's directory is this:
> /root  <-- suggest a better name for the root

"myapp"?


>     /xml
>     /xsl
>     /xsp
> 
> Without that declaration a Cocoon Newbie's sub-sitemap can look like
below
> (mounted to samples/):
> 
> <?xml version="1.0"?>
> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">

<map:components>
  <map:generators default="file"/>
  <map:transformers default="xslt"/>
  <map:readers default="resource"/>
  <map:serializers default="html"/>
  <map:selectors default="browser"/>
  <map:matchers default="wildcard"/>
 </map:components>

It's not *that* much more complex :)

 
>     <!-- Processing pipelines -->
>     <map:pipelines>
>         <map:pipeline>
> 
>             <!-- Process static content -->
>             <map:match pattern="*.xml">
>                 <map:generate src="xml/{1}.xml" />
>                 <map:transform src="xsl/style.xsl" />
>                 <map:serialize />
>             </map:match>
> 
>             <!-- Process dynamic content -->
>             <map:match pattern="*.xsp">
>                 <map:generate type="serverpages" src="xsp/{1}.xsp" />
>                 <map:transform src="xsl/style.xsl" />
>                 <map:serialize />
>             </map:match>
> 
>         </map:pipeline>
>     </map:pipelines>
> </map:sitemap>
> <!-- end of file -->
> 
> And the instructions would be like this:
>     - create an XML file, then place it in /xml directory
>     - create a stylesheet, then place it in /xsl directory
>     [- create an XSP page, place it into /xsp directory]
> 
> Enter the URL of your page:
> http://localhost:8080/cocoon/samples/root/page.xml
> 
> Quite easy and simple.
> 
> So, my questions are:
>     - how to remove <map:componenets />

See above.


>     - what is the best place for such a template/sample

samples directory?


>     - is it worth making a special target for building a minimal
Cocoon
> containing a very minimal set of features?

May be better documenting the process will help. It boils down to just
couple of steps:
1. build clean
2. rm all optional libs
3. build -D....

Vadim


> Regards,
>   Konstantin Piroumian
> _________________________________________
> Konstantin Piroumian
> Lead Developer
> ICQ#: 2297575
> ( Work Tel#:  +7 095 795 0520 * 1288
> + More ways to contact me
> i See more about me
> _________________________________________


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message