cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Winnall" <>
Subject Database access using sitemap parameter
Date Fri, 26 Sep 2003 15:37:20 GMT

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

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


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


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message