jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Johnson ...@proteanit.net>
Subject Re: Repository home outside web root
Date Fri, 02 May 2008 06:36:43 GMT
Thanks for that Torgeir


CJ

Torgeir Veimo wrote:
>
> 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"
>           class="org.springframework.jndi.JndiObjectFactoryBean">
>         <property name="jndiName" value="content/path"/>
>         <property name="resourceRef" value="true"/>
>         <property name="defaultObject" value="${user.home}/content/$
> {customer}/repository/"/>
>     </bean>
>
> 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
> torgeir@netenviron.com
>
>
>
>
>



Mime
View raw message