cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <>
Subject Re: [C2]: Avalon Component Configuration
Date Tue, 10 Apr 2001 09:23:06 GMT
Quoting Carsten Ziegeler <>:

> Hi,
> I am trying to add new avalon components to the 
> cocoon.xconf (yes, for caching of course....) and am
> now a little bit confused about the format.
> E.g. the parser has the following entries:
>   <parser class="org.apache.cocoon.components.parser.JaxpParser"/>
>  <role name="org.apache.cocoon.components.parser.Parser"
>        shorthand="parser"
>        default-class="org.apache.cocoon.components.parser.JaxpParser"/>
> Is the first one obsolete? I thought the second declaration adds
> a component with the role name "parser".

I'm not sure if the definition of the role is sufficent to define the component 
without the absolute minimum component definition (which in this case would be 
<parser/>). Berin, have you any comments on this handy?

> For the URL Factory I found:
>   <url-factory>
>     <protocol name="resource"
> class="org.apache.cocoon.components.url.ResourceURLFactory"/>
>     <protocol name="context" 
> class="org.apache.cocoon.components.url.ContextURLFactory"/>
>   </url-factory>
>  <role name="org.apache.cocoon.components.url.URLFactory"
>        shorthand="url-factory"
>        default-class="org.apache.cocoon.components.url.URLFactoryImpl"/>
> Is the second one the definition for the role and the first one the
> configuration for this role? 

Here the role states that a component specified as <url-factory> (because of the 
shorthand attribute) represented by class 
org.apache.cocoon.components.url.URLFactoryImpl will implement the working 
interface org.apache.cocoon.components.url.URLFactory. It might be possible to 
rewrite that using a ComponentSelector similar to the specification of the 
DataSource component.

Generally the role element defines shorthands for component definition. Thus the 
complete definition for the URLFactory without a role definition will be:

 <component role="org.apache.cocoon.components.url.URLFactory"
   <protocol name="resource"
   <protocol name="context" 

And yes, the <protocol> elements are configurations for the url-factory only.


To unsubscribe, e-mail:
For additional commands, email:

View raw message