cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Winnall" <st...@winnall.ch>
Subject Database access using sitemap parameter
Date Fri, 26 Sep 2003 15:37:20 GMT
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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message