jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torgeir Veimo <torg...@pobox.com>
Subject Re: Repository home outside web root
Date Fri, 02 May 2008 01:07:07 GMT

On 2 May 2008, at 06:01, Charles Johnson wrote:

> What is the best/convenient practice for configuration of  the  
> repository when the config file and repository home is outside the  
> web root, i.e. elsewhere in the file system?

Not sure about best practices, but we do it by using spring / jndi  
configuration. Eg use something like this in appCtx-jndi.xml;

     <bean id="jndi.content.path" name="content/path"
         <property name="jndiName" value="content/path"/>
         <property name="resourceRef" value="true"/>
         <property name="defaultObject" value="${user.home}/content/$

then have your build script replace ${customer} with your customer (or  
webapp context) name. We then have a manager (spring bean) which sets  
up the repository using a RepositoryConfig & TransientRepository  
instance. We also use a default repository config file located in /WEB- 
INF/, but
which can be overridden using jndi when you need a different  
persistence setup (we use derby by default).

The nice thing about is that we have a default location, ~/content,  
and it allows multiple webapps to run side by side since we put the
repository under a customer subdirectory.

Torgeir Veimo

View raw message