You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by sa...@apache.org on 2011/03/07 11:50:32 UTC
svn commit: r1078740 - in /ofbiz/branches/jackrabbit20100709/framework: ./
jcr/ jcr/config/ jcr/lib/ jcr/src/ jcr/src/org/ jcr/src/org/ofbiz/
jcr/src/org/ofbiz/jcr/
Author: sascharodekamp
Date: Mon Mar 7 10:50:31 2011
New Revision: 1078740
URL: http://svn.apache.org/viewvc?rev=1078740&view=rev
Log:
Update - Readd the 'jcr' folder, because of the faild commit @Rev1078930
Here is the orig msg.:
Update - Moved the Jackrabbit implementation to a more common folder called "jcr" (JavaContentRepository), updated the Jackrabbit Lib to version 2.2.4 and fixed the build process, there was a reference to the framework/lib folder missing.
Added:
ofbiz/branches/jackrabbit20100709/framework/jcr/
ofbiz/branches/jackrabbit20100709/framework/jcr/build.xml
ofbiz/branches/jackrabbit20100709/framework/jcr/config/
ofbiz/branches/jackrabbit20100709/framework/jcr/config/jackrabbit.xml
ofbiz/branches/jackrabbit20100709/framework/jcr/config/jcr-repositories.xml
ofbiz/branches/jackrabbit20100709/framework/jcr/lib/
ofbiz/branches/jackrabbit20100709/framework/jcr/lib/concurrent-1.3.4.jar (with props)
ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-api-2.2.4.jar (with props)
ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-core-2.2.4.jar (with props)
ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-jca-2.2.4.jar (with props)
ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-jcr-commons-2.2.4.jar (with props)
ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-spi-2.2.4.jar (with props)
ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-spi-commons-2.2.4.jar (with props)
ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jcr-2.0.jar (with props)
ofbiz/branches/jackrabbit20100709/framework/jcr/lib/pdfbox-1.3.1.jar (with props)
ofbiz/branches/jackrabbit20100709/framework/jcr/lib/slf4j-api-1.5.8.jar (with props)
ofbiz/branches/jackrabbit20100709/framework/jcr/lib/slf4j-log4j12-1.5.8.jar (with props)
ofbiz/branches/jackrabbit20100709/framework/jcr/lib/tika-core-0.8.jar (with props)
ofbiz/branches/jackrabbit20100709/framework/jcr/lib/tika-parsers-0.8.jar (with props)
ofbiz/branches/jackrabbit20100709/framework/jcr/ofbiz-component.xml
ofbiz/branches/jackrabbit20100709/framework/jcr/src/
ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/
ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/
ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/
ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/JackrabbitContainer.java
ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/JcrRepositoryFactory.java
ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/LocalRepositoryFactory.java
ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/OFBizLoginModule.java
ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/RepositoryFactory.java
Modified:
ofbiz/branches/jackrabbit20100709/framework/build.xml
ofbiz/branches/jackrabbit20100709/framework/component-load.xml
Modified: ofbiz/branches/jackrabbit20100709/framework/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/build.xml?rev=1078740&r1=1078739&r2=1078740&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/build.xml (original)
+++ ofbiz/branches/jackrabbit20100709/framework/build.xml Mon Mar 7 10:50:31 2011
@@ -25,7 +25,7 @@ under the License.
files="start/build.xml,base/build.xml,sql/build.xml,
entity/build.xml,geronimo/build.xml,
catalina/build.xml,jetty/build.xml,
- security/build.xml,service/build.xml,jackrabbit/build.xml,entityext/build.xml,
+ security/build.xml,service/build.xml,jcr/build.xml,entityext/build.xml,
webslinger/build.xml,
bi/build.xml,minilang/build.xml,
webapp/build.xml,guiapp/build.xml,widget/build.xml,
Modified: ofbiz/branches/jackrabbit20100709/framework/component-load.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/component-load.xml?rev=1078740&r1=1078739&r2=1078740&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/component-load.xml (original)
+++ ofbiz/branches/jackrabbit20100709/framework/component-load.xml Mon Mar 7 10:50:31 2011
@@ -31,7 +31,7 @@ under the License.
<load-component component-location="common"/>
<load-component component-location="service"/>
<load-component component-location="entityext"/>
- <load-component component-location="jackrabbit"/>
+ <load-component component-location="jcr"/>
<load-component component-location="bi"/>
<load-component component-location="birt"/>
<load-component component-location="webapp"/>
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/build.xml?rev=1078740&view=auto
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/jcr/build.xml (added)
+++ ofbiz/branches/jackrabbit20100709/framework/jcr/build.xml Mon Mar 7 10:50:31 2011
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project name="OFBiz - JCR" default="jar" basedir=".">
+ <import file="../../common.xml"/>
+
+ <!-- ================================================================== -->
+ <!-- Initialization of all property settings -->
+ <!-- ================================================================== -->
+
+ <property name="desc" value="JCR Component"/>
+ <property name="name" value="ofbiz-jcr"/>
+ <property name="ofbiz.home.dir" value="../.."/>
+
+ <path id="local.class.path">
+ <fileset dir="${lib.dir}" includes="*.jar"/>
+ <fileset dir="../../framework/base/lib" includes="*.jar"/>
+ <fileset dir="../../framework/base/lib/commons" includes="*.jar"/>
+ <fileset dir="../../framework/base/build/lib" includes="*.jar"/>
+ <fileset dir="../../framework/entity/build/lib" includes="*.jar"/>
+ <fileset dir="../../framework/service/build/lib" includes="*.jar"/>
+
+ </path>
+
+ <target name="jar" depends="classes">
+ <main-jar/>
+ <test-jar/>
+ </target>
+</project>
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/config/jackrabbit.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/config/jackrabbit.xml?rev=1078740&view=auto
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/jcr/config/jackrabbit.xml (added)
+++ ofbiz/branches/jackrabbit20100709/framework/jcr/config/jackrabbit.xml Mon Mar 7 10:50:31 2011
@@ -0,0 +1,136 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!DOCTYPE Repository
+ PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN"
+ "http://jackrabbit.apache.org/dtd/repository-2.0.dtd">
+
+<!-- Example Repository Configuration File
+ Used by
+ - org.apache.jackrabbit.core.config.RepositoryConfigTest.java
+ -
+-->
+<Repository>
+ <!--
+ virtual file system where the repository stores global state
+ (e.g. registered namespaces, custom node types, etc.)
+ -->
+ <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+ <param name="path" value="${rep.home}/repository"/>
+ </FileSystem>
+
+ <!--
+ data store configuration
+ -->
+ <DataStore class="org.apache.jackrabbit.core.data.FileDataStore"/>
+
+ <!--
+ security configuration
+ -->
+ <Security appName="Jackrabbit">
+ <!--
+ security manager:
+ class: FQN of class implementing the JackrabbitSecurityManager interface
+ -->
+ <SecurityManager class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager" workspaceName="security">
+ <!--
+ workspace access:
+ class: FQN of class implementing the WorkspaceAccessManager interface
+ -->
+ <!-- <WorkspaceAccessManager class="..."/> -->
+ <!-- <param name="config" value="${rep.home}/security.xml"/> -->
+ </SecurityManager>
+
+ <!--
+ access manager:
+ class: FQN of class implementing the AccessManager interface
+ -->
+ <AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
+ <!-- <param name="config" value="${rep.home}/access.xml"/> -->
+ </AccessManager>
+
+ <LoginModule class="org.ofbiz.jackrabbit.OFBizLoginModule"/>
+ </Security>
+
+ <!--
+ location of workspaces root directory and name of default workspace
+ -->
+ <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
+ <!--
+ workspace configuration template:
+ used to create the initial workspace if there's no workspace yet
+ -->
+ <Workspace name="${wsp.name}">
+ <!--
+ virtual file system of the workspace:
+ class: FQN of class implementing the FileSystem interface
+ -->
+ <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+ <param name="path" value="${wsp.home}"/>
+ </FileSystem>
+ <!--
+ persistence manager of the workspace:
+ class: FQN of class implementing the PersistenceManager interface
+ -->
+ <PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager">
+ <param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
+ <param name="schemaObjectPrefix" value="${wsp.name}_"/>
+ </PersistenceManager>
+ <!--
+ Search index and the file system it uses.
+ class: FQN of class implementing the QueryHandler interface
+ -->
+ <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+ <param name="path" value="${wsp.home}/index"/>
+ <param name="supportHighlighting" value="true"/>
+ </SearchIndex>
+ </Workspace>
+
+ <!--
+ Configures the versioning
+ -->
+ <Versioning rootPath="${rep.home}/version">
+ <!--
+ Configures the filesystem to use for versioning for the respective
+ persistence manager
+ -->
+ <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+ <param name="path" value="${rep.home}/version" />
+ </FileSystem>
+
+ <!--
+ Configures the persistence manager to be used for persisting version state.
+ Please note that the current versioning implementation is based on
+ a 'normal' persistence manager, but this could change in future
+ implementations.
+ -->
+ <PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.DerbyPersistenceManager">
+ <param name="url" value="jdbc:derby:${rep.home}/version/db;create=true"/>
+ <param name="schemaObjectPrefix" value="version_"/>
+ </PersistenceManager>
+ </Versioning>
+
+ <!--
+ Search index for content that is shared repository wide
+ (/jcr:system tree, contains mainly versions)
+ -->
+ <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+ <param name="path" value="${rep.home}/repository/index"/>
+ <param name="supportHighlighting" value="true"/>
+ </SearchIndex>
+</Repository>
\ No newline at end of file
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/config/jcr-repositories.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/config/jcr-repositories.xml?rev=1078740&view=auto
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/jcr/config/jcr-repositories.xml (added)
+++ ofbiz/branches/jackrabbit20100709/framework/jcr/config/jcr-repositories.xml Mon Mar 7 10:50:31 2011
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<!-- Any number of JCR repositories can be configured in this file,
+ and this file can be located anywhere in the Java classpath.
+
+ Each repository must have a unique name, and there must
+ be one repository named "default" - which is used when
+ no repository name is specified.
+ -->
+
+<jcr-repositories xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <!-- A JCR Repository located using JNDI -->
+ <repository name="default" jndi-name="jcr/local"/>
+
+ <!-- A JCR Repository created from a factory. The
+ class-name attribute contains the name of a class that
+ implements JcrRepositoryFactory. The name attribute is
+ passed to the factory's getInstance method. -->
+ <!--
+ <repository name="foo" class-name="com.mydomain.fooRepoFactory"/>
+ -->
+</jcr-repositories>
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/concurrent-1.3.4.jar
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/lib/concurrent-1.3.4.jar?rev=1078740&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/concurrent-1.3.4.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-api-2.2.4.jar
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-api-2.2.4.jar?rev=1078740&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-api-2.2.4.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-core-2.2.4.jar
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-core-2.2.4.jar?rev=1078740&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-core-2.2.4.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-jca-2.2.4.jar
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-jca-2.2.4.jar?rev=1078740&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-jca-2.2.4.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-jcr-commons-2.2.4.jar
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-jcr-commons-2.2.4.jar?rev=1078740&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-jcr-commons-2.2.4.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-spi-2.2.4.jar
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-spi-2.2.4.jar?rev=1078740&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-spi-2.2.4.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-spi-commons-2.2.4.jar
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-spi-commons-2.2.4.jar?rev=1078740&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jackrabbit-spi-commons-2.2.4.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jcr-2.0.jar
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jcr-2.0.jar?rev=1078740&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/jcr-2.0.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/pdfbox-1.3.1.jar
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/lib/pdfbox-1.3.1.jar?rev=1078740&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/pdfbox-1.3.1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/slf4j-api-1.5.8.jar
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/lib/slf4j-api-1.5.8.jar?rev=1078740&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/slf4j-api-1.5.8.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/slf4j-log4j12-1.5.8.jar
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/lib/slf4j-log4j12-1.5.8.jar?rev=1078740&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/slf4j-log4j12-1.5.8.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/tika-core-0.8.jar
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/lib/tika-core-0.8.jar?rev=1078740&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/tika-core-0.8.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/tika-parsers-0.8.jar
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/lib/tika-parsers-0.8.jar?rev=1078740&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ofbiz/branches/jackrabbit20100709/framework/jcr/lib/tika-parsers-0.8.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/ofbiz-component.xml?rev=1078740&view=auto
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/jcr/ofbiz-component.xml (added)
+++ ofbiz/branches/jackrabbit20100709/framework/jcr/ofbiz-component.xml Mon Mar 7 10:50:31 2011
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<ofbiz-component name="jcr"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+ <resource-loader name="main" type="component"/>
+ <classpath type="dir" location="config"/>
+ <classpath type="jar" location="build/lib/*"/>
+ <classpath type="jar" location="lib/*"/>
+</ofbiz-component>
+
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/JackrabbitContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/JackrabbitContainer.java?rev=1078740&view=auto
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/JackrabbitContainer.java (added)
+++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/JackrabbitContainer.java Mon Mar 7 10:50:31 2011
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.jcr;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import javax.jcr.Credentials;
+import javax.jcr.LoginException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.naming.Reference;
+
+import org.apache.jackrabbit.core.TransientRepository;
+import org.ofbiz.base.container.Container;
+import org.ofbiz.base.container.ContainerConfig;
+import org.ofbiz.base.container.ContainerException;
+import org.ofbiz.base.location.FlexibleLocation;
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.entity.Delegator;
+import org.ofbiz.entity.DelegatorFactory;
+import org.ofbiz.entity.GenericEntityException;
+import org.ofbiz.entity.GenericValue;
+
+/**
+ * A container for a local JCR-compliant content repository. The current
+ * implementation uses Apache Jackrabbit.
+ */
+public class JackrabbitContainer implements Container {
+
+ public static final String module = JackrabbitContainer.class.getName();
+
+ private static File homeDir = null;
+ private static File jackrabbitConfigFile = null;
+ private static String jndiName;
+ protected static Repository repository;
+ private static Session session;
+
+ @Override
+ public void init(String[] args, String configFile) throws ContainerException {
+ ContainerConfig.Container cc = ContainerConfig.getContainer("jackrabbit", configFile);
+ String homeDirURL;
+ try {
+ homeDirURL = ContainerConfig.getPropertyValue(cc, "repHomeDir", "runtime/data/jackrabbit/");
+ jndiName = ContainerConfig.getPropertyValue(cc, "jndiName", "jcr/local");
+ homeDir = new File(homeDirURL);
+ URL jackrabbitConfigUrl = FlexibleLocation.resolveLocation(ContainerConfig.getPropertyValue(cc, "configFilePath", "framework/jackrabbit/config/jackrabbit.xml"));
+ jackrabbitConfigFile = new File(jackrabbitConfigUrl.toURI());
+
+ } catch (MalformedURLException e) {
+ Debug.logError(e, module);
+ } catch (URISyntaxException e) {
+ Debug.logError(e, module);
+ }
+ }
+
+ @Override
+ public boolean start() throws ContainerException {
+ repository = new TransientRepository(jackrabbitConfigFile, homeDir);
+ try {
+ Delegator delegator = DelegatorFactory.getDelegator("default");
+ GenericValue userLogin = delegator.findOne("UserLogin", true, "userLoginId", "system");
+ // Open a session to get the repo running
+ session = JackrabbitContainer.getUserSession(userLogin);
+ } catch (LoginException e) {
+ Debug.logError(e, module);
+ } catch (RepositoryException e) {
+ Debug.logError(e, module);
+ } catch (GenericEntityException e) {
+ Debug.logError(e, module);
+ }
+ try {
+ Reference ref = new Reference(Repository.class.getName(), LocalRepositoryFactory.class.getName(), null);
+ Context context = new InitialContext();
+ context.bind(jndiName, ref);
+ } catch (NamingException e) {
+ Debug.logError(e, module);
+ }
+ // Test JNDI bind
+ RepositoryFactory.getRepository();
+ return true;
+ }
+
+ @Override
+ public void stop() throws ContainerException {
+ try {
+ Context context = new InitialContext();
+ context.unbind(jndiName);
+ } catch (NamingException e) {
+ Debug.logError(e, module);
+ }
+ if (session != null) {
+ session.logout();
+ }
+ if (repository != null) {
+ // Not needed - Jackrabbit shuts down when the session is closed
+// repository.shutdown();
+ }
+ }
+
+ public static Session getUserSession(GenericValue userLogin) throws RepositoryException {
+ String currentPassword = userLogin.getString("currentPassword") == null ? "" : userLogin.getString("currentPassword");
+ Credentials creds = new SimpleCredentials(userLogin.getString("userLoginId"), currentPassword.toCharArray());
+ return repository.login(creds);
+ }
+}
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/JcrRepositoryFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/JcrRepositoryFactory.java?rev=1078740&view=auto
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/JcrRepositoryFactory.java (added)
+++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/JcrRepositoryFactory.java Mon Mar 7 10:50:31 2011
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.jcr;
+
+import javax.jcr.Repository;
+
+public interface JcrRepositoryFactory {
+ /**
+ *
+ * @param repositoryName The name specified in the <code>jcr-repositories.xml</code> file
+ * @return
+ */
+ Repository getInstance(String repositoryName);
+}
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/LocalRepositoryFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/LocalRepositoryFactory.java?rev=1078740&view=auto
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/LocalRepositoryFactory.java (added)
+++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/LocalRepositoryFactory.java Mon Mar 7 10:50:31 2011
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.jcr;
+
+import java.util.Hashtable;
+
+import javax.jcr.Repository;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.Reference;
+import javax.naming.spi.ObjectFactory;
+
+/**
+ * A JNDI <code>ObjectFactory</code> that returns a <code>javax.jcr.Repository</code>
+ * instance.
+ */
+public class LocalRepositoryFactory implements ObjectFactory {
+
+ @Override
+ public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
+ if (obj instanceof Reference) {
+ Reference ref = (Reference)obj;
+ if (ref.getClassName().equals(Repository.class.getName())) {
+ return JackrabbitContainer.repository;
+ }
+ }
+ return null;
+ }
+}
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/OFBizLoginModule.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/OFBizLoginModule.java?rev=1078740&view=auto
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/OFBizLoginModule.java (added)
+++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/OFBizLoginModule.java Mon Mar 7 10:50:31 2011
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.jcr;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.security.auth.Subject;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import javax.security.auth.login.LoginException;
+import javax.security.auth.spi.LoginModule;
+
+import javolution.util.FastMap;
+
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.Delegator;
+import org.ofbiz.entity.DelegatorFactory;
+import org.ofbiz.entity.GenericEntityException;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.service.GenericDispatcher;
+import org.ofbiz.service.GenericServiceException;
+import org.ofbiz.service.LocalDispatcher;
+import org.ofbiz.service.ServiceUtil;
+
+public class OFBizLoginModule implements LoginModule {
+
+ public static final String module = OFBizLoginModule.class.getName();
+
+ protected Subject subject;
+ protected CallbackHandler callbackHandler;
+ protected Map<String, ?> sharedState;
+ protected Map<String, ?> options;
+
+ private Delegator delegator;
+ private LocalDispatcher dispatcher;
+
+ private GenericValue userLogin;
+
+ @Override
+ public boolean abort() throws LoginException {
+ return logout();
+ }
+
+ @Override
+ public boolean commit() throws LoginException {
+ if (userLogin != null) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) {
+ // get the delegator
+ delegator = DelegatorFactory.getDelegator("default");
+
+ // get the dispatcher
+ dispatcher = GenericDispatcher.getLocalDispatcher("auth-dispatcher", delegator);
+
+ this.subject = subject;
+ this.callbackHandler = callbackHandler;
+ this.sharedState = sharedState;
+ this.options = options;
+
+ if (options != null) {
+ for (Map.Entry<String, ?> option : options.entrySet()) {
+ Debug.logWarning("OFBizLoginModule does not support provided option [" + option.getKey() + "] with value [" + option.getValue() + "], ignoring", module);
+ }
+ }
+ }
+
+ @Override
+ public boolean login() throws LoginException {
+ NameCallback nameCallback = new NameCallback("userLoginId");
+ PasswordCallback passwordCallback = new PasswordCallback("currentPassword", false);
+ Callback[] callbacks = new Callback[]{nameCallback, passwordCallback};
+ try {
+ callbackHandler.handle(callbacks);
+ } catch (IOException e) {
+ Debug.logError(e, module);
+ throw new LoginException(e.getMessage());
+ } catch (UnsupportedCallbackException e) {
+ Debug.logError(e, module);
+ throw new LoginException(e.getMessage());
+ }
+
+ String userLoginId = nameCallback.getName();
+ String password = String.valueOf(passwordCallback.getPassword());
+ passwordCallback.clearPassword();
+ // try matching against the encrypted password
+ try {
+ GenericValue newUserLogin = delegator.findOne("UserLogin", false, "userLoginId", userLoginId);
+ if (newUserLogin.getString("currentPassword") == null || newUserLogin.getString("currentPassword").equals(password)) {
+ userLogin = newUserLogin;
+ return true;
+ }
+ } catch (GenericEntityException e) {
+ Debug.logError(e, module);
+ }
+ // plain text password
+ if (UtilValidate.isNotEmpty(password)) {
+ Map<String, Object> loginCtx = FastMap.newInstance();
+ loginCtx.put("login.username", userLoginId);
+ loginCtx.put("login.password", password);
+ try {
+ Map<String, ? extends Object> result = dispatcher.runSync("userLogin", loginCtx);
+ if (ServiceUtil.isSuccess(result)) {
+ userLogin = (GenericValue) result.get("userLogin");
+ return true;
+ }
+ } catch (GenericServiceException e) {
+ Debug.logError(e, module);
+ throw new LoginException(e.getMessage());
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public boolean logout() throws LoginException {
+ userLogin = null;
+ return true;
+ }
+
+}
Added: ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/RepositoryFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/RepositoryFactory.java?rev=1078740&view=auto
==============================================================================
--- ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/RepositoryFactory.java (added)
+++ ofbiz/branches/jackrabbit20100709/framework/jcr/src/org/ofbiz/jcr/RepositoryFactory.java Mon Mar 7 10:50:31 2011
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *******************************************************************************/
+package org.ofbiz.jcr;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.Repository;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.base.util.UtilXml;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+public class RepositoryFactory {
+
+ public static final String module = RepositoryFactory.class.getName();
+ private static final Map<String, Repository> repositoryMap = createRepositoryMap();
+
+ private static Repository createFromFactory(String repositoryName, ClassLoader loader, String className) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+ JcrRepositoryFactory factory = (JcrRepositoryFactory) loader.loadClass(className).newInstance();
+ return factory.getInstance(repositoryName);
+ }
+
+ private static Map<String, Repository> createRepositoryMap() {
+ Map<String, Repository> result = new HashMap<String, Repository>();
+ loadRepositories(result);
+ Debug.logInfo("Repositories loaded: " + result.size(), module);
+ return Collections.unmodifiableMap(result);
+ }
+
+ /**
+ * Returns the default repository.
+ *
+ * @return
+ */
+ public static Repository getRepository() {
+ return repositoryMap.get("default");
+ }
+
+ /**
+ * Returns the specified repository, or <code>null</code> if the
+ * specified repository doesn't exist.
+ *
+ * @param name
+ * @return
+ */
+ public static Repository getRepository(String name) {
+ return repositoryMap.get(name);
+ }
+
+ private static void loadRepositories(Map<String, Repository> map) {
+ ClassLoader loader = Thread.currentThread().getContextClassLoader();
+ Enumeration<URL> resources;
+ try {
+ resources = loader.getResources("jcr-repositories.xml");
+ } catch (IOException e) {
+ Debug.logError(e, "Could not load list of jcr-repositories.xml", module);
+ return;
+ }
+ while (resources.hasMoreElements()) {
+ URL repositoriesURL = resources.nextElement();
+ Debug.logInfo("Loading repositories from: " + repositoriesURL, module);
+ Document doc = null;
+ try {
+ doc = UtilXml.readXmlDocument(repositoriesURL, false);
+ } catch (Exception e) {
+ Debug.logError(e, module);
+ continue;
+ }
+ Element resourceElement = doc.getDocumentElement();
+ List<? extends Element> repositoryList = UtilXml.childElementList(resourceElement, "repository");
+ for (Element element : repositoryList) {
+ String name = element.getAttribute("name");
+ if (UtilValidate.isEmpty(name)) {
+ continue;
+ }
+ String jndiName = element.getAttribute("jndi-name");
+ if (UtilValidate.isNotEmpty(jndiName)) {
+ try {
+ map.put(name, (Repository) new InitialContext().lookup(jndiName));
+ } catch (NamingException e) {
+ Debug.logError(e, module);
+ }
+ continue;
+ }
+ String className = element.getAttribute("class-name");
+ if (UtilValidate.isNotEmpty(className)) {
+ try {
+ map.put(name, createFromFactory(name, loader, className));
+ } catch (Exception e) {
+ Debug.logError(e, module);
+ }
+ }
+ }
+ }
+
+ }
+
+ private RepositoryFactory() {}
+}