Skip to content

Commit

Permalink
Merge pull request #30 from futures/path-to-modeshape-config
Browse files Browse the repository at this point in the history
Allow the path to the modeshape config to be passed in as a property (either classpath or filepath.
  • Loading branch information
cbeer committed Mar 7, 2013
2 parents 0b7fafd + 9525e5d commit 3f523f6
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 45 deletions.
10 changes: 4 additions & 6 deletions fcrepo-dc/src/test/resources/spring-test/repo.xml
Expand Up @@ -10,15 +10,13 @@

<context:annotation-config/>

<bean name="modeshapeRepofactory" class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean"/>
<bean name="modeshapeRepofactory"
class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean">
<property name="repositoryConfiguration" value="${fcrepo.modeshape.configuration:my_repository.json}"/>
</bean>

<bean class="org.modeshape.jcr.JcrRepositoryFactory"/>

<bean class="org.springframework.core.io.ClassPathResource">
<qualifier type="ModeShapeRepositoryConfiguration"/>
<constructor-arg type="String" value="my_repository.json"/>
</bean>

<bean class="org.fcrepo.services.ObjectService"/>

</beans>
9 changes: 4 additions & 5 deletions fcrepo-http-api/src/test/resources/spring-test/repo.xml
Expand Up @@ -10,14 +10,13 @@

<context:annotation-config/>

<bean name="modeshapeRepofactory" class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean"/>
<bean name="modeshapeRepofactory"
class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean">
<property name="repositoryConfiguration" value="${fcrepo.modeshape.configuration:test_repository.json}"/>
</bean>

<bean class="org.modeshape.jcr.JcrRepositoryFactory"/>

<bean class="org.springframework.core.io.ClassPathResource">
<qualifier type="ModeShapeRepositoryConfiguration"/>
<constructor-arg type="String" value="test_repository.json"/>
</bean>

<bean class="org.fcrepo.services.ObjectService"/>
<bean class="org.fcrepo.services.DatastreamService"/>
Expand Down
10 changes: 4 additions & 6 deletions fcrepo-jms/src/test/resources/spring-test/repo.xml
Expand Up @@ -10,15 +10,13 @@

<context:annotation-config/>


<bean name="modeshapeRepofactory"
class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean"/>
class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean">
<property name="repositoryConfiguration" value="${fcrepo.modeshape.configuration:my_repository.json}"/>
</bean>

<bean class="org.modeshape.jcr.JcrRepositoryFactory"/>

<bean class="org.springframework.core.io.ClassPathResource">
<qualifier type="ModeShapeRepositoryConfiguration"/>
<constructor-arg type="String" value="my_repository.json"/>
</bean>


</beans>
Expand Up @@ -5,6 +5,7 @@

import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Qualifier;
import javax.jcr.RepositoryException;

import org.modeshape.jcr.JcrRepository;
Expand All @@ -20,8 +21,6 @@ public class ModeShapeRepositoryFactoryBean implements
@Inject
private JcrRepositoryFactory jcrRepositoryFactory;

@Inject
@ModeShapeRepositoryConfiguration
private Resource repositoryConfiguration;
private JcrRepository repository;

Expand All @@ -47,4 +46,7 @@ public boolean isSingleton() {
return true;
}

public void setRepositoryConfiguration(Resource repositoryConfiguration) {
this.repositoryConfiguration = repositoryConfiguration;
}
}
16 changes: 8 additions & 8 deletions fcrepo-kernel/src/test/resources/spring-test/repo.xml
Expand Up @@ -10,17 +10,17 @@

<context:annotation-config/>


<context:property-placeholder/>

<bean name="modeshapeRepofactory"
class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean"/>
class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean">
<property name="repositoryConfiguration" value="${fcrepo.modeshape.configuration:test_repository.json}"/>
</bean>

<bean class="org.modeshape.jcr.JcrRepositoryFactory"/>

<bean class="org.springframework.core.io.ClassPathResource">
<qualifier type="ModeShapeRepositoryConfiguration"/>
<constructor-arg type="String" value="test_repository.json"/>
</bean>
<bean class="org.fcrepo.services.ObjectService"/>
<bean class="org.fcrepo.services.DatastreamService"/>

<bean class="org.fcrepo.services.ObjectService"/>
<bean class="org.fcrepo.services.DatastreamService"/>

</beans>
10 changes: 4 additions & 6 deletions fcrepo-legacy-api/src/test/resources/spring-test/repo.xml
Expand Up @@ -10,15 +10,13 @@

<context:annotation-config/>

<bean name="modeshapeRepofactory" class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean"/>
<bean name="modeshapeRepofactory"
class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean">
<property name="repositoryConfiguration" value="${fcrepo.modeshape.configuration:test_repository.json}"/>
</bean>

<bean class="org.modeshape.jcr.JcrRepositoryFactory"/>

<bean class="org.springframework.core.io.ClassPathResource">
<qualifier type="ModeShapeRepositoryConfiguration"/>
<constructor-arg type="String" value="test_repository.json"/>
</bean>

<bean class="org.fcrepo.services.ObjectService"/>
<bean class="org.fcrepo.services.DatastreamService"/>

Expand Down
9 changes: 4 additions & 5 deletions fcrepo-rss/src/test/resources/spring-test/repo.xml
Expand Up @@ -10,15 +10,14 @@

<context:annotation-config/>


<bean name="modeshapeRepofactory"
class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean"/>
class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean">
<property name="repositoryConfiguration" value="${fcrepo.modeshape.configuration:test_repository.json}"/>
</bean>

<bean class="org.modeshape.jcr.JcrRepositoryFactory"/>

<bean class="org.springframework.core.io.ClassPathResource">
<qualifier type="ModeShapeRepositoryConfiguration"/>
<constructor-arg type="String" value="test_repository.json"/>
</bean>


</beans>
2 changes: 1 addition & 1 deletion fcrepo-webapp/src/main/resources/config/repository.json
Expand Up @@ -22,7 +22,7 @@
},
"storage" : {
"cacheName" : "FedoraRepository",
"cacheConfiguration" : "config/infinispan_configuration.xml",
"cacheConfiguration" : "${fcrepo.infinispan.cache_configuration:config/infinispan_configuration.xml}",
"binaryStorage" : {
"type" : "cache",
"dataCacheName" : "FedoraRepository",
Expand Down
10 changes: 4 additions & 6 deletions fcrepo-webapp/src/main/resources/spring/repo.xml
Expand Up @@ -10,15 +10,13 @@

<context:annotation-config/>

<bean name="modeshapeRepofactory" class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean"/>
<bean name="modeshapeRepofactory"
class="org.fcrepo.spring.ModeShapeRepositoryFactoryBean">
<property name="repositoryConfiguration" value="${fcrepo.modeshape.configuration:/config/repository.json}"/>
</bean>

<bean class="org.modeshape.jcr.JcrRepositoryFactory"/>

<bean class="org.springframework.core.io.ClassPathResource">
<qualifier type="ModeShapeRepositoryConfiguration"/>
<constructor-arg type="String" value="/config/repository.json"/>
</bean>

<bean class="org.fcrepo.services.ObjectService"/>
<bean class="org.fcrepo.services.DatastreamService"/>

Expand Down

0 comments on commit 3f523f6

Please sign in to comment.