directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r666637 - in /directory/shared/branches/bigbang/ldap/src: main/antlr/ main/java/org/apache/directory/shared/ldap/schema/parser/ main/java/org/apache/directory/shared/ldap/schema/syntax/ test/java/org/apache/directory/shared/ldap/schema/pars...
Date Wed, 11 Jun 2008 12:19:17 GMT
Author: seelmann
Date: Wed Jun 11 05:19:17 2008
New Revision: 666637

URL: http://svn.apache.org/viewvc?rev=666637&view=rev
Log:
Fix for DIRSHARED-10: Added support for OpenLDAP object identifier macros

Added:
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OpenLdapObjectIdentifierMacro.java
    directory/shared/branches/bigbang/ldap/src/test/resources/org/
    directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/
    directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/
    directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/
    directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/
    directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/
    directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/
    directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/collective.schema
    directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/core.schema
    directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/dyngroup.schema
    directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/inetorgperson.schema
Modified:
    directory/shared/branches/bigbang/ldap/src/main/antlr/schema-value.g
    directory/shared/branches/bigbang/ldap/src/main/antlr/schema.g
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParser.java
    directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java

Modified: directory/shared/branches/bigbang/ldap/src/main/antlr/schema-value.g
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/antlr/schema-value.g?rev=666637&r1=666636&r2=666637&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/antlr/schema-value.g (original)
+++ directory/shared/branches/bigbang/ldap/src/main/antlr/schema-value.g Wed Jun 11 05:19:17 2008
@@ -70,7 +70,7 @@
 protected NUMBER2 : (DIGIT)+ ;
 protected NUMERICOID : NUMBER ( '.' NUMBER )+ ;
 protected HYPEN : '-';
-protected OTHER : '_' | ';' | '.';
+protected OTHER : '_' | ';' | '.' | ':' ;
 protected DESCR: CHAR ( CHAR | DIGIT | HYPEN )* ;
 protected QUIRKS_DESCR: ( CHAR | DIGIT | HYPEN | OTHER )+ ;
 

Modified: directory/shared/branches/bigbang/ldap/src/main/antlr/schema.g
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/antlr/schema.g?rev=666637&r1=666636&r2=666637&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/antlr/schema.g (original)
+++ directory/shared/branches/bigbang/ldap/src/main/antlr/schema.g Wed Jun 11 05:19:17 2008
@@ -41,7 +41,7 @@
 class AntlrSchemaLexer extends Lexer;
 
 options    {
-    k = 5 ;
+    k = 8 ;
     exportVocab=AntlrSchema ;
     charVocabulary = '\u0000'..'\uFFFE';
     caseSensitive = false ;
@@ -82,6 +82,16 @@
 STRUCTURAL : ( "structural" (WHSP)? ) ;
 protected AUXILIARY : ( "auxiliary" (WHSP)? ) ;
 
+OBJECTIDENTIFIER : 
+    ( "objectidentifier" 
+      WHSP
+      ( oiName:UNQUOTED_STRING ) 
+      WHSP
+      ( oiValue:UNQUOTED_STRING ) 
+    ) 
+    { setText( oiName.getText() + " " + oiValue.getText() ); }
+    ;
+
 OBJECTCLASS : ( "objectclass" (WHSP)? ) ;
 ATTRIBUTETYPE : ( "attributetype" (WHSP)? ) ;
 
@@ -112,7 +122,7 @@
 
 protected VALUES : ( VALUE | LPAR  VALUE ( (DOLLAR)? VALUE )* RPAR ) ;
 protected VALUE : (WHSP)? ( QUOTED_STRING | UNQUOTED_STRING ) (options {greedy=true;}: WHSP)? ;
-protected UNQUOTED_STRING : (options{greedy=true;}: 'a'..'z' | '0'..'9' | '-' | '_' | ';' | '.' )+ ;
+protected UNQUOTED_STRING : (options{greedy=true;}: 'a'..'z' | '0'..'9' | '-' | '_' | ';' | '.' | ':' )+ ;
 protected QUOTED_STRING : ( QUOTE (~'\'')* QUOTE ) ;
 protected FQCN_VALUE : ( FQCN_IDENTIFIER ( '.' FQCN_IDENTIFIER )* ) ;
 protected FQCN_IDENTIFIER : ( FQCN_LETTER ( FQCN_LETTERORDIGIT )* ) ;
@@ -221,19 +231,39 @@
 
 }
 
-openLdapSchema returns [List<AbstractSchemaDescription> list = new ArrayList<AbstractSchemaDescription>()]
+openLdapSchema returns [List<Object> list = new ArrayList<Object>()]
     {
-        AbstractSchemaDescription atd = null;
-        AbstractSchemaDescription ocd = null;
+        AttributeTypeDescription atd = null;
+        ObjectClassDescription ocd = null;
+        OpenLdapObjectIdentifierMacro oloid = null;
     }
     :
-    ( 
+    (
+        oloid = openLdapObjectIdentifier { list.add( oloid ); }
+        |
         atd = openLdapAttributeType { list.add( atd ); }
         |
         ocd = openLdapObjectClass { list.add( ocd ); }
     )*
     ;
 
+openLdapObjectIdentifier returns [OpenLdapObjectIdentifierMacro oloid]
+    {
+        matchedProduction( "openLdapObjectIdentifier()" );
+    }
+    :
+    (
+        oi:OBJECTIDENTIFIER 
+        {
+            String[] nameAndValue = oi.getText().split( " " );
+            oloid = new OpenLdapObjectIdentifierMacro();
+            oloid.setName( nameAndValue[0] );
+            oloid.setRawOidOrNameSuffix( nameAndValue[1] );
+        }
+    )
+    ;
+    
+
 openLdapObjectClass returns [ObjectClassDescription ocd]
     {
         matchedProduction( "openLdapObjectClass()" );

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParser.java?rev=666637&r1=666636&r2=666637&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParser.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParser.java Wed Jun 11 05:19:17 2008
@@ -27,11 +27,14 @@
 import java.io.InputStreamReader;
 import java.text.ParseException;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.directory.shared.ldap.schema.syntax.AbstractSchemaDescription;
 import org.apache.directory.shared.ldap.schema.syntax.AttributeTypeDescription;
 import org.apache.directory.shared.ldap.schema.syntax.ObjectClassDescription;
+import org.apache.directory.shared.ldap.schema.syntax.OpenLdapObjectIdentifierMacro;
 import org.apache.directory.shared.ldap.schema.syntax.parser.AbstractSchemaParser;
 import org.apache.directory.shared.ldap.util.ExceptionUtils;
 
@@ -49,14 +52,20 @@
 {
 
     /** The list of parsed schema descriptions */
-    private List<AbstractSchemaDescription> schemaDescriptions;
+    private List<Object> schemaDescriptions;
 
     /** The list of attribute type literals, initialized by splitParsedSchemaDescriptions() */
     private List<AttributeTypeLiteral> attributeTypeLiterals;
 
-    /** the list of object class literals, initialized by splitParsedSchemaDescriptions()*/
+    /** The list of object class literals, initialized by splitParsedSchemaDescriptions()*/
     private List<ObjectClassLiteral> objectClassLiterals;
 
+    /** The map of object identifier macros, initialized by splitParsedSchemaDescriptions()*/
+    private Map<String, OpenLdapObjectIdentifierMacro> objectIdentifierMacros;
+
+    /** Flag whether object identifier macros should be resolved. */
+    private boolean isResolveObjectIdentifierMacros;
+
 
     /**
      * Creates a reusable instance of an OpenLdapSchemaParser.
@@ -65,61 +74,75 @@
      */
     public OpenLdapSchemaParser() throws IOException
     {
-        init();
+        isResolveObjectIdentifierMacros = true;
+        super.setQuirksMode( true );
     }
 
 
     /**
-     * Initializes a parser and its plumbing.
+     * Reset the parser 
      */
-    public void init()
+    public void clear()
     {
     }
 
 
     /**
-     * Reset the parser 
+     * Gets the attribute types.
+     * 
+     * @return the attribute types
      */
-    public synchronized void clear()
+    public List<AttributeTypeLiteral> getAttributeTypes()
     {
+        return attributeTypeLiterals;
     }
 
 
     /**
-     * @return the AttributeTypes list
+     * Gets the object class types.
+     * 
+     * @return the object class types
      */
-    public List<AttributeTypeLiteral> getAttributeTypes()
+    public List<ObjectClassLiteral> getObjectClassTypes()
     {
-        if ( attributeTypeLiterals == null )
-        {
-            splitParsedSchemaDescriptions();
-        }
-
-        return attributeTypeLiterals;
+        return objectClassLiterals;
     }
 
 
-    public List<ObjectClassLiteral> getObjectClassTypes()
+    /**
+     * Gets the object identifier macros.
+     * 
+     * @return the object identifier macros
+     */
+    public Map<String, OpenLdapObjectIdentifierMacro> getObjectIdentifierMacros()
     {
-        if ( objectClassLiterals == null )
-        {
-            splitParsedSchemaDescriptions();
-        }
-
-        return objectClassLiterals;
+        return objectIdentifierMacros;
     }
 
 
-    private void splitParsedSchemaDescriptions()
+    /**
+     * Splits parsed schema descriptions and resolved
+     * object identifier macros.
+     * 
+     * @throws ParseException the parse exception
+     */
+    private void afterParse() throws ParseException
     {
         objectClassLiterals = new ArrayList<ObjectClassLiteral>();
         attributeTypeLiterals = new ArrayList<AttributeTypeLiteral>();
+        objectIdentifierMacros = new HashMap<String, OpenLdapObjectIdentifierMacro>();
 
-        for ( AbstractSchemaDescription schemaDescription : schemaDescriptions )
+        // split parsed schema descriptions
+        for ( Object obj : schemaDescriptions )
         {
-            if ( schemaDescription instanceof AttributeTypeDescription )
+            if ( obj instanceof OpenLdapObjectIdentifierMacro )
+            {
+                OpenLdapObjectIdentifierMacro oid = ( OpenLdapObjectIdentifierMacro ) obj;
+                objectIdentifierMacros.put( oid.getName(), oid );
+            }
+            else if ( obj instanceof AttributeTypeDescription )
             {
-                AttributeTypeDescription atd = ( AttributeTypeDescription ) schemaDescription;
+                AttributeTypeDescription atd = ( AttributeTypeDescription ) obj;
                 AttributeTypeLiteral literal = new AttributeTypeLiteral( atd.getNumericOid() );
                 literal.setNames( atd.getNames().toArray( new String[atd.getNames().size()] ) );
                 literal.setDescription( atd.getDescription() );
@@ -136,9 +159,9 @@
                 literal.setUsage( atd.getUsage() );
                 attributeTypeLiterals.add( literal );
             }
-            else if ( schemaDescription instanceof ObjectClassDescription )
+            else if ( obj instanceof ObjectClassDescription )
             {
-                ObjectClassDescription ocd = ( ObjectClassDescription ) schemaDescription;
+                ObjectClassDescription ocd = ( ObjectClassDescription ) obj;
                 ObjectClassLiteral literal = new ObjectClassLiteral( ocd.getNumericOid() );
                 literal.setNames( ocd.getNames().toArray( new String[ocd.getNames().size()] ) );
                 literal.setDescription( ocd.getDescription() );
@@ -151,17 +174,95 @@
                 objectClassLiterals.add( literal );
             }
         }
+
+        if ( isResolveObjectIdentifierMacros() )
+        {
+            // resolve object identifier macros
+            for ( OpenLdapObjectIdentifierMacro oid : objectIdentifierMacros.values() )
+            {
+                resolveObjectIdentifierMacro( oid );
+            }
+
+            // apply object identifier macros to object classes and attribute types
+            for ( ObjectClassLiteral ocl : objectClassLiterals )
+            {
+                ocl.setOid( getResolveOid( ocl.getOid() ) );
+            }
+            for ( AttributeTypeLiteral atl : attributeTypeLiterals )
+            {
+                atl.setOid( getResolveOid( atl.getOid() ) );
+                atl.setSyntax( getResolveOid( atl.getSyntax() ) );
+            }
+        }
+
+    }
+
+
+    private String getResolveOid( String oid )
+    {
+        if ( oid != null && oid.indexOf( ':' ) != -1 )
+        {
+            // resolve OID
+            String[] nameAndSuffix = oid.split( ":" );
+            if ( objectIdentifierMacros.containsKey( nameAndSuffix[0] ) )
+            {
+                OpenLdapObjectIdentifierMacro macro = objectIdentifierMacros.get( nameAndSuffix[0] );
+                return macro.getResolvedOid() + "." + nameAndSuffix[1];
+            }
+        }
+        return oid;
+    }
+
+
+    private void resolveObjectIdentifierMacro( OpenLdapObjectIdentifierMacro macro ) throws ParseException
+    {
+        String rawOidOrNameSuffix = macro.getRawOidOrNameSuffix();
+
+        if ( macro.isResolved() )
+        {
+            // finished
+        }
+        else if ( rawOidOrNameSuffix.indexOf( ':' ) != -1 )
+        {
+            // resolve OID
+            String[] nameAndSuffix = rawOidOrNameSuffix.split( ":" );
+            if ( objectIdentifierMacros.containsKey( nameAndSuffix[0] ) )
+            {
+                OpenLdapObjectIdentifierMacro parentMacro = objectIdentifierMacros.get( nameAndSuffix[0] );
+                resolveObjectIdentifierMacro( parentMacro );
+                macro.setResolvedOid( parentMacro.getResolvedOid() + "." + nameAndSuffix[1] );
+            }
+            else
+            {
+                throw new ParseException( "No object identifier macro with name " + nameAndSuffix[0], 0 );
+            }
+
+        }
+        else
+        {
+            // no :suffix, 
+            if ( objectIdentifierMacros.containsKey( rawOidOrNameSuffix ) )
+            {
+                OpenLdapObjectIdentifierMacro parentMacro = objectIdentifierMacros.get( rawOidOrNameSuffix );
+                resolveObjectIdentifierMacro( parentMacro );
+                macro.setResolvedOid( parentMacro.getResolvedOid() );
+            }
+            else
+            {
+                macro.setResolvedOid( rawOidOrNameSuffix );
+            }
+        }
     }
 
 
     /**
-     * Thread safe method parses an OpenLDAP schemaObject element/object.
+     * Parses an OpenLDAP schemaObject element/object.
      *
      * @param schemaObject the String image of a complete schema object
      * @throws IOException If the schemaObject can't be transformed to a byteArrayInputStream
      * @throws ParseException If the schemaObject can't be parsed
      */
-    public synchronized AbstractSchemaDescription parse( String schemaObject ) throws ParseException
+    public AbstractSchemaDescription parse( String schemaObject ) throws ParseException
     {
         if ( schemaObject == null || schemaObject.trim().equals( "" ) )
         {
@@ -173,12 +274,15 @@
 
         if ( !schemaDescriptions.isEmpty() )
         {
-            return schemaDescriptions.get( 0 );
-        }
-        else
-        {
-            return null;
+            for ( Object obj : schemaDescriptions )
+            {
+                if ( obj instanceof AbstractSchemaDescription )
+                {
+                    return ( AbstractSchemaDescription ) obj;
+                }
+            }
         }
+        return null;
     }
 
 
@@ -188,33 +292,32 @@
         {
             monitor.startedParse( "starting parse on:\n" + subject );
             schemaDescriptions = parser.openLdapSchema();
+            afterParse();
             monitor.finishedParse( "Done parsing!" );
         }
         catch ( RecognitionException e )
         {
             String msg = "Parser failure on:\n\t" + subject;
             msg += "\nAntlr exception trace:\n" + ExceptionUtils.getFullStackTrace( e );
-            init();
             throw new ParseException( msg, e.getColumn() );
         }
         catch ( TokenStreamException e2 )
         {
             String msg = "Parser failure on:\n\t" + subject;
             msg += "\nAntlr exception trace:\n" + ExceptionUtils.getFullStackTrace( e2 );
-            init();
             throw new ParseException( msg, 0 );
         }
     }
 
 
     /**
-     * Thread safe method parses a stream of OpenLDAP schemaObject elements/objects.
+     * Parses a stream of OpenLDAP schemaObject elements/objects.
      *
      * @param schemaIn a stream of schema objects
      * @throws IOException If the schemaObject can't be transformed to a byteArrayInputStream
      * @throws ParseException If the schemaObject can't be parsed
      */
-    public synchronized void parse( InputStream schemaIn ) throws IOException, ParseException
+    public void parse( InputStream schemaIn ) throws IOException, ParseException
     {
         InputStreamReader in = new InputStreamReader( schemaIn );
         lexer.prepareNextInput( in );
@@ -225,13 +328,13 @@
 
 
     /**
-     * Thread safe method parses a file of OpenLDAP schemaObject elements/objects.
+     * Parses a file of OpenLDAP schemaObject elements/objects.
      *
      * @param schemaFile a file of schema objects
      * @throws IOException If the schemaObject can't be transformed to a byteArrayInputStream
      * @throws ParseException If the schemaObject can't be parsed
      */
-    public synchronized void parse( File schemaFile ) throws IOException, ParseException
+    public void parse( File schemaFile ) throws IOException, ParseException
     {
         FileReader in = new FileReader( schemaFile );
         lexer.prepareNextInput( in );
@@ -240,4 +343,26 @@
         invokeParser( "schema file ==> " + schemaFile.getAbsolutePath() );
     }
 
+
+    /**
+     * Checks if object identifier macros should be resolved.
+     * 
+     * @return true, object identifier macros should be resolved.
+     */
+    public boolean isResolveObjectIdentifierMacros()
+    {
+        return isResolveObjectIdentifierMacros;
+    }
+
+
+    /**
+     * Sets if object identifier macros should be resolved.
+     * 
+     * @param isResolveObjectIdentifierMacros true if object identifier macros should be resolved
+     */
+    public void setResolveObjectIdentifierMacros( boolean isResolveObjectIdentifierMacros )
+    {
+        this.isResolveObjectIdentifierMacros = isResolveObjectIdentifierMacros;
+    }
+
 }

Added: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OpenLdapObjectIdentifierMacro.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OpenLdapObjectIdentifierMacro.java?rev=666637&view=auto
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OpenLdapObjectIdentifierMacro.java (added)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/OpenLdapObjectIdentifierMacro.java Wed Jun 11 05:19:17 2008
@@ -0,0 +1,142 @@
+/*
+ *  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.apache.directory.shared.ldap.schema.syntax;
+
+
+/**
+ * An OpenLDAP object identifier macro. 
+ * See http://www.openldap.org/doc/admin24/schema.html#OID%20Macros
+ * <br/>
+ * <code>objectIdentifier &lt;name&gt; { &lt;oid&gt; | &lt;name&gt;[:&lt;suffix&gt;] }</code>
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class OpenLdapObjectIdentifierMacro
+{
+    private String name;
+
+    private String rawOidOrNameSuffix;
+
+    private String resolvedOid;
+
+
+    /**
+     * Instantiates a new OpenLDAP object identifier macro.
+     */
+    public OpenLdapObjectIdentifierMacro()
+    {
+        name = null;
+        rawOidOrNameSuffix = null;
+        resolvedOid = null;
+    }
+
+
+    /**
+     * Gets the name.
+     * 
+     * @return the name
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+
+    /**
+     * Sets the name.
+     * 
+     * @param name the new name
+     */
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+
+    /**
+     * Gets the raw OID or name plus suffix.
+     * 
+     * @return the raw OID or name plus suffix
+     */
+    public String getRawOidOrNameSuffix()
+    {
+        return rawOidOrNameSuffix;
+    }
+
+
+    /**
+     * Sets the raw OID or name plus suffix.
+     * 
+     * @param rawOidOrNameSuffix the new raw OID or name plus suffix
+     */
+    public void setRawOidOrNameSuffix( String rawOidOrNameSuffix )
+    {
+        this.rawOidOrNameSuffix = rawOidOrNameSuffix;
+    }
+
+
+    /**
+     * Gets the resolved OID, null if not yet resolved.
+     * 
+     * @return the resolved OID
+     */
+    public String getResolvedOid()
+    {
+        return resolvedOid;
+    }
+
+
+    /**
+     * Checks if is resolved.
+     * 
+     * @return true, if is resolved
+     */
+    public boolean isResolved()
+    {
+        return getResolvedOid() != null;
+    }
+
+
+    /**
+     * Sets the resolved OID.
+     * 
+     * @param resolvedOid the new resolved OID
+     */
+    public void setResolvedOid( String resolvedOid )
+    {
+        this.resolvedOid = resolvedOid;
+    }
+
+
+    public String toString()
+    {
+        if ( isResolved() )
+        {
+            return "resolved: " + name + " " + resolvedOid;
+        }
+        else
+        {
+            return "unresolved: " + name + " " + rawOidOrNameSuffix;
+        }
+    }
+
+}
\ No newline at end of file

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java?rev=666637&r1=666636&r2=666637&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/schema/parser/OpenLdapSchemaParserTest.java Wed Jun 11 05:19:17 2008
@@ -20,15 +20,16 @@
 package org.apache.directory.shared.ldap.schema.parser;
 
 
+import java.io.InputStream;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import junit.framework.TestCase;
+
 import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
-import org.apache.directory.shared.ldap.schema.parser.AttributeTypeLiteral;
-import org.apache.directory.shared.ldap.schema.parser.ObjectClassLiteral;
-import org.apache.directory.shared.ldap.schema.parser.OpenLdapSchemaParser;
+import org.apache.directory.shared.ldap.schema.syntax.OpenLdapObjectIdentifierMacro;
 
 
 /**
@@ -80,12 +81,12 @@
     private Map<String, AttributeTypeLiteral> mapAttributeTypes( List<AttributeTypeLiteral> attributeTypeList )
     {
         Map<String, AttributeTypeLiteral> m = new HashMap<String, AttributeTypeLiteral>();
-        
+
         for ( AttributeTypeLiteral type : attributeTypeList )
         {
             m.put( type.getOid(), type );
         }
-        
+
         return m;
     }
 
@@ -151,12 +152,12 @@
     private Map<String, ObjectClassLiteral> mapObjectClasses( List<ObjectClassLiteral> objectClassList )
     {
         Map<String, ObjectClassLiteral> m = new HashMap<String, ObjectClassLiteral>();
-        
+
         for ( ObjectClassLiteral objectClassLiteral : objectClassList )
         {
             m.put( objectClassLiteral.getOid(), objectClassLiteral );
         }
-        
+
         return m;
     }
 
@@ -229,4 +230,110 @@
         assertEquals( "personalSignature", objectClass.getMay()[18] );
     }
 
+
+    public void testParseOpenLdapCoreSchema() throws Exception
+    {
+        InputStream input = getClass().getResourceAsStream( "core.schema" );
+        parser.parse( input );
+
+        List<AttributeTypeLiteral> attributeTypes = parser.getAttributeTypes();
+        List<ObjectClassLiteral> objectClassTypes = parser.getObjectClassTypes();
+        Map<String, OpenLdapObjectIdentifierMacro> objectIdentifierMacros = parser.getObjectIdentifierMacros();
+
+        assertEquals( 52, attributeTypes.size() );
+        assertEquals( 27, objectClassTypes.size() );
+        assertEquals( 0, objectIdentifierMacros.size() );
+    }
+
+
+    public void testParseOpenLdapInetOrgPersonSchema() throws Exception
+    {
+        InputStream input = getClass().getResourceAsStream( "inetorgperson.schema" );
+        parser.parse( input );
+
+        List<AttributeTypeLiteral> attributeTypes = parser.getAttributeTypes();
+        List<ObjectClassLiteral> objectClassTypes = parser.getObjectClassTypes();
+        Map<String, OpenLdapObjectIdentifierMacro> objectIdentifierMacros = parser.getObjectIdentifierMacros();
+
+        assertEquals( 9, attributeTypes.size() );
+        assertEquals( 1, objectClassTypes.size() );
+        assertEquals( 0, objectIdentifierMacros.size() );
+    }
+
+
+    public void testParseOpenLdapCollectiveSchema() throws Exception
+    {
+        InputStream input = getClass().getResourceAsStream( "collective.schema" );
+        parser.parse( input );
+
+        List<AttributeTypeLiteral> attributeTypes = parser.getAttributeTypes();
+        List<ObjectClassLiteral> objectClassTypes = parser.getObjectClassTypes();
+        Map<String, OpenLdapObjectIdentifierMacro> objectIdentifierMacros = parser.getObjectIdentifierMacros();
+
+        assertEquals( 13, attributeTypes.size() );
+        assertEquals( 0, objectClassTypes.size() );
+        assertEquals( 0, objectIdentifierMacros.size() );
+        for ( AttributeTypeLiteral attributeTypeLiteral : attributeTypes )
+        {
+            assertTrue( attributeTypeLiteral.isCollective() );
+        }
+    }
+
+
+    public void testOpenLdapObjectIdentifiereMacros() throws Exception
+    {
+        InputStream input = getClass().getResourceAsStream( "dyngroup.schema" );
+        parser.parse( input );
+
+        List<AttributeTypeLiteral> attributeTypes = parser.getAttributeTypes();
+        List<ObjectClassLiteral> objectClassTypes = parser.getObjectClassTypes();
+        Map<String, OpenLdapObjectIdentifierMacro> objectIdentifierMacros = parser.getObjectIdentifierMacros();
+
+        assertEquals( 2, attributeTypes.size() );
+        assertEquals( 2, objectClassTypes.size() );
+        assertEquals( 8, objectIdentifierMacros.size() );
+
+        // check that all macros are resolved
+        for ( OpenLdapObjectIdentifierMacro macro : objectIdentifierMacros.values() )
+        {
+            assertTrue( macro.isResolved() );
+            assertNotNull( macro.getResolvedOid() );
+            assertTrue( macro.getResolvedOid().matches( "[0-9]+(\\.[0-9]+)+" ) );
+        }
+
+        // check that OIDs in attribute types and object classes are resolved
+        for ( ObjectClassLiteral objectClassLiteral : objectClassTypes )
+        {
+            List<String> asList = Arrays.asList( objectClassLiteral.getNames() );
+            if ( asList.contains( "groupOfURLs" ) )
+            {
+                assertEquals( "2.16.840.1.113730.3.2.33", objectClassLiteral.getOid() );
+            }
+            else if ( asList.contains( "dgIdentityAux" ) )
+            {
+                assertEquals( "1.3.6.1.4.1.4203.666.11.8.2.1", objectClassLiteral.getOid() );
+            }
+            else
+            {
+                fail( "object class 'groupOfURLs' or 'dgIdentityAux' expected" );
+            }
+        }
+        for ( AttributeTypeLiteral attributeTypeLiteral : attributeTypes )
+        {
+            List<String> asList = Arrays.asList( attributeTypeLiteral.getNames() );
+            if ( asList.contains( "memberURL" ) )
+            {
+                assertEquals( "2.16.840.1.113730.3.1.198", attributeTypeLiteral.getOid() );
+            }
+            else if ( asList.contains( "dgIdentity" ) )
+            {
+                assertEquals( "1.3.6.1.4.1.4203.666.11.8.1.1", attributeTypeLiteral.getOid() );
+            }
+            else
+            {
+                fail( "attribute type 'memberURL' or 'dgIdentity' expected" );
+            }
+        }
+    }
+
 }

Added: directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/collective.schema
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/collective.schema?rev=666637&view=auto
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/collective.schema (added)
+++ directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/collective.schema Wed Jun 11 05:19:17 2008
@@ -0,0 +1,65 @@
+# collective.schema -- Collective attribute schema
+# $OpenLDAP: pkg/ldap/servers/slapd/schema/collective.schema,v 1.12.2.2 2007/08/31 23:14:06 quanah Exp $
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## Copyright 1998-2007 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## <http://www.OpenLDAP.org/license.html>.
+#
+
+# The version of this file as distributed by the OpenLDAP Foundation
+# contains text from an IETF RFC explaining the schema.  Unfortunately,
+# that text is covered by a license that doesn't meet Debian's Free
+# Software Guidelines.  This is a stripped version of the schema that
+# contains only the functional schema definition, not the text of the
+# RFC.
+#
+# For an explanation of this schema, see RFC 3671, at (among other
+# places):  http://www.ietf.org/rfc/rfc3671.txt
+
+attributeType      ( 2.5.4.7.1 NAME 'c-l'
+	SUP l COLLECTIVE )
+
+attributeType      ( 2.5.4.8.1 NAME 'c-st'
+	SUP st COLLECTIVE )
+
+attributeType      ( 2.5.4.9.1 NAME 'c-street'
+	SUP street COLLECTIVE )
+
+attributeType      ( 2.5.4.10.1 NAME 'c-o'
+	SUP o COLLECTIVE )
+
+attributeType      ( 2.5.4.11.1 NAME 'c-ou'
+	SUP ou COLLECTIVE )
+
+attributeType      ( 2.5.4.16.1 NAME 'c-PostalAddress'
+	SUP postalAddress COLLECTIVE )
+
+attributeType      ( 2.5.4.17.1 NAME 'c-PostalCode'
+	SUP postalCode COLLECTIVE )
+
+attributeType ( 2.5.4.18.1 NAME 'c-PostOfficeBox'
+	SUP postOfficeBox COLLECTIVE )
+
+attributeType ( 2.5.4.19.1 NAME 'c-PhysicalDeliveryOfficeName'
+	SUP physicalDeliveryOfficeName COLLECTIVE )
+
+attributeType ( 2.5.4.20.1 NAME 'c-TelephoneNumber'
+	SUP telephoneNumber COLLECTIVE )
+
+attributeType ( 2.5.4.21.1 NAME 'c-TelexNumber'
+	SUP telexNumber COLLECTIVE )
+
+attributeType ( 2.5.4.23.1 NAME 'c-FacsimileTelephoneNumber'
+	SUP facsimileTelephoneNumber COLLECTIVE )
+
+attributeType ( 2.5.4.25.1 NAME 'c-InternationalISDNNumber'
+	SUP internationalISDNNumber COLLECTIVE )
+

Added: directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/core.schema
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/core.schema?rev=666637&view=auto
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/core.schema (added)
+++ directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/core.schema Wed Jun 11 05:19:17 2008
@@ -0,0 +1,603 @@
+# OpenLDAP Core schema
+# $OpenLDAP: pkg/ldap/servers/slapd/schema/core.schema,v 1.79.2.8 2007/01/02 21:44:09 kurt Exp $
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## Copyright 1998-2007 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## <http://www.OpenLDAP.org/license.html>.
+#
+
+# The version of this file as distributed by the OpenLDAP Foundation
+# contains text claiming copyright by the Internet Society and including
+# the IETF RFC license, which does not meet Debian's Free Software
+# Guidelines.  However, apart from short and obvious comments, the text of
+# this file is purely a functional interface specification, which is not
+# subject to that license and is not copyrightable under US law.
+#
+# The license statement is retained below so as not to remove credit, but
+# as best as we can determine, it is not applicable to the contents of
+# this file.
+
+## Portions Copyright (C) The Internet Society (1997-2003).
+## All Rights Reserved.
+##
+## This document and translations of it may be copied and furnished to
+## others, and derivative works that comment on or otherwise explain it
+## or assist in its implementation may be prepared, copied, published
+## and distributed, in whole or in part, without restriction of any
+## kind, provided that the above copyright notice and this paragraph are
+## included on all such copies and derivative works.  However, this
+## document itself may not be modified in any way, such as by removing
+## the copyright notice or references to the Internet Society or other
+## Internet organizations, except as needed for the purpose of
+## developing Internet standards in which case the procedures for
+## copyrights defined in the Internet Standards process must be         
+## followed, or as required to translate it into languages other than
+## English.
+##                                                                      
+## The limited permissions granted above are perpetual and will not be  
+## revoked by the Internet Society or its successors or assigns.        
+## 
+## This document and the information contained herein is provided on an 
+## "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
+## TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
+## BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
+## HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
+## MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+
+#
+#
+# Includes LDAPv3 schema items from:
+#	RFC 2252/2256 (LDAPv3)
+#
+# Select standard track schema items:
+#	RFC 1274 (uid/dc)
+#	RFC 2079 (URI)
+#	RFC 2247 (dc/dcObject)
+#	RFC 2587 (PKI)
+#	RFC 2589 (Dynamic Directory Services)
+#
+# Select informational schema items:
+#	RFC 2377 (uidObject)
+
+#
+# Standard attribute types from RFC 2256
+#
+
+# system schema
+#attributetype ( 2.5.4.0 NAME 'objectClass'
+#	DESC 'RFC2256: object classes of the entity'
+#	EQUALITY objectIdentifierMatch
+#	SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )
+
+# system schema
+#attributetype ( 2.5.4.1 NAME ( 'aliasedObjectName' 'aliasedEntryName' )
+#	DESC 'RFC2256: name of aliased object'
+#	EQUALITY distinguishedNameMatch
+#	SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
+
+attributetype ( 2.5.4.2 NAME 'knowledgeInformation'
+	DESC 'RFC2256: knowledge information'
+	EQUALITY caseIgnoreMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )
+
+# system schema
+#attributetype ( 2.5.4.3 NAME ( 'cn' 'commonName' )
+#	DESC 'RFC2256: common name(s) for which the entity is known by'
+#	SUP name )
+
+attributetype ( 2.5.4.4 NAME ( 'sn' 'surname' )
+	DESC 'RFC2256: last (family) name(s) for which the entity is known by'
+	SUP name )
+
+attributetype ( 2.5.4.5 NAME 'serialNumber'
+	DESC 'RFC2256: serial number of the entity'
+	EQUALITY caseIgnoreMatch
+	SUBSTR caseIgnoreSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{64} )
+
+attributetype ( 2.5.4.6 NAME ( 'c' 'countryName' )
+	DESC 'RFC2256: ISO-3166 country 2-letter code'
+	SUP name SINGLE-VALUE )
+
+attributetype ( 2.5.4.7 NAME ( 'l' 'localityName' )
+	DESC 'RFC2256: locality which this object resides in'
+	SUP name )
+
+attributetype ( 2.5.4.8 NAME ( 'st' 'stateOrProvinceName' )
+	DESC 'RFC2256: state or province which this object resides in'
+	SUP name )
+
+attributetype ( 2.5.4.9 NAME ( 'street' 'streetAddress' )
+	DESC 'RFC2256: street address of this object'
+	EQUALITY caseIgnoreMatch
+	SUBSTR caseIgnoreSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
+
+attributetype ( 2.5.4.10 NAME ( 'o' 'organizationName' )
+	DESC 'RFC2256: organization this object belongs to'
+	SUP name )
+
+attributetype ( 2.5.4.11 NAME ( 'ou' 'organizationalUnitName' )
+	DESC 'RFC2256: organizational unit this object belongs to'
+	SUP name )
+
+attributetype ( 2.5.4.12 NAME 'title'
+	DESC 'RFC2256: title associated with the entity'
+	SUP name )
+
+# system schema
+#attributetype ( 2.5.4.13 NAME 'description'
+#	DESC 'RFC2256: descriptive information'
+#	EQUALITY caseIgnoreMatch
+#	SUBSTR caseIgnoreSubstringsMatch
+#	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{1024} )
+
+# Deprecated by enhancedSearchGuide
+attributetype ( 2.5.4.14 NAME 'searchGuide'
+	DESC 'RFC2256: search guide, deprecated by enhancedSearchGuide'
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.25 )
+
+attributetype ( 2.5.4.15 NAME 'businessCategory'
+	DESC 'RFC2256: business category'
+	EQUALITY caseIgnoreMatch
+	SUBSTR caseIgnoreSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
+
+attributetype ( 2.5.4.16 NAME 'postalAddress'
+	DESC 'RFC2256: postal address'
+	EQUALITY caseIgnoreListMatch
+	SUBSTR caseIgnoreListSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )
+
+attributetype ( 2.5.4.17 NAME 'postalCode'
+	DESC 'RFC2256: postal code'
+	EQUALITY caseIgnoreMatch
+	SUBSTR caseIgnoreSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} )
+
+attributetype ( 2.5.4.18 NAME 'postOfficeBox'
+	DESC 'RFC2256: Post Office Box'
+	EQUALITY caseIgnoreMatch
+	SUBSTR caseIgnoreSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{40} )
+
+attributetype ( 2.5.4.19 NAME 'physicalDeliveryOfficeName'
+	DESC 'RFC2256: Physical Delivery Office Name'
+	EQUALITY caseIgnoreMatch
+	SUBSTR caseIgnoreSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
+
+attributetype ( 2.5.4.20 NAME 'telephoneNumber'
+	DESC 'RFC2256: Telephone Number'
+	EQUALITY telephoneNumberMatch
+	SUBSTR telephoneNumberSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{32} )
+
+attributetype ( 2.5.4.21 NAME 'telexNumber'
+	DESC 'RFC2256: Telex Number'
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.52 )
+
+attributetype ( 2.5.4.22 NAME 'teletexTerminalIdentifier'
+	DESC 'RFC2256: Teletex Terminal Identifier'
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.51 )
+
+attributetype ( 2.5.4.23 NAME ( 'facsimileTelephoneNumber' 'fax' )
+	DESC 'RFC2256: Facsimile (Fax) Telephone Number'
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.22 )
+
+attributetype ( 2.5.4.24 NAME 'x121Address'
+	DESC 'RFC2256: X.121 Address'
+	EQUALITY numericStringMatch
+	SUBSTR numericStringSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.36{15} )
+
+attributetype ( 2.5.4.25 NAME 'internationaliSDNNumber'
+	DESC 'RFC2256: international ISDN number'
+	EQUALITY numericStringMatch
+	SUBSTR numericStringSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.36{16} )
+
+attributetype ( 2.5.4.26 NAME 'registeredAddress'
+	DESC 'RFC2256: registered postal address'
+	SUP postalAddress
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )
+
+attributetype ( 2.5.4.27 NAME 'destinationIndicator'
+	DESC 'RFC2256: destination indicator'
+	EQUALITY caseIgnoreMatch
+	SUBSTR caseIgnoreSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{128} )
+
+attributetype ( 2.5.4.28 NAME 'preferredDeliveryMethod'
+	DESC 'RFC2256: preferred delivery method'
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.14
+	SINGLE-VALUE )
+
+attributetype ( 2.5.4.29 NAME 'presentationAddress'
+	DESC 'RFC2256: presentation address'
+	EQUALITY presentationAddressMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.43
+	SINGLE-VALUE )
+
+attributetype ( 2.5.4.30 NAME 'supportedApplicationContext'
+	DESC 'RFC2256: supported application context'
+	EQUALITY objectIdentifierMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )
+
+attributetype ( 2.5.4.31 NAME 'member'
+	DESC 'RFC2256: member of a group'
+	SUP distinguishedName )
+
+attributetype ( 2.5.4.32 NAME 'owner'
+	DESC 'RFC2256: owner (of the object)'
+	SUP distinguishedName )
+
+attributetype ( 2.5.4.33 NAME 'roleOccupant'
+	DESC 'RFC2256: occupant of role'
+	SUP distinguishedName )
+
+# system schema
+#attributetype ( 2.5.4.34 NAME 'seeAlso'
+#	DESC 'RFC2256: DN of related object'
+#	SUP distinguishedName )
+
+# system schema
+#attributetype ( 2.5.4.35 NAME 'userPassword'
+#	DESC 'RFC2256/2307: password of user'
+#	EQUALITY octetStringMatch
+#	SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{128} )
+
+# Must be transferred using ;binary
+# with certificateExactMatch rule (per X.509)
+attributetype ( 2.5.4.36 NAME 'userCertificate'
+	DESC 'RFC2256: X.509 user certificate, use ;binary'
+	EQUALITY certificateExactMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.8 )
+
+# Must be transferred using ;binary
+# with certificateExactMatch rule (per X.509)
+attributetype ( 2.5.4.37 NAME 'cACertificate'
+	DESC 'RFC2256: X.509 CA certificate, use ;binary'
+	EQUALITY certificateExactMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.8 )
+
+# Must be transferred using ;binary
+attributetype ( 2.5.4.38 NAME 'authorityRevocationList'
+	DESC 'RFC2256: X.509 authority revocation list, use ;binary'
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.9 )
+
+# Must be transferred using ;binary
+attributetype ( 2.5.4.39 NAME 'certificateRevocationList'
+	DESC 'RFC2256: X.509 certificate revocation list, use ;binary'
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.9 )
+
+# Must be stored and requested in the binary form
+attributetype ( 2.5.4.40 NAME 'crossCertificatePair'
+	DESC 'RFC2256: X.509 cross certificate pair, use ;binary'
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.10 )
+
+# system schema
+#attributetype ( 2.5.4.41 NAME 'name'
+#	EQUALITY caseIgnoreMatch
+#	SUBSTR caseIgnoreSubstringsMatch
+#	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )
+
+attributetype ( 2.5.4.42 NAME ( 'givenName' 'gn' )
+	DESC 'RFC2256: first name(s) for which the entity is known by'
+	SUP name )
+
+attributetype ( 2.5.4.43 NAME 'initials'
+	DESC 'RFC2256: initials of some or all of names, but not the surname(s).'
+	SUP name )
+
+attributetype ( 2.5.4.44 NAME 'generationQualifier'
+	DESC 'RFC2256: name qualifier indicating a generation'
+	SUP name )
+
+attributetype ( 2.5.4.45 NAME 'x500UniqueIdentifier'
+	DESC 'RFC2256: X.500 unique identifier'
+	EQUALITY bitStringMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.6 )
+
+attributetype ( 2.5.4.46 NAME 'dnQualifier'
+	DESC 'RFC2256: DN qualifier'
+	EQUALITY caseIgnoreMatch
+	ORDERING caseIgnoreOrderingMatch
+	SUBSTR caseIgnoreSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.44 )
+
+attributetype ( 2.5.4.47 NAME 'enhancedSearchGuide'
+	DESC 'RFC2256: enhanced search guide'
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.21 )
+
+attributetype ( 2.5.4.48 NAME 'protocolInformation'
+	DESC 'RFC2256: protocol information'
+	EQUALITY protocolInformationMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.42 )
+
+# system schema
+#attributetype ( 2.5.4.49 NAME 'distinguishedName'
+#	EQUALITY distinguishedNameMatch
+#	SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
+
+attributetype ( 2.5.4.50 NAME 'uniqueMember'
+	DESC 'RFC2256: unique member of a group'
+	EQUALITY uniqueMemberMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.34 )
+
+attributetype ( 2.5.4.51 NAME 'houseIdentifier'
+	DESC 'RFC2256: house identifier'
+	EQUALITY caseIgnoreMatch
+	SUBSTR caseIgnoreSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )
+
+# Must be transferred using ;binary
+attributetype ( 2.5.4.52 NAME 'supportedAlgorithms'
+	DESC 'RFC2256: supported algorithms'
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.49 )
+
+# Must be transferred using ;binary
+attributetype ( 2.5.4.53 NAME 'deltaRevocationList'
+	DESC 'RFC2256: delta revocation list; use ;binary'
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.9 )
+
+attributetype ( 2.5.4.54 NAME 'dmdName'
+	DESC 'RFC2256: name of DMD'
+	SUP name )
+
+attributetype ( 2.5.4.65 NAME 'pseudonym'
+	DESC 'X.520(4th): pseudonym for the object'
+	SUP name )
+
+# Standard object classes from RFC2256
+
+# system schema
+#objectclass ( 2.5.6.0 NAME 'top'
+#	DESC 'RFC2256: top of the superclass chain'
+#	ABSTRACT
+#	MUST objectClass )
+
+# system schema
+#objectclass ( 2.5.6.1 NAME 'alias'
+#	DESC 'RFC2256: an alias'
+#	SUP top STRUCTURAL
+#	MUST aliasedObjectName )
+
+objectclass ( 2.5.6.2 NAME 'country'
+	DESC 'RFC2256: a country'
+	SUP top STRUCTURAL
+	MUST c
+	MAY ( searchGuide $ description ) )
+
+objectclass ( 2.5.6.3 NAME 'locality'
+	DESC 'RFC2256: a locality'
+	SUP top STRUCTURAL
+	MAY ( street $ seeAlso $ searchGuide $ st $ l $ description ) )
+
+objectclass ( 2.5.6.4 NAME 'organization'
+	DESC 'RFC2256: an organization'
+	SUP top STRUCTURAL
+	MUST o
+	MAY ( userPassword $ searchGuide $ seeAlso $ businessCategory $
+		x121Address $ registeredAddress $ destinationIndicator $
+		preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
+		telephoneNumber $ internationaliSDNNumber $ 
+		facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $
+		postalAddress $ physicalDeliveryOfficeName $ st $ l $ description ) )
+
+objectclass ( 2.5.6.5 NAME 'organizationalUnit'
+	DESC 'RFC2256: an organizational unit'
+	SUP top STRUCTURAL
+	MUST ou
+	MAY ( userPassword $ searchGuide $ seeAlso $ businessCategory $
+		x121Address $ registeredAddress $ destinationIndicator $
+		preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
+		telephoneNumber $ internationaliSDNNumber $
+		facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $
+		postalAddress $ physicalDeliveryOfficeName $ st $ l $ description ) )
+
+objectclass ( 2.5.6.6 NAME 'person'
+	DESC 'RFC2256: a person'
+	SUP top STRUCTURAL
+	MUST ( sn $ cn )
+	MAY ( userPassword $ telephoneNumber $ seeAlso $ description ) )
+
+objectclass ( 2.5.6.7 NAME 'organizationalPerson'
+	DESC 'RFC2256: an organizational person'
+	SUP person STRUCTURAL
+	MAY ( title $ x121Address $ registeredAddress $ destinationIndicator $
+		preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
+		telephoneNumber $ internationaliSDNNumber $ 
+		facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $
+		postalAddress $ physicalDeliveryOfficeName $ ou $ st $ l ) )
+
+objectclass ( 2.5.6.8 NAME 'organizationalRole'
+	DESC 'RFC2256: an organizational role'
+	SUP top STRUCTURAL
+	MUST cn
+	MAY ( x121Address $ registeredAddress $ destinationIndicator $
+		preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
+		telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $
+		seeAlso $ roleOccupant $ preferredDeliveryMethod $ street $
+		postOfficeBox $ postalCode $ postalAddress $
+		physicalDeliveryOfficeName $ ou $ st $ l $ description ) )
+
+objectclass ( 2.5.6.9 NAME 'groupOfNames'
+	DESC 'RFC2256: a group of names (DNs)'
+	SUP top STRUCTURAL
+	MUST ( member $ cn )
+	MAY ( businessCategory $ seeAlso $ owner $ ou $ o $ description ) )
+
+objectclass ( 2.5.6.10 NAME 'residentialPerson'
+	DESC 'RFC2256: an residential person'
+	SUP person STRUCTURAL
+	MUST l
+	MAY ( businessCategory $ x121Address $ registeredAddress $
+		destinationIndicator $ preferredDeliveryMethod $ telexNumber $
+		teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $
+		facsimileTelephoneNumber $ preferredDeliveryMethod $ street $
+		postOfficeBox $ postalCode $ postalAddress $
+		physicalDeliveryOfficeName $ st $ l ) )
+
+objectclass ( 2.5.6.11 NAME 'applicationProcess'
+	DESC 'RFC2256: an application process'
+	SUP top STRUCTURAL
+	MUST cn
+	MAY ( seeAlso $ ou $ l $ description ) )
+
+objectclass ( 2.5.6.12 NAME 'applicationEntity'
+	DESC 'RFC2256: an application entity'
+	SUP top STRUCTURAL
+	MUST ( presentationAddress $ cn )
+	MAY ( supportedApplicationContext $ seeAlso $ ou $ o $ l $
+	description ) )
+
+objectclass ( 2.5.6.13 NAME 'dSA'
+	DESC 'RFC2256: a directory system agent (a server)'
+	SUP applicationEntity STRUCTURAL
+	MAY knowledgeInformation )
+
+objectclass ( 2.5.6.14 NAME 'device'
+	DESC 'RFC2256: a device'
+	SUP top STRUCTURAL
+	MUST cn
+	MAY ( serialNumber $ seeAlso $ owner $ ou $ o $ l $ description ) )
+
+objectclass ( 2.5.6.15 NAME 'strongAuthenticationUser'
+	DESC 'RFC2256: a strong authentication user'
+	SUP top AUXILIARY
+	MUST userCertificate )
+
+objectclass ( 2.5.6.16 NAME 'certificationAuthority'
+	DESC 'RFC2256: a certificate authority'
+	SUP top AUXILIARY
+	MUST ( authorityRevocationList $ certificateRevocationList $
+		cACertificate ) MAY crossCertificatePair )
+
+objectclass ( 2.5.6.17 NAME 'groupOfUniqueNames'
+	DESC 'RFC2256: a group of unique names (DN and Unique Identifier)'
+	SUP top STRUCTURAL
+	MUST ( uniqueMember $ cn )
+	MAY ( businessCategory $ seeAlso $ owner $ ou $ o $ description ) )
+
+objectclass ( 2.5.6.18 NAME 'userSecurityInformation'
+	DESC 'RFC2256: a user security information'
+	SUP top AUXILIARY
+	MAY ( supportedAlgorithms ) )
+
+objectclass ( 2.5.6.16.2 NAME 'certificationAuthority-V2'
+	SUP certificationAuthority
+	AUXILIARY MAY ( deltaRevocationList ) )
+
+objectclass ( 2.5.6.19 NAME 'cRLDistributionPoint'
+	SUP top STRUCTURAL
+	MUST ( cn )
+	MAY ( certificateRevocationList $ authorityRevocationList $
+		deltaRevocationList ) )
+
+objectclass ( 2.5.6.20 NAME 'dmd'
+	SUP top STRUCTURAL
+	MUST ( dmdName )
+	MAY ( userPassword $ searchGuide $ seeAlso $ businessCategory $
+		x121Address $ registeredAddress $ destinationIndicator $
+		preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
+		telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $
+		street $ postOfficeBox $ postalCode $ postalAddress $
+		physicalDeliveryOfficeName $ st $ l $ description ) )
+
+#
+# Object Classes from RFC 2587
+#
+objectclass ( 2.5.6.21 NAME 'pkiUser'
+	DESC 'RFC2587: a PKI user'
+	SUP top AUXILIARY
+	MAY userCertificate )
+
+objectclass ( 2.5.6.22 NAME 'pkiCA'
+	DESC 'RFC2587: PKI certificate authority'
+	SUP top AUXILIARY
+	MAY ( authorityRevocationList $ certificateRevocationList $
+		cACertificate $ crossCertificatePair ) )
+
+objectclass ( 2.5.6.23 NAME 'deltaCRL'
+	DESC 'RFC2587: PKI user'
+	SUP top AUXILIARY
+	MAY deltaRevocationList )
+
+#
+# Standard Track URI label schema from RFC 2079
+# system schema
+#attributetype ( 1.3.6.1.4.1.250.1.57 NAME 'labeledURI'
+#	DESC 'RFC2079: Uniform Resource Identifier with optional label'
+#	EQUALITY caseExactMatch
+#	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+
+objectclass ( 1.3.6.1.4.1.250.3.15 NAME 'labeledURIObject'
+	DESC 'RFC2079: object that contains the URI attribute type'
+	SUP top AUXILIARY
+	MAY ( labeledURI ) )
+
+#
+# Derived from RFC 1274, but with new "short names"
+#
+#attributetype ( 0.9.2342.19200300.100.1.1
+#	NAME ( 'uid' 'userid' )
+#	DESC 'RFC1274: user identifier'
+#	EQUALITY caseIgnoreMatch
+#	SUBSTR caseIgnoreSubstringsMatch
+#	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+
+attributetype ( 0.9.2342.19200300.100.1.3
+	NAME ( 'mail' 'rfc822Mailbox' )
+	DESC 'RFC1274: RFC822 Mailbox'
+    EQUALITY caseIgnoreIA5Match
+    SUBSTR caseIgnoreIA5SubstringsMatch
+    SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )
+
+objectclass ( 0.9.2342.19200300.100.4.19 NAME 'simpleSecurityObject'
+	DESC 'RFC1274: simple security object'
+	SUP top AUXILIARY
+	MUST userPassword )
+
+# RFC 1274 + RFC 2247
+attributetype ( 0.9.2342.19200300.100.1.25
+	NAME ( 'dc' 'domainComponent' )
+	DESC 'RFC1274/2247: domain component'
+	EQUALITY caseIgnoreIA5Match
+	SUBSTR caseIgnoreIA5SubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
+
+# RFC 2247
+objectclass ( 1.3.6.1.4.1.1466.344 NAME 'dcObject'
+	DESC 'RFC2247: domain component object'
+	SUP top AUXILIARY MUST dc )
+
+# RFC 2377
+objectclass ( 1.3.6.1.1.3.1 NAME 'uidObject'
+	DESC 'RFC2377: uid object'
+	SUP top AUXILIARY MUST uid )
+
+# From COSINE Pilot
+attributetype ( 0.9.2342.19200300.100.1.37
+	NAME 'associatedDomain'
+	DESC 'RFC1274: domain associated with object'
+	EQUALITY caseIgnoreIA5Match
+	SUBSTR caseIgnoreIA5SubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+
+# RFC 2459 -- deprecated in favor of 'mail' (in cosine.schema)
+attributetype ( 1.2.840.113549.1.9.1
+	NAME ( 'email' 'emailAddress' 'pkcs9email' )
+	DESC 'RFC3280: legacy attribute for email addresses in DNs'
+	EQUALITY caseIgnoreIA5Match
+	SUBSTR caseIgnoreIA5SubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} )
+

Added: directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/dyngroup.schema
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/dyngroup.schema?rev=666637&view=auto
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/dyngroup.schema (added)
+++ directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/dyngroup.schema Wed Jun 11 05:19:17 2008
@@ -0,0 +1,82 @@
+# dyngroup.schema -- Dynamic Group schema
+# $OpenLDAP: pkg/ldap/servers/slapd/schema/dyngroup.schema,v 1.6.2.2 2007/08/31 23:14:06 quanah Exp $
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## Copyright 1998-2007 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## <http://www.OpenLDAP.org/license.html>.
+#
+# Dynamic Group schema (experimental), as defined by Netscape.  See
+# http://www.redhat.com/docs/manuals/ent-server/pdf/esadmin611.pdf
+# page 70 for details on how these groups were used.
+#
+# A description of the objectclass definition is available here:
+# http://www.redhat.com/docs/manuals/dir-server/schema/7.1/oc_dir.html#1303745
+#
+# depends upon:
+#	core.schema
+#
+# These definitions are considered experimental due to the lack of
+# a formal specification (e.g., RFC).
+#
+# NOT RECOMMENDED FOR PRODUCTION USE!  USE WITH CAUTION!
+#
+# The Netscape documentation describes this as an auxiliary objectclass
+# but their implementations have always defined it as a structural class.
+# The sloppiness here is because Netscape-derived servers don't actually
+# implement the X.500 data model, and they don't honor the distinction
+# between structural and auxiliary classes. This fact is noted here:
+# http://forum.java.sun.com/thread.jspa?threadID=5016864&messageID=9034636
+#
+# In accordance with other existing implementations, we define it as a
+# structural class.
+#
+# Our definition of memberURL also does not match theirs but again
+# their published definition and what works in practice do not agree.
+# In other words, the Netscape definitions are broken and interoperability
+# is not guaranteed.
+#
+# Also see the new DynGroup proposed spec at
+# http://tools.ietf.org/html/draft-haripriya-dynamicgroup-02
+
+objectIdentifier NetscapeRoot 2.16.840.1.113730
+
+objectIdentifier NetscapeLDAP NetscapeRoot:3
+objectIdentifier NetscapeLDAPattributeType NetscapeLDAP:1
+objectIdentifier NetscapeLDAPobjectClass NetscapeLDAP:2
+
+objectIdentifier OpenLDAPExp11	1.3.6.1.4.1.4203.666.11
+objectIdentifier DynGroupBase	OpenLDAPExp11:8
+objectIdentifier DynGroupAttr	DynGroupBase:1
+objectIdentifier DynGroupOC	DynGroupBase:2
+
+attributetype ( NetscapeLDAPattributeType:198
+	NAME 'memberURL'
+	DESC 'Identifies an URL associated with each member of a group. Any type of labeled URL can be used.'
+	SUP labeledURI )
+
+attributetype ( DynGroupAttr:1
+	NAME 'dgIdentity'
+	DESC 'Identity to use when processing the memberURL'
+	SUP distinguishedName SINGLE-VALUE )
+
+objectClass ( NetscapeLDAPobjectClass:33
+	NAME 'groupOfURLs'
+	SUP top STRUCTURAL
+	MUST cn
+	MAY ( memberURL $ businessCategory $ description $ o $ ou $
+		owner $ seeAlso ) )
+
+# The Haripriya dyngroup schema still needs a lot of work.
+# We're just adding support for the dgIdentity attribute for now...
+objectClass ( DynGroupOC:1
+	NAME 'dgIdentityAux'
+	SUP top AUXILIARY
+	MAY dgIdentity )

Added: directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/inetorgperson.schema
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/inetorgperson.schema?rev=666637&view=auto
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/inetorgperson.schema (added)
+++ directory/shared/branches/bigbang/ldap/src/test/resources/org/apache/directory/shared/ldap/schema/parser/inetorgperson.schema Wed Jun 11 05:19:17 2008
@@ -0,0 +1,155 @@
+# inetorgperson.schema -- InetOrgPerson (RFC2798)
+# $OpenLDAP: pkg/ldap/servers/slapd/schema/inetorgperson.schema,v 1.18.2.2 2007/08/31 23:14:06 quanah Exp $
+## This work is part of OpenLDAP Software <http://www.openldap.org/>.
+##
+## Copyright 1998-2007 The OpenLDAP Foundation.
+## All rights reserved.
+##
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted only as authorized by the OpenLDAP
+## Public License.
+##
+## A copy of this license is available in the file LICENSE in the
+## top-level directory of the distribution or, alternatively, at
+## <http://www.OpenLDAP.org/license.html>.
+#
+# InetOrgPerson (RFC2798)
+#
+# Depends upon
+#   Definition of an X.500 Attribute Type and an Object Class to Hold
+#   Uniform Resource Identifiers (URIs) [RFC2079]
+#	(core.schema)
+#
+#   A Summary of the X.500(96) User Schema for use with LDAPv3 [RFC2256]
+#	(core.schema)
+#
+#   The COSINE and Internet X.500 Schema [RFC1274] (cosine.schema)
+
+# carLicense
+# This multivalued field is used to record the values of the license or
+# registration plate associated with an individual.
+attributetype ( 2.16.840.1.113730.3.1.1
+	NAME 'carLicense'
+	DESC 'RFC2798: vehicle license or registration plate'
+	EQUALITY caseIgnoreMatch
+	SUBSTR caseIgnoreSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+
+# departmentNumber
+# Code for department to which a person belongs.  This can also be
+# strictly numeric (e.g., 1234) or alphanumeric (e.g., ABC/123).
+attributetype ( 2.16.840.1.113730.3.1.2
+	NAME 'departmentNumber'
+	DESC 'RFC2798: identifies a department within an organization'
+	EQUALITY caseIgnoreMatch
+	SUBSTR caseIgnoreSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+
+# displayName
+# When displaying an entry, especially within a one-line summary list, it
+# is useful to be able to identify a name to be used.  Since other attri-
+# bute types such as 'cn' are multivalued, an additional attribute type is
+# needed.  Display name is defined for this purpose.
+attributetype ( 2.16.840.1.113730.3.1.241
+	NAME 'displayName'
+	DESC 'RFC2798: preferred name to be used when displaying entries'
+	EQUALITY caseIgnoreMatch
+	SUBSTR caseIgnoreSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
+	SINGLE-VALUE )
+
+# employeeNumber
+# Numeric or alphanumeric identifier assigned to a person, typically based
+# on order of hire or association with an organization.  Single valued.
+attributetype ( 2.16.840.1.113730.3.1.3
+	NAME 'employeeNumber'
+	DESC 'RFC2798: numerically identifies an employee within an organization'
+	EQUALITY caseIgnoreMatch
+	SUBSTR caseIgnoreSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
+	SINGLE-VALUE )
+
+# employeeType
+# Used to identify the employer to employee relationship.  Typical values
+# used will be "Contractor", "Employee", "Intern", "Temp", "External", and
+# "Unknown" but any value may be used.
+attributetype ( 2.16.840.1.113730.3.1.4
+	NAME 'employeeType'
+	DESC 'RFC2798: type of employment for a person'
+	EQUALITY caseIgnoreMatch
+	SUBSTR caseIgnoreSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+
+# jpegPhoto
+# Used to store one or more images of a person using the JPEG File
+# Interchange Format [JFIF].
+# Note that the jpegPhoto attribute type was defined for use in the
+# Internet X.500 pilots but no referencable definition for it could be
+# located.
+attributetype ( 0.9.2342.19200300.100.1.60
+	NAME 'jpegPhoto'
+	DESC 'RFC2798: a JPEG image'
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.28 )
+
+# preferredLanguage
+# Used to indicate an individual's preferred written or spoken
+# language.  This is useful for international correspondence or human-
+# computer interaction.  Values for this attribute type MUST conform to
+# the definition of the Accept-Language header field defined in
+# [RFC2068] with one exception:  the sequence "Accept-Language" ":"
+# should be omitted.  This is a single valued attribute type.
+attributetype ( 2.16.840.1.113730.3.1.39
+	NAME 'preferredLanguage'
+	DESC 'RFC2798: preferred written or spoken language for a person'
+	EQUALITY caseIgnoreMatch
+	SUBSTR caseIgnoreSubstringsMatch
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
+	SINGLE-VALUE )
+
+# userSMIMECertificate
+# A PKCS#7 [RFC2315] SignedData, where the content that is signed is
+# ignored by consumers of userSMIMECertificate values.  It is
+# recommended that values have a `contentType' of data with an absent
+# `content' field.  Values of this attribute contain a person's entire
+# certificate chain and an smimeCapabilities field [RFC2633] that at a
+# minimum describes their SMIME algorithm capabilities.  Values for
+# this attribute are to be stored and requested in binary form, as
+# 'userSMIMECertificate;binary'.  If available, this attribute is
+# preferred over the userCertificate attribute for S/MIME applications.
+## OpenLDAP note: ";binary" transfer should NOT be used as syntax is binary
+attributetype ( 2.16.840.1.113730.3.1.40
+	NAME 'userSMIMECertificate'
+	DESC 'RFC2798: PKCS#7 SignedData used to support S/MIME'
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 )
+
+# userPKCS12
+# PKCS #12 [PKCS12] provides a format for exchange of personal identity
+# information.  When such information is stored in a directory service,
+# the userPKCS12 attribute should be used. This attribute is to be stored
+# and requested in binary form, as 'userPKCS12;binary'.  The attribute
+# values are PFX PDUs stored as binary data.
+## OpenLDAP note: ";binary" transfer should NOT be used as syntax is binary
+attributetype ( 2.16.840.1.113730.3.1.216
+	NAME 'userPKCS12'
+	DESC 'RFC2798: personal identity information, a PKCS #12 PFX'
+	SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 )
+
+
+# inetOrgPerson
+# The inetOrgPerson represents people who are associated with an
+# organization in some way.  It is a structural class and is derived
+# from the organizationalPerson which is defined in X.521 [X521].
+objectclass	( 2.16.840.1.113730.3.2.2
+    NAME 'inetOrgPerson'
+	DESC 'RFC2798: Internet Organizational Person'
+    SUP organizationalPerson
+    STRUCTURAL
+	MAY (
+		audio $ businessCategory $ carLicense $ departmentNumber $
+		displayName $ employeeNumber $ employeeType $ givenName $
+		homePhone $ homePostalAddress $ initials $ jpegPhoto $
+		labeledURI $ mail $ manager $ mobile $ o $ pager $
+		photo $ roomNumber $ secretary $ uid $ userCertificate $
+		x500uniqueIdentifier $ preferredLanguage $
+		userSMIMECertificate $ userPKCS12 )
+	)



Mime
View raw message