We need parsers and simple beans to populate in for all schema elements given in RFC4512. The elements are:
ObjectClassDescription
AttributeTypeDescription
MatchingRuleDescription
MatchingRuleUseDescription
SyntaxDescription
DITContentRuleDescription
DITStructureRuleDescription
NameFormDescription
This patch includes
- Antlr grammar to generate lexer and parser for ObjectClassDescriptions
- A wrapper class around the generated Antlr parser and lexer
- A bean class for ObjectClassDescriptions
- A syntax checker for ObjectClassDescriptions
- Two test cases to test the parser and syntax checker
I will also implement and add parsers for the other schema elements.
Stefan Seelmann added a comment - 10/Dec/06 08:58 PM This patch includes
- Antlr grammar to generate lexer and parser for ObjectClassDescriptions
- A wrapper class around the generated Antlr parser and lexer
- A bean class for ObjectClassDescriptions
- A syntax checker for ObjectClassDescriptions
- Two test cases to test the parser and syntax checker
I will also implement and add parsers for the other schema elements.
Ersin Er added a comment - 10/Dec/06 10:25 PM Applied the patch provided by Stefan Seelmann here:
http://svn.apache.org/viewvc?view=rev&rev=485262
Thanks again. We are looking forward to applying other remaining patches to close the issue ;-)
Stefan Seelmann added a comment - 12/Dec/06 11:45 PM This patch includes parsers, beans, checkers and test cases for attribute type descriptions and LDAP syntax descriptons.
However we have had a discussion about parsers, and we think that we should have as many parsers as
we have objects to parse, to avoid concurrenct access problems. This is something I will elaborate tomorrow,
because 3am is definitively not the right time to make my brain produce smart things :)
Emmanuel Lecharny added a comment - 13/Dec/06 02:00 AM Applied !
Thanks Stefan for the patch.
However we have had a discussion about parsers, and we think that we should have as many parsers as
we have objects to parse, to avoid concurrenct access problems. This is something I will elaborate tomorrow,
because 3am is definitively not the right time to make my brain produce smart things :)
This patch includes parsers, beans, checkers and test cases for matching rule descriptions and matching rule use descriptions.
It also includes some refactorings:
- AbstractSchemaDescription is a base class for all beans
- AbstractSchemaParser is a base class for all parsers
- SchemaParserTestUtils contains test methods that are common for most schema objects (oid, name, desc, extensions)
Stefan Seelmann added a comment - 16/Dec/06 05:21 PM This patch includes parsers, beans, checkers and test cases for matching rule descriptions and matching rule use descriptions.
It also includes some refactorings:
- AbstractSchemaDescription is a base class for all beans
- AbstractSchemaParser is a base class for all parsers
- SchemaParserTestUtils contains test methods that are common for most schema objects (oid, name, desc, extensions)
This patch includes parsers, beans, checkers and test cases for DIT content rule descriptions, DIT structure rule descriptions and name form descriptions.
Stefan Seelmann added a comment - 17/Dec/06 07:35 PM This patch includes parsers, beans, checkers and test cases for DIT content rule descriptions, DIT structure rule descriptions and name form descriptions.
Current features:
- Accepts any order of elements, of course the OID must be the first
- Checks that each element only appears once
- Checks for required elements (e.g. AT requires at least one of SYNTAX or SUP, but both are optional)
The parser could do more semantic checks. Some ideas:
- No duplicate values in multivalued elements (e.g. "... MUST ( cn, cn )..." )
- SUP in ObjectClass, AttributeType or DITStructureRule should not point to itself
- MUST and MAY in ObjectClass should be disjoint.
- MUST, MAY and NOT in DITContentRule should be disjoint.
- MUST and MAY in NameForm should be disjoint.
On the other side when checking for duplicate/disjoint values there is a problem with alternative identifiers: MUST contains name (cn), MAY contains OID (2.5.4.3 ) or an alternative name (commonName). The parser doesn't know that they are equal.
Stefan Seelmann added a comment - 17/Dec/06 08:34 PM All parsers are implemented.
Current features:
- Accepts any order of elements, of course the OID must be the first
- Checks that each element only appears once
- Checks for required elements (e.g. AT requires at least one of SYNTAX or SUP, but both are optional)
The parser could do more semantic checks. Some ideas:
- No duplicate values in multivalued elements (e.g. "... MUST ( cn, cn )..." )
- SUP in ObjectClass, AttributeType or DITStructureRule should not point to itself
- MUST and MAY in ObjectClass should be disjoint.
- MUST, MAY and NOT in DITContentRule should be disjoint.
- MUST and MAY in NameForm should be disjoint.
On the other side when checking for duplicate/disjoint values there is a problem with alternative identifiers: MUST contains name (cn), MAY contains OID (2.5.4.3 ) or an alternative name (commonName). The parser doesn't know that they are equal.
Alex Karasulu added a comment - 05/Feb/07 04:19 PM Adding a request for 3 more parsers for apacheDS specific operational attributes present in the schema subentry:
syntaxCheckers
comparators
normalizers
I will give syntaxes for this soon.
TODOs:
- We have to check the grammars, especially the base64 and fqcn productions must be specified
- Then the parsers must be improved
- And of course we need tests for these schema parsers
- Antlr grammar to generate lexer and parser for ObjectClassDescriptions
- A wrapper class around the generated Antlr parser and lexer
- A bean class for ObjectClassDescriptions
- A syntax checker for ObjectClassDescriptions
- Two test cases to test the parser and syntax checker
I will also implement and add parsers for the other schema elements.