Hi

I am writing a generator which returns metadata from a database via JDBC.
I would like to retrieve the name of the database from the pool declared
in cocoon.xconf. The examples that I have seen show how to do this by
extending ComposerGenerator and setting the DataSource in the method
'compose'.

As I understand it, this means that the database name is effectively
hard-coded because 'compose' is only called when Cocoon is initialised.

I would like to be able to specify the name of the database as a sitemap
parameter or as a the src= parameter of the generator:

<map:generate type="DbSchemaGenerator" src="name-of-db-pool"/>

or

<map:generate type="DbSchemaGenerator" ...>
  <parameter name="db" value="name-of-db-pool"/>

As I understand it, I cannot read the <parameter>s in until 'setup' is
called. This means that I need to create the DataSource in 'setup' or in
'generate'. My attempts to do this have failed so far.

Is there a trick involved or can someone point me at some documentation
which explains how to do this?

Regards
Steve

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

Reply via email to