You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jan <vi...@gmx.de> on 2002/01/02 17:48:18 UTC

ComposerGenerator - what is composed?

What will the ComponentManager a Composable Generator is composed with contain/provide? Is there a way to setup this by myself?

Cheers,
Jan

Re: ComposerGenerator - what is composed?

Posted by Peter Royal <pr...@managingpartners.com>.
On Wednesday 02 January 2002 12:45 pm, you wrote:
> For example the ServerPagesGenerator looks up ProgramGenerator.ROLE.
> But has no class and no role defined in cocoon.xconf but only the
> following:
>
>   <program-generator>
>     <parameter name="auto-reload" value="true"/>
>     <parameter name="root-package" value="org.apache.cocoon.www"/>
>     <parameter name="preload" value="true"/>
>   </program-generator>
>
> 1) How is that to understand? Is the ProgramGenerator a compiled in feature
> of the ComponentManager every Composable Generator is composed with and one
> can only add own stuff in cocoon.xconf?

Read some of the avalon documentation. program-generator is a name of a 
predefined role for cocoon, from the org/apache/cocoon/cocoon.roles file. The 
child elements of program-generator are passed into the component via a 
parameters object.

> 2) Is "component-instance" of your example the string "component-instance"
> or can one choose a descriptive element name?

You have to use component-instance, if you do not create your own roles file. 
if you create your own roles file, you can use the shorthand as the element 
name.

> 3) And will that class then be provided to every composed component by
> cocoon?

yes.

> 4) Is the component automagically configured with the stuff contained by
> the element in the cocoon.xconf?

If your component implements the Configurable interface, then yes, it is 
passed a Configuration object that you can use to configure your component.
-pete

-- 
peter royal -> proyal@managingpartners.com

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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: ComposerGenerator - what is composed?

Posted by Jan <vi...@gmx.de>.
> On Wednesday 02 January 2002 11:48 am, you wrote:
> > What will the ComponentManager a Composable Generator is composed with
> > contain/provide? Is there a way to setup this by myself?
>
> It will contain the components defined in the cocoon.xconf. You can add
your
> own components in there using the
> <component-instance class="your.class" role="your.role"/>
> tag, or by defining a role in your own custom roles file, adding a
user-roles
> attribute to the root <cocoon> tag in cocon.xconf and using the roles just
> like the internal roles.

For example the ServerPagesGenerator looks up ProgramGenerator.ROLE.
But has no class and no role defined in cocoon.xconf but only the following:

  <program-generator>
    <parameter name="auto-reload" value="true"/>
    <parameter name="root-package" value="org.apache.cocoon.www"/>
    <parameter name="preload" value="true"/>
  </program-generator>

1) How is that to understand? Is the ProgramGenerator a compiled in feature
of the ComponentManager every Composable Generator is composed with and one
can only add own stuff in cocoon.xconf?
2) Is "component-instance" of your example the string "component-instance"
or can one choose a descriptive element name?
3) And will that class then be provided to every composed component by
cocoon?
4) Is the component automagically configured with the stuff contained by the
element in the cocoon.xconf?

Cheers,
Jan


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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: ComposerGenerator - what is composed?

Posted by Peter Royal <pr...@managingpartners.com>.
On Wednesday 02 January 2002 11:48 am, you wrote:
> What will the ComponentManager a Composable Generator is composed with
> contain/provide? Is there a way to setup this by myself?

It will contain the components defined in the cocoon.xconf. You can add your 
own components in there using the
<component-instance class="your.class" role="your.role"/>
tag, or by defining a role in your own custom roles file, adding a user-roles 
attribute to the root <cocoon> tag in cocon.xconf and using the roles just 
like the internal roles.

It might be helpful to read some of the avalon documentation, since the 
component manager is all avalon stuff. http://jakarta.apache.org/avalon
-pete

-- 
peter royal -> proyal@managingpartners.com

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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>