You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Pierre-Alexandre Losson <pl...@telio.be> on 2002/04/02 18:41:21 UTC

Using self written user components with cocoon2

Hi folks,

Since Cocoon2 is based on Avalon & Excalibur, how do I use
cocoon's component manager in the custom java classes used in a web-app.

I saw that a "manager" handle was available in an XSP, but how do I access
the
component manager from a pure java class I wrote myself ?

I think I can modify the cocoon.roles file, add a configuration entry
in cocoon.xconf so that cocoon will initialize my component for me and that
way I will have access to it's component manager but this seems not very
"clean" to me

Is there any other way to do this ?

Pierre





---------------------------------------------------------------------
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: Using self written user components with cocoon2

Posted by Vadim Gritsenko <va...@verizon.net>.
Take a look at the web.xml:

    <!--
      This parameter allows you to select the parent component manager.
      The class will be instantiated via the constructor that takes a
single
      String as a parameter. That String will be equal to the text after
the
      '/'.

      Cocoon honors the Loggable and Initializable interfaces for this
class,
      if it implements them.

      If you uncomment the following lines the parent CM is set to the
Parent CM sample, which will look up
      a configuration via JNDI at
org/apache/cocoon/samples/parentcm/ParentCMConfiguration
      and use it.
    <init-param>
      <param-name>parent-component-manager</param-name>
 
<param-value>org.apache.cocoon.samples.parentcm.ParentComponentManager/o
rg/apache/cocoon/samples/parentcm/ParentCMConfiguration</param-value>
    </init-param>
    -->

Might be of help to you.

Vadim

> From: Pierre-Alexandre Losson [mailto:plosson@telio.be]
> 
> Hi folks,
> 
> Since Cocoon2 is based on Avalon & Excalibur, how do I use
> cocoon's component manager in the custom java classes used in a
web-app.
> 
> I saw that a "manager" handle was available in an XSP, but how do I
access
> the
> component manager from a pure java class I wrote myself ?
> 
> I think I can modify the cocoon.roles file, add a configuration entry
> in cocoon.xconf so that cocoon will initialize my component for me and
that
> way I will have access to it's component manager but this seems not
very
> "clean" to me
> 
> Is there any other way to do this ?
> 
> Pierre
> 


---------------------------------------------------------------------
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>