cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Re: [update] TreeProcessor now available
Date Wed, 16 Jan 2002 16:54:29 GMT
Stefano Mazzocchi wrote:

> Sylvain Wallez wrote:
> 
>>Sylvain Wallez wrote:
>>
>>>Hi team,
>>>
>>>I finally finished the interpreted implementation of the sitemap engine.
>>>
> 
> way cool.

Thanks :)


> How do we try it out?


The <sitemap> entry in cocoon.xconf is a regular component. Just replace 
it by the following :

<sitemap class="org.apache.cocoon.treeprocessor.TreeProcessor"
          logger="sitemap"/>


> 
>>Forgot to say in the previous post...
>>
>>The latest commit includes a major rewrite of component management which
>>allowed a lot of code cleanup.
>>
>>As a side benefit, these changes allow the <map:components> section to
>>be given "as is" to a ComponentManager.configure().
>>
>>Practically, this means :
>>- we can use hints to name components instead of their class name (I
>>defined a few in treeprocessor.xconf),
>>
> 
> cool
> 
> 
>>- we can also add arbitrary components such as datasources that are
>>local to a sitemap.
>>
>>For example, the following is allowed :
>>
>><map:components>
>>
>>   <map:matchers default="wildcard"/>
>>     <wildcard-uri-matcher name="wildcard"/>
>>     <regexp-uri-matcher name="regexp"/>
>>     <map:matcher src="my.nice.Matcher"/>
>>   <map:matchers>
>>
>>   <component role="my.nice.Component"
>>              class="my.nice.ComponentImpl"/>
>>
>></map:components>
>>
>>I know the above isn't backward compatible with the current compiled
>>engine, but don't you think such features can be useful ?
>>
> 
> Sorry but I don't get the picture from the example, can you elaborate
> more on this?
> 


Look at the "roles" section in treeprocessor.xconf in 
org.apache.cocoon.treeprocessor (in scratchpad) : it defines a 
RoleManager for a ComponentManager, which is configured with the 
contents of <map:components>.

There are hints defined in this file for some commonly used components. 
With these hints, you can write
   <wildcard-uri-matcher name="wildcard"/>
instead of
   <map:matcher name="wildcard"
      src="org.apache.cocoon.matching.WildcardURIMatcher"/>

This allows to hide class names for Cocoon builtin sitemap components, 
thus increasing readability of the sitemap.

And since <map:components> is a Configuration for an 
ExcaliburComponentManager, you can use all its features, including 
declaration of components not explicitly defined by a role. This is what 
  <component role...> is for.

Hope it's more clear now.

Sylvain


-- 
Sylvain Wallez
Anyware Technologies - http://www.anyware-tech.com


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


Mime
View raw message