jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karianne Berg <ke...@start.no>
Subject RE: Using a properties file for values in repository.xml
Date Thu, 15 May 2008 19:51:46 GMT
Hi, and thank you for replying. I did perhaps not describe the issue clearly enough. The case
is that we have a project with several developers that have different database usernames/passwords/urls.
If I worked up against a database, I would use Spring to declare a data source and have properties
for these values, like this:

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
        <property name="driverClassName" value="${jdbc.driverClassName}"/>
        <property name="url" value="${jdbc.url}"/>
        <property name="username" value="${jdbc.username}"/>
        <property name="password" value="${jdbc.password}"/>

When I declare my repository in Spring via spring-modules' JCR support, this is no longer
possible, since this data is not in my spring configuration files, but in repository.xml.
I would like to be able to do something similar in repository.xml - not hardcode the database
information, but have a property file hold these values. I was thinking about solving this
by having one repository.xml per developer - this is perhaps the way to go if it is not possible
to load a properties file from repository.xml and use the properties without running String
replacement myself.

- Karianne

-----Original Message-----
From: tmueller@day.com [mailto:tmueller@day.com] On Behalf Of Thomas Müller
Sent: Wednesday, May 14, 2008 9:08 PM
To: users@jackrabbit.apache.org
Subject: Re: Using a properties file for values in repository.xml


>  I was wondering if it is possible to have certain values used in repository.xml in a
properties file, and somehow get repository xml to use those values?

One solution is to use find / replace (read the document as a String,
use String.replaceAll, store the document).

> I am specifically thinking about database login information, as different users will
want to have different usernames and passwords.

I don't understand, will multiple users open the same repository at
the same time? This doesn't work. Or do you mean sessions? Could you
please describe why you like to use multiple user names?


View raw message