<arg>-clean</arg>
</argsToAppend>
<systemProperties>
- <slc.osgi.start>
+ <argeo.osgi.start>
org.argeo.dep.osgi.jackrabbit,
org.springframework.osgi.extender,
org.springframework.osgi.web.extender,
org.argeo.dep.osgi.catalina.start,
org.argeo.server.jackrabbit.webapp,
org.argeo.server.jackrabbit.repo
- </slc.osgi.start>
- <slc.osgi.bundles>
+ </argeo.osgi.start>
+ <argeo.osgi.bundles>
${basedir}/../../../server/modules;in=*;ex=pom.xml;ex=target;ex=.*,
${basedir}/../../../server/demo;in=*;ex=pom.xml;ex=target;ex=.*,
- </slc.osgi.bundles>
+ </argeo.osgi.bundles>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
+ <dependency>
+ <groupId>org.argeo.commons.server</groupId>
+ <artifactId>org.argeo.server.jackrabbit</artifactId>
+ <version>0.1.2-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.argeo.commons.server</groupId>
<artifactId>org.argeo.server.dep.jackrabbit.server</artifactId>
<groupId>org.springframework.osgi</groupId>
<artifactId>org.springframework.osgi.extender</artifactId>
</dependency>
-
+
<!-- -->
<dependency>
<groupId>org.springframework.osgi</groupId>
#log4j.logger.org.springframework.jms=WARN
#log4j.logger.org.springframework.security=WARN
-#log4j.logger.org.apache.jackrabbit=DEBUG
log4j.logger.org.apache.activemq=WARN
log4j.logger.org.apache.activemq.transport=WARN
log4j.logger.org.apache.coyote=INFO
log4j.logger.org.apache.tomcat=INFO
+log4j.logger.org.apache.jackrabbit=INFO
+
## Appenders
# console is set to be a ConsoleAppender.
log4j.appender.console=org.apache.log4j.ConsoleAppender
Import-Package: javax.jcr,
org.apache.jackrabbit.core,
org.apache.jackrabbit.core.config,
+ org.argeo.server.jackrabbit,
org.springframework.beans.factory.config
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
<property name="ignoreUnresolvablePlaceholders" value="true" />
- <!--
<property name="locations">
- <value>osgibundle:jackrabbit.properties </value>
+ <value>osgibundle:jackrabbit.properties</value>
</property>
- -->
</bean>
- <bean id="repository" class="org.apache.jackrabbit.core.RepositoryImpl"
- factory-method="create">
- <constructor-arg ref="repositoryConfig" />
+ <bean id="repository" class="org.argeo.server.jackrabbit.JackrabbitContainer">
+ <property name="homeDirectory" value="${argeo.osgi.data.dir}/jackrabbit" />
+ <property name="configuration" value="${argeo.jackrabbit.repo.configuration}" />
</bean>
-
- <bean id="repositoryConfig" class="org.apache.jackrabbit.core.config.RepositoryConfig"
- factory-method="create">
- <!-- -->
- <constructor-arg value="osgibundle:repository.xml"
- type="java.io.InputStream" />
- <constructor-arg value="${argeo.osgi.data.dir}/jackrabbit" type="java.lang.String" />
-
- <!-- <constructor-arg value="${osgi.instance.area}" type="java.io.File" />-->
- </bean>
-
+ <!--
+ <bean id="repository"
+ class="org.apache.jackrabbit.core.RepositoryImpl"
+ factory-method="create"> <constructor-arg ref="repositoryConfig" />
+ </bean> <bean id="repositoryConfig"
+ class="org.apache.jackrabbit.core.config.RepositoryConfig"
+ factory-method="create"> <constructor-arg
+ value="osgibundle:repository.xml" type="java.io.InputStream" />
+ <constructor-arg value="${argeo.osgi.data.dir}/jackrabbit"
+ type="java.lang.String" /> </bean>
+ -->
</beans>
\ No newline at end of file
--- /dev/null
+argeo.jackrabbit.repo.configuration=osgibundle:repository.xml
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.server.jackrabbit</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Tue Nov 24 18:41:10 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5
--- /dev/null
+#Tue Nov 24 18:41:03 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.commons.server</groupId>
+ <artifactId>runtime</artifactId>
+ <version>0.1.2-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <artifactId>org.argeo.server.jackrabbit</artifactId>
+ <name>Commons Server Jackrabbit</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>${version.maven-bundle-plugin}</version>
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.argeo.server.jackrabbit.*
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.argeo.dep.osgi</groupId>
+ <artifactId>org.argeo.dep.osgi.jackrabbit</artifactId>
+ </dependency>
+
+ <!-- Apache Commons -->
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>com.springsource.org.apache.commons.io</artifactId>
+ </dependency>
+
+ <!-- Spring -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>org.springframework.beans</artifactId>
+ </dependency>
+
+ <!-- Logging -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>com.springsource.slf4j.org.apache.commons.logging</artifactId>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+package org.argeo.server.jackrabbit;
+
+import java.io.File;
+import java.io.InputStream;
+
+import javax.jcr.Credentials;
+import javax.jcr.LoginException;
+import javax.jcr.NoSuchWorkspaceException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.jackrabbit.core.RepositoryImpl;
+import org.apache.jackrabbit.core.config.RepositoryConfig;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.core.io.Resource;
+
+public class JackrabbitContainer implements InitializingBean, DisposableBean,
+ Repository {
+ private Resource configuration;
+ private File homeDirectory;
+
+ private RepositoryImpl repository;
+
+ public void afterPropertiesSet() throws Exception {
+ RepositoryConfig config;
+ InputStream in = configuration.getInputStream();
+ try {
+ config = RepositoryConfig.create(in, homeDirectory
+ .getCanonicalPath());
+ } catch (Exception e) {
+ throw new RuntimeException("Cannot read configuration", e);
+ } finally {
+ IOUtils.closeQuietly(in);
+ }
+
+ repository = RepositoryImpl.create(config);
+ }
+
+ public void destroy() throws Exception {
+ if (repository != null)
+ repository.shutdown();
+ }
+
+ // JCR REPOSITORY (delegated)
+ public String getDescriptor(String key) {
+ return repository.getDescriptor(key);
+ }
+
+ public String[] getDescriptorKeys() {
+ return repository.getDescriptorKeys();
+ }
+
+ public Session login() throws LoginException, RepositoryException {
+ return login();
+ }
+
+ public Session login(Credentials credentials, String workspaceName)
+ throws LoginException, NoSuchWorkspaceException,
+ RepositoryException {
+ return login(credentials, workspaceName);
+ }
+
+ public Session login(Credentials credentials) throws LoginException,
+ RepositoryException {
+ return login(credentials);
+ }
+
+ public Session login(String workspaceName) throws LoginException,
+ NoSuchWorkspaceException, RepositoryException {
+ return login(workspaceName);
+ }
+
+ // BEANS METHODS
+ public void setHomeDirectory(File homeDirectory) {
+ this.homeDirectory = homeDirectory;
+ }
+
+ public void setConfiguration(Resource configuration) {
+ this.configuration = configuration;
+ }
+
+}
<module>org.argeo.server.jxl</module>
<module>org.argeo.server.hibernate</module>
<module>org.argeo.server.ads</module>
+ <module>org.argeo.server.jackrabbit</module>
</modules>
</project>
\ No newline at end of file