it sounds pretty complicated. though, especially the configuration of cocoon.xconf.
I have a problem declaring app specific data in the global context; it is
unclean.
I *was* hoping for a Cocoon.getInstance() or ServiceManager.getInstance()
like construct. Alas.
I think I just use both standard java.sql libraries for testing and let my flowscript cocoon.getComponent( dbname ) pass the datasource to my objects for real - so much simpler.
The point is that implementing a change in cocoon.xconf requires that cocoon be restarted - which would bring all other applications off-line. Not a problem for the development version but a huge problem for the deployment server.
In any case, thanks for the quick and clear response.
Regards, Leon
Marco Rolappe wrote:
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]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
