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
|