You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by Apache Wiki <wi...@apache.org> on 2010/03/16 15:20:09 UTC

[Jackrabbit Wiki] Update of "ExamplesPage" by josephottinger

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jackrabbit Wiki" for change notification.

The "ExamplesPage" page has been changed by josephottinger.
The comment on this change is: Adding spring config example.
http://wiki.apache.org/jackrabbit/ExamplesPage?action=diff&rev1=33&rev2=34

--------------------------------------------------

  }
  }}}
  
+ == Spring Configuration ==
+ 
+ You can create a Repository reference in Spring in multiple ways, but here's one that uses the RepositoryImpl class:
+ 
+     <bean id="repository" class="org.apache.jackrabbit.core.RepositoryImpl">
+         <constructor-arg index="0" ref="config" />
+         </bean>
+     <bean id="config" class="org.apache.jackrabbit.core.config.RepositoryConfig" factory-method="create">        
+         <constructor-arg index="0" value="./repository.xml"/>
+         <constructor-arg index="1" value="." />
+     </bean>
+ 
+ This will create a repository in the current directory, using ./repository.xml as the configuration file. This isn't as complete as se-jcr will be (hopefully) but this does work with Spring 3.0 and JackRabbit 2.0.
+ 
  == See also ==
  
   * [[EncodingAndEscaping]]