You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Torsten Curdt <tc...@dff.st> on 2001/05/28 16:13:42 UTC

[C2] Component Roles

I'm trying to uses more and more of the Avalon interfaces
for a better C2 integration. I have a taglib that creates
instances of beans/classes:

  taglib:
    ...
    st.dff.test b = new st.dff.test();
    ...

Now I'd like to replace this with the Component pattern
from Avalon so the Components are accessible from within
the beans/classes:

  taglib:
     ...
     st.dff.test b = (st.dff.test) manager.lookup("st.dff.test");
     ...

But as far as I understand this would require for every
bean/class a unique entry in the cocoon.roles. Is this right?

And what happens when parameters are need for the constructor?

   taglib:
     ...
     s.dff.test b = (st.dff.test) new st.dff.test("parameter1","parameter2");
     ...

How is handle with the Component approach?!

Sorry if this too OT
--
Torsten

---------------------------------------------------------------------
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: upgrade my beans from c1 to c2

Posted by Antonio Parolini <to...@employer.com.br>.
> I'm not that familiar with C1 but I think you have to use bridge uility
> methods to convert your Nodes into SAX events. Have a look at the class
> org.apache.cocoon.xml.dom.DOMStreamer.

But I fear a performance problem doing so...

If I upgrade my objects ot return a sax event like ContentHandler instead of
a DOM Node, is this going to work in Cocoon2 ?

thanks,

- tony

> > So is the org.w3c.dom.Node Interface still supported in Cocoon
> 2 as a bean
> > return value ?


---------------------------------------------------------------------
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: upgrade my beans from c1 to c2

Posted by giacomo <gi...@apache.org>.
On Wed, 30 May 2001, Antonio Parolini wrote:

> Sorry if this was a stupid question... but i'll be gald if someone could
> help me out on this, even if it's to tell me to read de faq.
> :)

I'm not that familiar with C1 but I think you have to use bridge uility
methods to convert your Nodes into SAX events. Have a look at the class
org.apache.cocoon.xml.dom.DOMStreamer.

Giacomo

>
> So is the org.w3c.dom.Node Interface still supported in Cocoon 2 as a bean
> return value ?
>
> - Tony
>
> > -----Original Message-----
> > From: Antonio Parolini [mailto:tony@employer.com.br]
> > Sent: segunda-feira, 28 de maio de 2001 12:51
> > To: cocoon-users@xml.apache.org
> > Subject: upgrade my beans from c1 to c2
> >
> >
> > Hi there,
> >
> > In Cocoon 1.8.x, my application use beans that return a DOM Node Object.
> >  public Node foo(){..};) and I call them from my XSP page like
> > <xsp:expr>mybean.foo()</xsp:expr>
> >
> > Now I would like to upgrade this for Cocoon 2, but I'm not sure whether
> > Cocoon2 will support this Node interface, since I'm avare that it uses the
> > Sax document model.
> >
> > Do I need to create a new class that supports the XML Frament
> > interface for
> > this and  return it insteed of Dom nodes ?
> >
> > thanks,
> >
> > - tony
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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>
>
>
> ---------------------------------------------------------------------
> 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>
>
>
>
>


---------------------------------------------------------------------
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: upgrade my beans from c1 to c2

Posted by Antonio Parolini <to...@employer.com.br>.
Sorry if this was a stupid question... but i'll be gald if someone could
help me out on this, even if it's to tell me to read de faq.
:)

So is the org.w3c.dom.Node Interface still supported in Cocoon 2 as a bean
return value ?

- Tony

> -----Original Message-----
> From: Antonio Parolini [mailto:tony@employer.com.br]
> Sent: segunda-feira, 28 de maio de 2001 12:51
> To: cocoon-users@xml.apache.org
> Subject: upgrade my beans from c1 to c2
>
>
> Hi there,
>
> In Cocoon 1.8.x, my application use beans that return a DOM Node Object.
>  public Node foo(){..};) and I call them from my XSP page like
> <xsp:expr>mybean.foo()</xsp:expr>
>
> Now I would like to upgrade this for Cocoon 2, but I'm not sure whether
> Cocoon2 will support this Node interface, since I'm avare that it uses the
> Sax document model.
>
> Do I need to create a new class that supports the XML Frament
> interface for
> this and  return it insteed of Dom nodes ?
>
> thanks,
>
> - tony
>
>
>
>
>
> ---------------------------------------------------------------------
> 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>


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


upgrade my beans from c1 to c2

Posted by Antonio Parolini <to...@employer.com.br>.
Hi there,

In Cocoon 1.8.x, my application use beans that return a DOM Node Object.
 public Node foo(){..};) and I call them from my XSP page like
<xsp:expr>mybean.foo()</xsp:expr>

Now I would like to upgrade this for Cocoon 2, but I'm not sure whether
Cocoon2 will support this Node interface, since I'm avare that it uses the
Sax document model.

Do I need to create a new class that supports the XML Frament interface for
this and  return it insteed of Dom nodes ?

thanks,

- tony





---------------------------------------------------------------------
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: [C2] Component Roles

Posted by Torsten Curdt <tc...@dff.st>.
> > I'm trying to uses more and more of the Avalon interfaces
> > for a better C2 integration. I have a taglib that creates
> > instances of beans/classes:
> > 
> >   taglib:
> >     ...
> >     st.dff.test b = new st.dff.test();
> >     ...
> > 
> > Now I'd like to replace this with the Component pattern
> > from Avalon so the Components are accessible from within
> > the beans/classes:
> > 
> >   taglib:
> >      ...
> >      st.dff.test b = (st.dff.test) manager.lookup("st.dff.test");
> >      ...
> > 
> > But as far as I understand this would require for every
> > bean/class a unique entry in the cocoon.roles. Is this right?
> > 
> > And what happens when parameters are need for the constructor?
> > 
> >    taglib:
> >      ...
> >      s.dff.test b = (st.dff.test) new
> > st.dff.test("parameter1","parameter2");
> >      ...
> > 
> > How is handle with the Component approach?!
> 
> Best advice I can give you is "go read the Avalon docs" :)

Well, of course this were I looked first ;)

I did look into the API docs. Unfortunately I couldn't find the answer
in there... Is there any other documentation available? I didn't even found
CVS settings...

Make the blind see ;)
--
Torsten


---------------------------------------------------------------------
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: [C2] Component Roles

Posted by Giacomo Pati <gi...@apache.org>.
Quoting Torsten Curdt <tc...@dff.st>:

> I'm trying to uses more and more of the Avalon interfaces
> for a better C2 integration. I have a taglib that creates
> instances of beans/classes:
> 
>   taglib:
>     ...
>     st.dff.test b = new st.dff.test();
>     ...
> 
> Now I'd like to replace this with the Component pattern
> from Avalon so the Components are accessible from within
> the beans/classes:
> 
>   taglib:
>      ...
>      st.dff.test b = (st.dff.test) manager.lookup("st.dff.test");
>      ...
> 
> But as far as I understand this would require for every
> bean/class a unique entry in the cocoon.roles. Is this right?
> 
> And what happens when parameters are need for the constructor?
> 
>    taglib:
>      ...
>      s.dff.test b = (st.dff.test) new
> st.dff.test("parameter1","parameter2");
>      ...
> 
> How is handle with the Component approach?!

Best advice I can give you is "go read the Avalon docs" :)

Giacomo

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