cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <tcu...@apache.org>
Subject Re: Securing JDBC credentials that are stored in cocoon.xconf
Date Thu, 21 Feb 2008 00:30:49 GMT
>> I think you should be able to extend JdbcDataSource  ....
>
> Right, and your comments on how to do that make sense.
>
>> and use that datasource type instead of the jdbc one in your xconf.
>
> The word "use" is where things get a little murky, and another  
> detail from
> me may help clarify.
>
> We use SQL-Transformer.  (We love SQL-Transformer!)  It takes a  
> sitemap
> parameter like so:
>
> <map:parameter name="use-connection" value="myDatasourceName"/>
>
> How can I cause myDatasourceName to match an instance of my new  
> datasource
> class?
>
> It seems that I will need my MyDatasource to go into the same  
> "datasources"
> set

Correct

> as all the ones defined in cocoon.xconf using the <jdbc> tag under
> <datasources>.
>
> Can I do this using a regular <component> tag (at the top level of
> cocoon.xconf, under <cocoon>,
> not under <datasources>),  with a certain role?  (What role?  Is  
> there more
> to it than having the
> right role on the component?)
>
> Or by defining, say, <sc_jdbc> to be a cocoon.xconf  tag that goes  
> under
> <datasources>, and
> is bound to the classname of my datasource?  (Where would I do that?)

IIRC you will need both. Basically "jdbc" just means it's a short  
hand for the role that says it's a ResourceLimitingJdbcDataSource.

Check the cocoon.roles at

http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/java/ 
org/apache/cocoon/cocoon.roles?revision=607115&view=markup

   <role  
name="org.apache.avalon.excalibur.datasource.DataSourceComponentSelector 
"
         shorthand="datasources"
         default- 
class="org.apache.cocoon.components.ExtendedComponentSelector">
     <hint shorthand="jdbc"  
class="org.apache.avalon.excalibur.datasource.ResourceLimitingJdbcDataSo 
urce"/>
     <hint shorthand="j2ee"  
class="org.apache.avalon.excalibur.datasource.J2eeDataSource"/>
     <hint shorthand="informix"  
class="org.apache.avalon.excalibur.datasource.InformixDataSource"/>
   </role>

And you need to define your own DataSource component (preferably just  
delegating to ResourceLimitingJdbcDataSource) as e.g. "securejdbc" or  
whatever you like. Then you should be able to specify that inside the  
"datasources" component selector as you usually do with "jdbc".

Sorry, I don't have cocoon checked out right now and my skills have  
gotten a bit rusty in that area. But I hope it will get you there :)

cheers
--
Torsten

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message