[jboss-svn-commits] JBL Code SVN: r34964 - in labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape: src and 9 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Sep 1 16:06:24 EDT 2010
Author: kurt.stam at jboss.com
Date: 2010-09-01 16:06:23 -0400 (Wed, 01 Sep 2010)
New Revision: 34964
Added:
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/pom.xml
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/main/
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/main/java/
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/main/java/org/
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/main/java/org/drools/
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/main/java/org/drools/repository/
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/main/java/org/drools/repository/modeshape/
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfigurator.java
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/configuration.xml
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/jaas.conf.xml
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/roles.properties
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/users.properties
Modified:
labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/
Log:
Adding modeshape impl
Property changes on: labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape
___________________________________________________________________
Name: svn:ignore
+ .settings
target
.classpath
.project
Added: labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/pom.xml
===================================================================
--- labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/pom.xml (rev 0)
+++ labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/pom.xml 2010-09-01 20:06:23 UTC (rev 34964)
@@ -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.2.0.SNAPSHOT</version>
+ </parent>
+ <artifactId>drools-repository-jcr-modeshape</artifactId>
+ <packaging>jar</packaging>
+ <name>Drools :: Repository</name>
+
+ <dependencies>
+
+ <dependency>
+ <artifactId>drools-repository-jcr-api</artifactId>
+ <groupId>org.drools</groupId>
+ <version>5.2.0.SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.modeshape</groupId>
+ <artifactId>modeshape-jcr</artifactId>
+ <version>2.2.0.Final</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-rc3</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/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfigurator.java
===================================================================
--- labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfigurator.java (rev 0)
+++ labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/main/java/org/drools/repository/modeshape/ModeShapeRepositoryConfigurator.java 2010-09-01 20:06:23 UTC (rev 34964)
@@ -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();
+ }
+ }
+}
Added: labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/configuration.xml
===================================================================
--- labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/configuration.xml (rev 0)
+++ labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/configuration.xml 2010-09-01 20:06:23 UTC (rev 34964)
@@ -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>
Added: labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/jaas.conf.xml
===================================================================
--- labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/jaas.conf.xml (rev 0)
+++ labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/jaas.conf.xml 2010-09-01 20:06:23 UTC (rev 34964)
@@ -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
Added: labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/roles.properties
===================================================================
--- labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/roles.properties (rev 0)
+++ labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/roles.properties 2010-09-01 20:06:23 UTC (rev 34964)
@@ -0,0 +1,3 @@
+alan_parsons=admin
+ADMINISTRATOR=admin
+fdd=readwrite
Added: labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/users.properties
===================================================================
--- labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/users.properties (rev 0)
+++ labs/jbossrules/branches/kstam_guvnor_modeshape/drools-repository-jcr-modeshape/src/test/resources/modeshape/users.properties 2010-09-01 20:06:23 UTC (rev 34964)
@@ -0,0 +1,3 @@
+alan_parsons=password
+ADMINISTRATOR=password
+fdd=password
More information about the jboss-svn-commits
mailing list