[jboss-svn-commits] JBL Code SVN: r35625 - in labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo: drools-repository/src/test/resources and 10 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Oct 20 23:53:31 EDT 2010


Author: kurt.stam at jboss.com
Date: 2010-10-20 23:53:30 -0400 (Wed, 20 Oct 2010)
New Revision: 35625

Added:
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/configuration.xml
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/jaas.conf.xml
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/roles.properties
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/users.properties
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/pom.xml
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/java/
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/java/META-INF/
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/java/META-INF/MANIFEST.MF
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/java/org/
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/java/org/drools/
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/java/org/drools/repository/
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/java/org/drools/repository/modeshape/
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfigurator.java
Removed:
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/configuration.xml
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/jaas.conf.xml
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/roles.properties
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/users.properties
Modified:
   labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/pom.xml
Log:
BRMS-406 adding the modeshape implementation

Copied: labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape (from rev 35609, labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository/src/test/resources/modeshape)

Deleted: labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/configuration.xml
===================================================================
--- labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository/src/test/resources/modeshape/configuration.xml	2010-10-20 22:08:08 UTC (rev 35609)
+++ labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/configuration.xml	2010-10-21 03:53:30 UTC (rev 35625)
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-  ~ ModeShape (http://www.modeshape.org)
-  ~
-  ~ See the COPYRIGHT.txt file distributed with this work for information
-  ~ regarding copyright ownership.  Some portions may be licensed
-  ~ to Red Hat, Inc. under one or more contributor license agreements.
-  ~ See the AUTHORS.txt file in the distribution for a full listing of 
-  ~ individual contributors.
-  ~
-  ~ ModeShape is free software. Unless otherwise indicated, all code in ModeShape
-  ~ is licensed to you under the terms of the GNU Lesser General Public License as
-  ~ published by the Free Software Foundation; either version 2.1 of
-  ~ the License, or (at your option) any later version.
-  ~
-  ~ ModeShape is distributed in the hope that it will be useful,
-  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-  ~ or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
-  ~ for more details.
-  ~
-  ~ You should have received a copy of the GNU Lesser General Public License
-  ~ along with this distribution; if not, write to:
-  ~ Free Software Foundation, Inc.
-  ~ 51 Franklin Street, Fifth Floor
-  ~ Boston, MA  02110-1301  USA
-  -->
-<configuration xmlns:mode="http://www.modeshape.org/1.0"
-               xmlns:jcr="http://www.jcp.org/jcr/1.0"
-               xmlns:nt="http://www.jcp.org/jcr/nt/1.0">
-    <!-- Define the sources from which content is made available.  -->
-    <mode:sources jcr:primaryType="nt:unstructured">
-        <mode:source jcr:name="TransientSource" mode:classname="org.modeshape.graph.connector.inmemory.InMemoryRepositorySource"/>
-    </mode:sources>
-    <!-- JCR Repositories.  This is required, with a separate repository for each JCR repository instance. -->
-    <mode:repositories>
-        <mode:repository jcr:name="Guvnor JCR Repository" mode:source="TransientSource">
-            <mode:options>
-                <mode:option jcr:name="queryIndexesUpdatedSynchronously" mode:value="true"/>
-            </mode:options>
-        </mode:repository>
-    </mode:repositories>
-</configuration>

Copied: labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/configuration.xml (from rev 35609, labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository/src/test/resources/modeshape/configuration.xml)
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/configuration.xml	                        (rev 0)
+++ labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/configuration.xml	2010-10-21 03:53:30 UTC (rev 35625)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+  ~ ModeShape (http://www.modeshape.org)
+  ~
+  ~ See the COPYRIGHT.txt file distributed with this work for information
+  ~ regarding copyright ownership.  Some portions may be licensed
+  ~ to Red Hat, Inc. under one or more contributor license agreements.
+  ~ See the AUTHORS.txt file in the distribution for a full listing of 
+  ~ individual contributors.
+  ~
+  ~ ModeShape is free software. Unless otherwise indicated, all code in ModeShape
+  ~ is licensed to you under the terms of the GNU Lesser General Public License as
+  ~ published by the Free Software Foundation; either version 2.1 of
+  ~ the License, or (at your option) any later version.
+  ~
+  ~ ModeShape is distributed in the hope that it will be useful,
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+  ~ or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
+  ~ for more details.
+  ~
+  ~ You should have received a copy of the GNU Lesser General Public License
+  ~ along with this distribution; if not, write to:
+  ~ Free Software Foundation, Inc.
+  ~ 51 Franklin Street, Fifth Floor
+  ~ Boston, MA  02110-1301  USA
+  -->
+<configuration xmlns:mode="http://www.modeshape.org/1.0"
+               xmlns:jcr="http://www.jcp.org/jcr/1.0"
+               xmlns:nt="http://www.jcp.org/jcr/nt/1.0">
+    <!-- Define the sources from which content is made available.  -->
+    <mode:sources jcr:primaryType="nt:unstructured">
+        <mode:source jcr:name="TransientSource" mode:classname="org.modeshape.graph.connector.inmemory.InMemoryRepositorySource"/>
+    </mode:sources>
+    <!-- JCR Repositories.  This is required, with a separate repository for each JCR repository instance. -->
+    <mode:repositories>
+        <mode:repository jcr:name="Guvnor JCR Repository" mode:source="TransientSource">
+            <mode:options>
+                <mode:option jcr:name="queryIndexesUpdatedSynchronously" mode:value="true"/>
+            </mode:options>
+        </mode:repository>
+    </mode:repositories>
+</configuration>

Deleted: labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/jaas.conf.xml
===================================================================
--- labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository/src/test/resources/modeshape/jaas.conf.xml	2010-10-20 22:08:08 UTC (rev 35609)
+++ labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/jaas.conf.xml	2010-10-21 03:53:30 UTC (rev 35625)
@@ -1,18 +0,0 @@
-<?xml version='1.0'?>
-
-<policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:schemaLocation="urn:jboss:security-config:5.0" xmlns="urn:jboss:security-config:5.0"
-        xmlns:jbxb="urn:jboss:security-config:5.0">
-        <application-policy name="modeshape-jcr">
-                <authentication>
-                        <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
-                <module-option name="usersProperties">modeshape/users.properties</module-option>
-                <module-option name="rolesProperties">modeshape/roles.properties</module-option>
-                                <module-option name="name">1.1</module-option>
-                                <module-option name="succeed">true</module-option>
-                                <module-option name="throwEx">false</module-option>
-                        </login-module>
-                </authentication>        
-        </application-policy>
-</policy>
-                
\ No newline at end of file

Copied: labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/jaas.conf.xml (from rev 35609, labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository/src/test/resources/modeshape/jaas.conf.xml)
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/jaas.conf.xml	                        (rev 0)
+++ labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/jaas.conf.xml	2010-10-21 03:53:30 UTC (rev 35625)
@@ -0,0 +1,18 @@
+<?xml version='1.0'?>
+
+<policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="urn:jboss:security-config:5.0" xmlns="urn:jboss:security-config:5.0"
+        xmlns:jbxb="urn:jboss:security-config:5.0">
+        <application-policy name="modeshape-jcr">
+                <authentication>
+                        <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
+                <module-option name="usersProperties">modeshape/users.properties</module-option>
+                <module-option name="rolesProperties">modeshape/roles.properties</module-option>
+                                <module-option name="name">1.1</module-option>
+                                <module-option name="succeed">true</module-option>
+                                <module-option name="throwEx">false</module-option>
+                        </login-module>
+                </authentication>        
+        </application-policy>
+</policy>
+                
\ No newline at end of file

Deleted: labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/roles.properties
===================================================================
--- labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository/src/test/resources/modeshape/roles.properties	2010-10-20 22:08:08 UTC (rev 35609)
+++ labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/roles.properties	2010-10-21 03:53:30 UTC (rev 35625)
@@ -1,3 +0,0 @@
-alan_parsons=admin
-ADMINISTRATOR=admin
-fdd=readwrite

Copied: labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/roles.properties (from rev 35609, labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository/src/test/resources/modeshape/roles.properties)
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/roles.properties	                        (rev 0)
+++ labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/roles.properties	2010-10-21 03:53:30 UTC (rev 35625)
@@ -0,0 +1,3 @@
+alan_parsons=admin
+ADMINISTRATOR=admin
+fdd=readwrite

Deleted: labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/users.properties
===================================================================
--- labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository/src/test/resources/modeshape/users.properties	2010-10-20 22:08:08 UTC (rev 35609)
+++ labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/users.properties	2010-10-21 03:53:30 UTC (rev 35625)
@@ -1,3 +0,0 @@
-alan_parsons=password
-ADMINISTRATOR=password
-fdd=password

Copied: labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/users.properties (from rev 35609, labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository/src/test/resources/modeshape/users.properties)
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/users.properties	                        (rev 0)
+++ labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/drools-repository/src/test/resources/modeshape/users.properties	2010-10-21 03:53:30 UTC (rev 35625)
@@ -0,0 +1,3 @@
+alan_parsons=password
+ADMINISTRATOR=password
+fdd=password

Added: labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/pom.xml
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/pom.xml	                        (rev 0)
+++ labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/pom.xml	2010-10-21 03:53:30 UTC (rev 35625)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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>
+      <artifactId>drools</artifactId>
+      <groupId>org.drools</groupId>
+      <version>5.1.0.BRMS</version>
+   </parent>
+   <artifactId>drools-repository-jcr-ms</artifactId>
+   <packaging>jar</packaging>
+   <name>Drools :: Repository :: ModeShape</name>
+   
+   <dependencies>
+      
+      <dependency>
+	      <artifactId>drools-repository-jcr-api</artifactId>
+	      <groupId>org.drools</groupId>
+	      <version>5.1.0.BRMS</version>
+      </dependency>
+       <dependency>
+        <groupId>org.modeshape</groupId>
+        <artifactId>modeshape-jcr</artifactId>
+        <version>2.3-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.security</groupId>
+        <artifactId>jboss-idtrust</artifactId>
+        <version>2.0.2.CR1</version>
+      </dependency>
+	    <dependency>
+	      <groupId>com.google.collections</groupId>
+	      <artifactId>google-collections</artifactId>
+        <version>1.0</version>
+	    </dependency>
+      <dependency>
+        <groupId>org.jboss.security</groupId>
+        <artifactId>jboss-security-spi-bare</artifactId>
+        <version>2.0.2.SP6</version>
+        <!--   <scope>test</scope> -->
+      </dependency>
+      <dependency>
+        <groupId>org.jboss.security</groupId>
+        <artifactId>jbosssx-bare</artifactId>
+        <version>2.0.2.SP6</version>
+        <!-- <scope>test</scope>  -->
+        <exclusions>
+          <exclusion>
+            <groupId>apache-xalan</groupId>
+            <artifactId>xalan</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>apache-xalan</groupId>
+            <artifactId>serializer</artifactId>
+          </exclusion>
+        </exclusions>
+      </dependency>
+      
+   </dependencies>
+</project>

Added: labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/java/META-INF/MANIFEST.MF	                        (rev 0)
+++ labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/java/META-INF/MANIFEST.MF	2010-10-21 03:53:30 UTC (rev 35625)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

Added: labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfigurator.java
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfigurator.java	                        (rev 0)
+++ labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/jcr-ms-impl/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfigurator.java	2010-10-21 03:53:30 UTC (rev 35625)
@@ -0,0 +1,48 @@
+package org.drools.repository.modeshape;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.Workspace;
+
+import org.drools.repository.JCRRepositoryConfigurator;
+import org.jboss.security.config.IDTrustConfiguration;
+import org.modeshape.jcr.CndNodeTypeReader;
+
+/**
+ * This specialized {@link JCRRepositoryConfigurator} simply initializes the IDTrust JAAS implementation optionally used by
+ * ModeShape for authentication and authorization.
+ */
+public class ModeShapeRepositoryConfigurator extends JCRRepositoryConfigurator {
+
+    static {
+        // Initialize IDTrust
+        String configFile = "modeshape/jaas.conf.xml";
+        IDTrustConfiguration idtrustConfig = new IDTrustConfiguration();
+        try {
+            idtrustConfig.config(configFile);
+        } catch (Exception ex) {
+            throw new IllegalStateException(ex);
+        }
+    }
+
+    public ModeShapeRepositoryConfigurator() {
+    }
+    
+	public void registerNodeTypesFromCndFile(String cndFileName, Session session, Workspace workspace)
+			throws RepositoryException {
+		CndNodeTypeReader reader = new CndNodeTypeReader(session);
+		try {
+			reader.read(cndFileName);
+			workspace.getNodeTypeManager().registerNodeTypes(reader.getNodeTypeDefinitions(), false);
+		} catch (Exception e) {
+			throw new RepositoryException(e);
+		}
+		
+	}
+	
+    public void shutdown() {
+        if (factory instanceof org.modeshape.jcr.api.RepositoryFactory) {
+            ((org.modeshape.jcr.api.RepositoryFactory)factory).shutdown();
+        }
+    }
+}

Modified: labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/pom.xml
===================================================================
--- labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/pom.xml	2010-10-21 03:27:14 UTC (rev 35624)
+++ labs/jbossrules/soa_branches/BRMS-5.1.1/drools-repo/pom.xml	2010-10-21 03:53:30 UTC (rev 35625)
@@ -14,5 +14,8 @@
      <module>drools-repository</module>
      <module>jcr-api</module>
      <module>jcr-jr-impl</module>
+     <!-- this can be uncommented once we have a modeshape 2.3 release
+     <module>jcr-ms-impl</module>
+     -->
    </modules>
 </project>



More information about the jboss-svn-commits mailing list