geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r326901 - in /geronimo/trunk/modules/directory: ./ src/java/org/apache/geronimo/directory/ src/schema/ src/test-resources/ src/test/org/apache/geronimo/directory/ src/var/
Date Thu, 20 Oct 2005 13:36:04 GMT
Author: jgenender
Date: Thu Oct 20 06:35:55 2005
New Revision: 326901

URL: http://svn.apache.org/viewcvs?rev=326901&view=rev
Log:
Added xml configuration file

Added:
    geronimo/trunk/modules/directory/src/java/org/apache/geronimo/directory/DirectoryConfigurator.java
    geronimo/trunk/modules/directory/src/schema/
    geronimo/trunk/modules/directory/src/schema/directory.xsd
    geronimo/trunk/modules/directory/src/schema/xmlconfig.xml
    geronimo/trunk/modules/directory/src/test-resources/
    geronimo/trunk/modules/directory/src/test-resources/directory.xml
    geronimo/trunk/modules/directory/src/var/
    geronimo/trunk/modules/directory/src/var/directory.xml
Modified:
    geronimo/trunk/modules/directory/maven.xml
    geronimo/trunk/modules/directory/project.properties
    geronimo/trunk/modules/directory/project.xml
    geronimo/trunk/modules/directory/src/java/org/apache/geronimo/directory/DirectoryGBean.java
    geronimo/trunk/modules/directory/src/test/org/apache/geronimo/directory/RunningTest.java

Modified: geronimo/trunk/modules/directory/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/directory/maven.xml?rev=326901&r1=326900&r2=326901&view=diff
==============================================================================
--- geronimo/trunk/modules/directory/maven.xml (original)
+++ geronimo/trunk/modules/directory/maven.xml Thu Oct 20 06:35:55 2005
@@ -21,7 +21,9 @@
 <project default="default"
     xmlns:j="jelly:core"
     xmlns:define="jelly:define"
-    xmlns:velocity="jelly:velocity">
+    xmlns:velocity="jelly:velocity"
+    xmlns:xmlbeans="xmlbeans2:maven"
+    >
 
     <!-- ==================== -->
     <!-- Default Global Goals -->
@@ -43,6 +45,17 @@
     <preGoal name="test:test">
         <mkdir dir="${maven.build.dir}/var"/>
         <mkdir dir="${maven.build.dir}/var/ldap"/>
+        <copy todir="${maven.build.dir}/var" file="${basedir}/src/test-resources/directory.xml"
/>
+    </preGoal>
+
+    <preGoal name="java:compile">
+        <xmlbeans:schema2java
+            maven.xmlbeans2.sourceschema="schema/directory.xsd"/>
+        <mkdir dir="${basedir}/target/xmlbeans-classes"/>
+        <mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
+        <copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">
+            <fileset dir="${basedir}/target/classes/schemaorg_apache_xmlbeans"/>
+        </copy>
     </preGoal>
 
 </project>

Modified: geronimo/trunk/modules/directory/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/directory/project.properties?rev=326901&r1=326900&r2=326901&view=diff
==============================================================================
--- geronimo/trunk/modules/directory/project.properties (original)
+++ geronimo/trunk/modules/directory/project.properties Thu Oct 20 06:35:55 2005
@@ -4,3 +4,8 @@
 
 maven.junit.jvmargs=-Djava.endorsed.dirs=${maven.build.dir}/endorsed -ea 
 maven.junit.fork=true
+
+maven.eclipse.classpath.include=${basedir}/target/xmlbeans,${basedir}/target/xmlbeans-classes
+
+maven.idea.generated.source=xmlbeans
+

Modified: geronimo/trunk/modules/directory/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/directory/project.xml?rev=326901&r1=326900&r2=326901&view=diff
==============================================================================
--- geronimo/trunk/modules/directory/project.xml (original)
+++ geronimo/trunk/modules/directory/project.xml Thu Oct 20 06:35:55 2005
@@ -226,5 +226,26 @@
                 <repository>true</repository>
             </properties>
         </dependency>
+
+       <dependency>
+            <groupId>xmlbeans</groupId>
+            <artifactId>xmlbeans-maven-plugin</artifactId>
+            <version>${xmlbeans_maven_plugin_version}</version>
+            <type>plugin</type>
+        </dependency>
+
+        <!-- needed for xmlbeans runtime-->
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+            <version>${stax_api_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>xmlbeans</groupId>
+            <artifactId>xbean</artifactId>
+            <version>${xmlbeans_version}</version>
+        </dependency>
+
     </dependencies>
 </project>

Added: geronimo/trunk/modules/directory/src/java/org/apache/geronimo/directory/DirectoryConfigurator.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/directory/src/java/org/apache/geronimo/directory/DirectoryConfigurator.java?rev=326901&view=auto
==============================================================================
--- geronimo/trunk/modules/directory/src/java/org/apache/geronimo/directory/DirectoryConfigurator.java
(added)
+++ geronimo/trunk/modules/directory/src/java/org/apache/geronimo/directory/DirectoryConfigurator.java
Thu Oct 20 06:35:55 2005
@@ -0,0 +1,169 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ *  Licensed 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.apache.geronimo.directory;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.xml.namespace.QName;
+
+import org.apache.geronimo.xbeans.geronimo.directory.DirDirectoryConfigurationDocument;
+import org.apache.geronimo.xbeans.geronimo.directory.DirAttributeDocument.Attribute;
+import org.apache.geronimo.xbeans.geronimo.directory.DirBootStrapSchemasDocument.BootStrapSchemas;
+import org.apache.geronimo.xbeans.geronimo.directory.DirContextEntryDocument.ContextEntry;
+import org.apache.geronimo.xbeans.geronimo.directory.DirDirectoryConfigurationDocument.DirectoryConfiguration;
+import org.apache.geronimo.xbeans.geronimo.directory.DirIndexedAttributesDocument.IndexedAttributes;
+import org.apache.geronimo.xbeans.geronimo.directory.DirPartitionDocument.Partition;
+import org.apache.geronimo.xbeans.geronimo.directory.DirPartitionsDocument.Partitions;
+import org.apache.ldap.server.configuration.MutableContextPartitionConfiguration;
+import org.apache.xmlbeans.XmlCursor;
+import org.apache.xmlbeans.XmlDocumentProperties;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlOptions;
+
+public class DirectoryConfigurator {
+
+    public DirectoryConfigurator() {
+    }
+
+    public void configure(ClassLoader cl,
+            MutableServerStartupConfiguration startup, File file)
+            throws Exception {
+        DirDirectoryConfigurationDocument doc = parse(file);
+        DirectoryConfiguration dirConfig = doc.getDirectoryConfiguration();
+
+        Partitions partitions = dirConfig.getPartitions();
+        if (partitions != null) {
+            Partition partitionList[] = partitions.getPartitionArray();
+            if (partitionList != null) {
+                Set partition = new HashSet();
+                for (int i = 0; i < partitionList.length; i++) {
+                    partition.add(processPartition(partitionList[i]));
+                }
+                startup.setContextPartitionConfigurations(partition);
+            }
+        }
+
+        BootStrapSchemas schemas = dirConfig.getBootStrapSchemas();
+        if (schemas != null) {
+            String schemaList[] = schemas.getSchemaArray();
+            if (schemaList != null) {
+                Set bootStrapSchemas = new HashSet();
+                for (int i = 0; i < schemaList.length; i++) {
+                    Class clazz = cl.loadClass(schemaList[i]);
+                    bootStrapSchemas.add(clazz.newInstance());
+                }
+                startup.setBootstrapSchemas(bootStrapSchemas);
+            }
+        }
+    }
+
+    private MutableContextPartitionConfiguration processPartition(
+            Partition partition) {
+        MutableContextPartitionConfiguration mcpc = new MutableContextPartitionConfiguration();
+        mcpc.setName(partition.getName());
+        mcpc.setSuffix(partition.getSuffix());
+        IndexedAttributes indexedAttributes = partition.getIndexedAttributes();
+        if (indexedAttributes != null) {
+            String attributeList[] = indexedAttributes
+                    .getIndexedAttributeArray();
+            if (attributeList != null) {
+                Set set = new HashSet();
+                for (int i = 0; i < attributeList.length; i++) {
+                    set.add(attributeList[i]);
+                }
+                mcpc.setIndexedAttributes(set);
+            }
+        }
+
+        ContextEntry contextEntry = partition.getContextEntry();
+        if (contextEntry != null) {
+            Attribute[] attributeList = contextEntry.getAttributeArray();
+            if (attributeList != null) {
+                BasicAttributes attrs = new BasicAttributes(true);
+                for (int i = 0; i < attributeList.length; i++) {
+                    BasicAttribute attr = new BasicAttribute(attributeList[i]
+                            .getId());
+                    String values[] = attributeList[i].getValueArray();
+                    for (int j = 0; j < values.length; j++) {
+                        attr.add(values[j]);
+                    }
+                    attrs.put(attr);
+                }
+                mcpc.setContextEntry(attrs);
+            }
+        }
+
+        return mcpc;
+    }
+
+    private DirDirectoryConfigurationDocument parse(File file) throws Exception {
+        ArrayList errors = new ArrayList();
+        XmlObject config = XmlObject.Factory.parse(file,
+                createXmlOptions(errors));
+
+        if (errors.size() != 0) {
+            throw new XmlException(errors.toArray().toString());
+        }
+
+        if (DirDirectoryConfigurationDocument.type.equals(config.schemaType())) {
+            validateDD(config);
+            return (DirDirectoryConfigurationDocument) config;
+        }
+
+        // If we got here, we will fail due to bad XML. We are doing this get an
+        // explicit error message
+        XmlObject result = config
+                .changeType(DirDirectoryConfigurationDocument.type);
+        validateDD(result);
+        return (DirDirectoryConfigurationDocument) result;
+    }
+
+    private XmlOptions createXmlOptions(Collection errors) {
+        Map NAMESPACE_UPDATES = new HashMap();
+        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/directory",
+                "http://geronimo.apache.org/xml/ns/directory-1.0");
+        XmlOptions options = new XmlOptions();
+        options.setLoadLineNumbers();
+        options.setErrorListener(errors);
+        options.setLoadSubstituteNamespaces(NAMESPACE_UPDATES);
+        options.setUseDefaultNamespace();
+        return options;
+    }
+
+    private void validateDD(XmlObject dd) throws XmlException {
+        XmlOptions xmlOptions = new XmlOptions();
+        xmlOptions.setDocumentType(DirDirectoryConfigurationDocument.type);
+        xmlOptions.setLoadLineNumbers();
+        xmlOptions.setUseDefaultNamespace();
+        Collection errors = new ArrayList();
+        xmlOptions.setErrorListener(errors);
+        if (!dd.validate(xmlOptions)) {
+            throw new XmlException("Invalid directory descriptor: " + errors
+                    + "\nDescriptor: " + dd.toString(), null, errors);
+        }
+        // System.out.println("descriptor: " + dd.toString());
+    }
+}

Modified: geronimo/trunk/modules/directory/src/java/org/apache/geronimo/directory/DirectoryGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/directory/src/java/org/apache/geronimo/directory/DirectoryGBean.java?rev=326901&r1=326900&r2=326901&view=diff
==============================================================================
--- geronimo/trunk/modules/directory/src/java/org/apache/geronimo/directory/DirectoryGBean.java
(original)
+++ geronimo/trunk/modules/directory/src/java/org/apache/geronimo/directory/DirectoryGBean.java
Thu Oct 20 06:35:55 2005
@@ -17,10 +17,17 @@
 
 package org.apache.geronimo.directory;
 
+import java.io.File;
+import java.io.FileInputStream;
 import java.net.InetAddress;
+import java.util.HashSet;
+import java.util.Hashtable;
 import java.util.Properties;
+import java.util.Set;
 
 import javax.naming.Context;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
 import javax.naming.directory.InitialDirContext;
 
 import org.apache.commons.logging.Log;
@@ -29,6 +36,7 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.ldap.server.configuration.MutableContextPartitionConfiguration;
 import org.apache.ldap.server.configuration.ShutdownConfiguration;
 import org.apache.ldap.server.jndi.CoreContextFactory;
 
@@ -51,6 +59,7 @@
     private int port = 389;
     private InetAddress host = null;
     private boolean enableNetworking;
+    private final String configFile;
     
     /**
      * Geronimo class loader
@@ -58,7 +67,7 @@
     private ClassLoader classLoader;
 
     public DirectoryGBean(ClassLoader classLoader, String workingDir, 
-            boolean anonymousAccess, 
+            boolean anonymousAccess, String configFile,
             ServerInfo serverInfo) {
         
         if (serverInfo == null)
@@ -71,6 +80,7 @@
         
         this.classLoader = classLoader;
         this.anonymousAccess = anonymousAccess;
+        this.configFile = configFile;
         this.serverInfo = serverInfo;
         setHost("0.0.0.0");
     }
@@ -184,15 +194,21 @@
         startup.setEnableNetworking(enableNetworking);
         startup.setHost(host);
         
+        if (configFile != null){
+            File f = serverInfo.resolve(configFile);
+            DirectoryConfigurator dc = new DirectoryConfigurator();
+            dc.configure(classLoader, startup, f);
+        }
+        
         Properties env = new Properties();
         env.putAll(startup.toJndiEnvironment());
         env.put( Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName());
         setEnvironment(env);
         
-        //Load the proper class for th Context Loader
+        //Load the proper class for the Context Loader
         ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
         Thread.currentThread().setContextClassLoader(classLoader);
-        
+
         //Fire it up
         new InitialDirContext( env );
         
@@ -239,9 +255,10 @@
         
         infoFactory.addAttribute("workingDir", String.class, true);
         infoFactory.addAttribute("anonymousAccess", boolean.class, true);
+        infoFactory.addAttribute("configFile", String.class, true);
         infoFactory.addReference("ServerInfo", ServerInfo.class, "GBean");
 
-        infoFactory.setConstructor(new String[] { "classLoader", "workingDir", "anonymousAccess",
"ServerInfo" });
+        infoFactory.setConstructor(new String[] { "classLoader", "workingDir", "anonymousAccess",
"configFile", "ServerInfo" });
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 

Added: geronimo/trunk/modules/directory/src/schema/directory.xsd
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/directory/src/schema/directory.xsd?rev=326901&view=auto
==============================================================================
--- geronimo/trunk/modules/directory/src/schema/directory.xsd (added)
+++ geronimo/trunk/modules/directory/src/schema/directory.xsd Thu Oct 20 06:35:55 2005
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2004-2005 The Apache Software Foundation
+
+    Licensed 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.
+-->
+<xs:schema 
+  xmlns:directory="http://geronimo.apache.org/xml/ns/directory-1.0"
+  targetNamespace="http://geronimo.apache.org/xml/ns/directory-1.0"
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  elementFormDefault="qualified"
+  attributeFormDefault="unqualified"
+  version="1.0">
+  <xs:element name="directory-configuration">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="directory:partitions"/>
+        <xs:element minOccurs="0" ref="directory:bootStrapSchemas"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="partitions">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="directory:partition"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="partition">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="directory:suffix"/>
+        <xs:element ref="directory:indexedAttributes"/>
+        <xs:element ref="directory:contextEntry"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="suffix" type="xs:string"/>
+  <xs:element name="indexedAttributes">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="directory:indexedAttribute"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="indexedAttribute" type="xs:string"/>
+  <xs:element name="contextEntry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="directory:attribute"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bootStrapSchemas">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="directory:schema"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="schema" type="xs:string"/>
+  <xs:element name="attribute">
+    <xs:complexType mixed="true">
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="directory:value"/>
+      </xs:sequence>
+      <xs:attribute name="id" type="xs:string"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="value" type="xs:string"/>
+</xs:schema>

Added: geronimo/trunk/modules/directory/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/directory/src/schema/xmlconfig.xml?rev=326901&view=auto
==============================================================================
--- geronimo/trunk/modules/directory/src/schema/xmlconfig.xml (added)
+++ geronimo/trunk/modules/directory/src/schema/xmlconfig.xml Thu Oct 20 06:35:55 2005
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2005 The Apache Software Foundation
+
+    Licensed 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.
+-->
+<!-- @version $Rev: 57116 $ $Date: 2004-11-09 18:34:38 -0700 (Tue, 09 Nov 2004) $ -->
+<xb:config xmlns:xb="http://www.bea.com/2002/09/xbean/config">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/directory-1.0">
+        <xb:package>org.apache.geronimo.xbeans.geronimo.directory</xb:package>
+        <xb:prefix>Dir</xb:prefix>
+    </xb:namespace>
+</xb:config>

Added: geronimo/trunk/modules/directory/src/test-resources/directory.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/directory/src/test-resources/directory.xml?rev=326901&view=auto
==============================================================================
--- geronimo/trunk/modules/directory/src/test-resources/directory.xml (added)
+++ geronimo/trunk/modules/directory/src/test-resources/directory.xml Thu Oct 20 06:35:55
2005
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2004-2005 The Apache Software Foundation
+
+    Licensed 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.
+-->
+<directory-configuration xmlns="http://geronimo.apache.org/xml/ns/directory-1.0">
+    <partitions>
+        <partition name="apache">
+            <suffix>dc=apache,dc=org</suffix>
+            <indexedAttributes>
+                <indexedAttribute>objectClass</indexedAttribute>
+                <indexedAttribute>ou</indexedAttribute>
+                <indexedAttribute>uid</indexedAttribute>
+            </indexedAttributes>
+            <contextEntry>
+                <attribute id="objectClass">
+                    <value>top</value>
+                    <value>domain</value>
+                    <value>extensibleObject</value>
+                </attribute>
+                <attribute id="dc">
+                    <value>example</value>
+                    <value>attr</value>
+                </attribute>
+            </contextEntry>
+        </partition>
+        <partition name="test">
+            <suffix>ou=test</suffix>
+            <indexedAttributes>
+                <indexedAttribute>objectClass</indexedAttribute>
+                <indexedAttribute>ou</indexedAttribute>
+                <indexedAttribute>uid</indexedAttribute>
+            </indexedAttributes>
+            <contextEntry>
+                <attribute id="objectClass">
+                    <value>top</value>
+                    <value>domain</value>
+                    <value>extensibleObject</value>
+                </attribute>
+                <attribute id="dc">
+                    <value>example</value>
+                    <value>attr</value>
+                </attribute>
+            </contextEntry>
+        </partition>
+    </partitions>
+    <bootStrapSchemas>
+        <schema>org.apache.ldap.server.schema.bootstrap.AutofsSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.CoreSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.CosineSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.CorbaSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.ApacheSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.InetorgpersonSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.JavaSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.Krb5kdcSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.NisSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.SystemSchema</schema>
+    </bootStrapSchemas>
+</directory-configuration>

Modified: geronimo/trunk/modules/directory/src/test/org/apache/geronimo/directory/RunningTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/directory/src/test/org/apache/geronimo/directory/RunningTest.java?rev=326901&r1=326900&r2=326901&view=diff
==============================================================================
--- geronimo/trunk/modules/directory/src/test/org/apache/geronimo/directory/RunningTest.java
(original)
+++ geronimo/trunk/modules/directory/src/test/org/apache/geronimo/directory/RunningTest.java
Thu Oct 20 06:35:55 2005
@@ -116,6 +116,7 @@
         directoryGBean.setAttribute("anonymousAccess", new Boolean(true));
         directoryGBean.setAttribute("enableNetworking", new Boolean(true));
         directoryGBean.setAttribute("port", new Integer(9389));
+        directoryGBean.setAttribute("configFile", "var/directory.xml");
 
         start(directoryGBean);
 

Added: geronimo/trunk/modules/directory/src/var/directory.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/directory/src/var/directory.xml?rev=326901&view=auto
==============================================================================
--- geronimo/trunk/modules/directory/src/var/directory.xml (added)
+++ geronimo/trunk/modules/directory/src/var/directory.xml Thu Oct 20 06:35:55 2005
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2004-2005 The Apache Software Foundation
+
+    Licensed 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.
+-->
+<directory-configuration xmlns="http://geronimo.apache.org/xml/ns/directory-1.0">
+
+    <!-- The following is an example setup of 2 partitions, apache.org and test.
+
+    <partitions>
+
+        <partition name="apache">
+            <suffix>dc=apache,dc=org</suffix>
+            <indexedAttributes>
+                <indexedAttribute>objectClass</indexedAttribute>
+                <indexedAttribute>ou</indexedAttribute>
+                <indexedAttribute>uid</indexedAttribute>
+            </indexedAttributes>
+            <contextEntry>
+                <attribute id="objectClass">
+                    <value>top</value>
+                    <value>domain</value>
+                    <value>extensibleObject</value>
+                </attribute>
+                <attribute id="dc">
+                    <value>example</value>
+                    <value>attr</value>
+                </attribute>
+            </contextEntry>
+        </partition>
+
+        <partition name="test">
+            <suffix>ou=test</suffix>
+            <indexedAttributes>
+                <indexedAttribute>objectClass</indexedAttribute>
+                <indexedAttribute>ou</indexedAttribute>
+                <indexedAttribute>uid</indexedAttribute>
+            </indexedAttributes>
+            <contextEntry>
+                <attribute id="objectClass">
+                    <value>top</value>
+                    <value>domain</value>
+                    <value>extensibleObject</value>
+                </attribute>
+                <attribute id="dc">
+                    <value>example</value>
+                    <value>attr</value>
+                </attribute>
+            </contextEntry>
+        </partition>
+        
+    </partitions>
+
+    This is a boot strap schema configuration
+
+    <bootStrapSchemas>
+        <schema>org.apache.ldap.server.schema.bootstrap.AutofsSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.CoreSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.CosineSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.CorbaSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.ApacheSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.InetorgpersonSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.JavaSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.Krb5kdcSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.NisSchema</schema>
+        <schema>org.apache.ldap.server.schema.bootstrap.SystemSchema</schema>
+    </bootStrapSchemas>
+
+    -->
+</directory-configuration>



Mime
View raw message