2

I have a web application running on tomcat and using spring framework. I also have jackrabbit oak libraries embedded in project. I can get jackrabbit repository with java code like this:

new Jcr(new Oak(ns)).createRepository();

but I want to define my repository in a repository.xml file and then put it somewhere and instantiate it with spring xml files, so I can customize various things like ExternalIdentityProvider in my repository. Something like this I think:

<bean id="repository" class="org.apache.jackrabbit.oak.jcr.repository.RepositoryImpl" 
references="repository.xml"/>

but I don't know how I should define this repository in spring. any suggestion?

amir.sh
  • 193
  • 6
  • 18

1 Answers1

0

just use it like any other library:

  1. put some variables in your application.properties
  2. use Java config (XML config is not the most robust one)
  3. access those variables using your favourite way
  4. build your ns object using those variables
  5. register the outcome of new Jcr(new Oak(ns)).createRepository() as a Bean that uses the newly created ns object - this should help you

and that should do the trick :)