hi leon,

make your java class a component
 - implement Composable (you'll get a ComponentManager) or Servicable
(you'll get a ServiceManager)
 - optionally implement other lifecycle interfaces (e.g. LogEnabled to get a
logger for your component)
 - declare your new component where the other components are declared; in
cocoon.xconf

take a look at the avalon documentation at apache.org for the general ideas
and the cocoon source for some meat.

> -----Ursprungliche Nachricht-----
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Auftrag
> von Leon Widdershoven
> Gesendet: Freitag, 9. April 2004 12:37
> An: users
> Betreff: How to obtain the Manager, or a Component
>
>
> Hi,
>
> I am looking for a way to get a database pool from cocoon from within my
> Java class.
>
> These java classes will then be compiled to a library and used from a
> Javascript flowscript program. Thus, they do not get
> configuration settings
> from the sitemap.
>
> Following the code I used in my flowscript it seems that I need to get
> a ComponentManager from somewhere (a ServiceManager would be better
> but seems to be even harder to find) so I can lookup my database
> resource.
>
> I did find some sample code on the doc pages, but those require
> org.apache.cocoon.Roles, which does not exist in my Cocoon 2.1.4.
>
> I hope someone can give me a hint as I get a headache from complicated
> javascript (My prototype is in JavaScript; it processes Excel spreadsheets
> and consists of a single file with 10+ "classes" and over a 1000 lines -
> I truly wish to organize it as a Java lib!)
>
> Regards,
> Leon Widdershoven
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to