http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
<bean id="slcSession" class="org.argeo.jcr.spring.ThreadBoundSession">
- <property name="repository" ref="slcRepository" />
+ <property name="repository" ref="javaRepository" />
</bean>
</beans>
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
osgi:default-timeout="30000">\r
\r
- <reference id="slcRepository" interface="javax.jcr.Repository"\r
- filter="(argeo.jcr.repository.alias=slc)" />\r
+ <reference id="javaRepository" interface="javax.jcr.Repository"\r
+ filter="(argeo.jcr.repository.alias=repos_java)" />\r
</beans:beans>
\ No newline at end of file
org.argeo.security.jcr,
org.argeo.slc.aether,
org.argeo.slc.aether.spring,
+ org.argeo.slc.jcr,
org.argeo.slc.repo,
org.argeo.slc.repo.maven,
org.argeo.slc.repo.maven.proxy,
org.h2;resolution:=optional,
org.sonatype.aether;version="1.9.0",
+ org.springframework.beans.factory.config;version="2.5.6.SEC01",
org.springframework.security;version="2.0.6.RELEASE"
<bean id="jcrSession" class="org.argeo.security.jcr.SecureThreadBoundSession">\r
<property name="repository" ref="jcrRepository" />\r
</bean>\r
+\r
+ <bean id="jcrRepository" class="org.argeo.jackrabbit.JackrabbitContainer"\r
+ init-method="init" destroy-method="destroy">\r
+ <property name="homeDirectory" value="${osgi.instance.area}/repos/java" />\r
+ <property name="configuration" value="osgibundle:repository-h2.xml" />\r
+ <property name="variables" value="osgibundle:/repo.properties" />\r
+ <property name="cndFiles">\r
+ <list>\r
+ <value>/org/argeo/jcr/argeo.cnd</value>\r
+ <value>/org/argeo/slc/jcr/slc.cnd</value>\r
+ <value>/org/argeo/slc/repo/repo.cnd</value>\r
+ </list>\r
+ </property>\r
+ <property name="bundleContext" ref="bundleContext" />\r
+ </bean>\r
+\r
</beans>
\ No newline at end of file
<!-- Security -->\r
<reference id="authenticationManager"\r
interface="org.springframework.security.AuthenticationManager" />\r
- <reference id="jcrRepository" interface="javax.jcr.Repository"\r
- filter="(argeo.jcr.repository.alias=slc)" />\r
+<!-- <reference id="jcrRepository" interface="javax.jcr.Repository" -->\r
+<!-- filter="(argeo.jcr.repository.alias=slc)" /> -->\r
+ <service ref="jcrRepository" interface="javax.jcr.Repository">\r
+ <service-properties>\r
+ <beans:entry key="argeo.jcr.repository.alias" value="repos_java" />\r
+ </service-properties>\r
+ </service>\r
\r
<!-- Maven -->\r
<!-- <reference id="mavenRepositorySystem" interface="org.sonatype.aether.RepositorySystem" -->\r
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
">
- <bean id="repo" class="org.argeo.slc.repo.RepoImpl" init-method="init" destroy-method="destroy">
+ <bean
+ class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+ <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
+ <property name="locations">
+ <value>osgibundle:repo.properties</value>
+ </property>
+ </bean>
+
+ <bean id="repo" class="org.argeo.slc.repo.RepoImpl" init-method="init"
+ destroy-method="destroy">
<property name="jcrRepository" ref="jcrRepository" />
<property name="nodeIndexers">
<list>
-bin.includes = META-INF/
+bin.includes = META-INF/,\
+ repo.properties,\
+ repository-h2.xml
--- /dev/null
+<?xml version="1.0"?>
+<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.6//EN"
+ "http://jackrabbit.apache.org/dtd/repository-2.0.dtd">
+<Repository>
+ <!-- Shared datasource -->
+ <DataSources>
+ <DataSource name="dataSource">
+ <param name="driver" value="org.h2.Driver" />
+ <param name="url" value="jdbc:h2:${rep.home}/h2/repository" />
+ <param name="user" value="sa" />
+ <param name="password" value="" />
+ <param name="databaseType" value="h2" />
+ <param name="maxPoolSize" value="30" />
+ </DataSource>
+ </DataSources>
+
+ <!-- File system and datastore -->
+ <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
+ <param name="dataSourceName" value="dataSource" />
+ <param name="schema" value="default" />
+ <param name="schemaObjectPrefix" value="fs_" />
+ </FileSystem>
+ <DataStore class="org.apache.jackrabbit.core.data.FileDataStore" />
+ <!-- <DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
+ <param name="dataSourceName" value="dataSource" /> <param name="schemaObjectPrefix"
+ value="ds_" /> </DataStore> -->
+
+ <!-- Workspace templates -->
+ <Workspaces rootPath="${rep.home}/workspaces"
+ defaultWorkspace="main" />
+ <Workspace name="${wsp.name}">
+ <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
+ <param name="dataSourceName" value="dataSource" />
+ <param name="schema" value="default" />
+ <param name="schemaObjectPrefix" value="${wsp.name}_fs_" />
+ </FileSystem>
+ <PersistenceManager
+ class="org.apache.jackrabbit.core.persistence.pool.H2PersistenceManager">
+ <param name="dataSourceName" value="dataSource" />
+ <param name="schemaObjectPrefix" value="${wsp.name}_pm_" />
+ </PersistenceManager>
+ <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+ <param name="path" value="${wsp.home}/index" />
+ </SearchIndex>
+ </Workspace>
+
+ <!-- Versioning -->
+ <Versioning rootPath="${rep.home}/version">
+ <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
+ <param name="dataSourceName" value="dataSource" />
+ <param name="schema" value="default" />
+ <param name="schemaObjectPrefix" value="fs_ver_" />
+ </FileSystem>
+ <PersistenceManager
+ class="org.apache.jackrabbit.core.persistence.pool.H2PersistenceManager">
+ <param name="dataSourceName" value="dataSource" />
+ <param name="schemaObjectPrefix" value="pm_ver_" />
+ </PersistenceManager>
+ </Versioning>
+
+ <!-- Indexing -->
+ <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+ <param name="path" value="${rep.home}/repository/index" />
+ <param name="extractorPoolSize" value="2" />
+ <param name="supportHighlighting" value="true" />
+ </SearchIndex>
+
+ <!-- Security -->
+ <Security appName="Jackrabbit">
+ <SecurityManager class="org.argeo.security.jackrabbit.ArgeoSecurityManager"
+ workspaceName="security">
+ </SecurityManager>
+ <AccessManager class="org.argeo.security.jackrabbit.ArgeoAccessManager">
+ </AccessManager>
+ <LoginModule class="org.argeo.security.jackrabbit.ArgeoLoginModule">
+ </LoginModule>
+ </Security>
+</Repository>
\ No newline at end of file
/** SLC repository constants */
public interface RepoConstants {
- public final static String ARTIFACTS_BASE_PATH = "/repo";
- public final static String PROXIED_REPOSITORIES = "/slc/repo/sources";
+ public final static String ARTIFACTS_BASE_PATH = "/";
+ public final static String REPO_BASEPATH = "/slc:repo";
+ public final static String PROXIED_REPOSITORIES = REPO_BASEPATH
+ + "/slc:sources";
}
package org.argeo.slc.repo;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import javax.jcr.Node;
.addEventListener(artifactListener, Event.NODE_ADDED,
RepoConstants.ARTIFACTS_BASE_PATH, true, null,
null, true);
+ // localrepo
+ String localrepoWorkspace = "localrepo";
+ if (!Arrays.asList(
+ adminSession.getWorkspace().getAccessibleWorkspaceNames())
+ .contains(localrepoWorkspace))
+ adminSession.getWorkspace().createWorkspace(localrepoWorkspace);
} catch (RepositoryException e) {
throw new SlcException("Cannot initialize repository backend", e);
}