jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: How to configure RepositoryConfig so that It can take variables like {repo.home} from my custom Properties variable instead of System properties
Date Tue, 09 Dec 2008 12:57:01 GMT
Hi,

On Tue, Dec 9, 2008 at 1:14 PM,  <Chirag.Jakharia@zycus.com> wrote:
> How to configure RepositoryConfig so that It can take variables like
> {repo.home} from my custom Properties variablerather tahn System
> properties
>
> I have a component based on Jackrabbit and require it to connect to
> different database and therefore want the runtime change of the Properties
> such as repo.home and such variables and therefore require to pass the
> Properties file but can't find any method relating to that

You can instantiate a RepositoryConfigurationParser [1] with a custom
set of properties, and use that instance to parse the repository
configuration file. Something like this:

    Properties properties = ...; // Your custom set of properties
    RepositoryConfigurationParser parser =
        new RepositoryConfigurationParser(properties);
    RepositoryConfig config = parser.parseRepositoryConfig(...);
    Repository repository = RepositoryImpl.create(config);

[1] http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.html

BR,

Jukka Zitting

Mime
View raw message