Issue Details (XML | Word | Printable)

Key: DIRSERVER-793
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Stefan Seelmann
Reporter: Ersin Er
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Directory ApacheDS

Implement parsers and simple beans for all schema elements in RFC4512

Created: 10/Dec/06 08:12 PM   Updated: 23/Feb/07 08:24 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 1.5.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works shared-ldap-trunks-ATD-LSD.patch 2006-12-12 11:45 PM Stefan Seelmann 105 kB
Text File Licensed for inclusion in ASF works shared-ldap-trunks-DCRD-DSRD-NFD.patch 2006-12-17 07:35 PM Stefan Seelmann 171 kB
Text File Licensed for inclusion in ASF works shared-ldap-trunks-MRD.patch 2006-12-16 05:21 PM Stefan Seelmann 152 kB
Text File Licensed for inclusion in ASF works shared-ldap-trunks-MRD2.patch 2006-12-16 08:35 PM Stefan Seelmann 71 kB
Text File Licensed for inclusion in ASF works shared-ldap-trunks-ObjectClassDescription.patch 2006-12-10 08:58 PM Stefan Seelmann 83 kB
Text File Licensed for inclusion in ASF works shared-ldap-trunks-UNESC.patch 2006-12-18 10:46 PM Stefan Seelmann 3 kB

Resolution Date: 23/Feb/07 08:24 PM


 Description  « Hide
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


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
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.

Stefan Seelmann made changes - 10/Dec/06 08:58 PM
Field Original Value New Value
Attachment shared-ldap-trunks-ObjectClassDescription.patch [ 12346849 ]
Repository Revision Date User Message
ASF #485262 Sun Dec 10 21:15:25 UTC 2006 ersiner Applying Stefan Seelmann's patch for DIRSERVER-793.
Thank you Stefan!
Files Changed
ADD /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassDescriptionSyntaxChecker.java
ADD /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassDescription.java
ADD /directory/trunks/shared/ldap/src/main/antlr/schema-qdstring.g
ADD /directory/trunks/shared/ldap/src/main/antlr/schema.g
MODIFY /directory/trunks/shared/ldap/pom.xml
ADD /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParser.java
ADD /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassDescriptionSyntaxCheckerTest.java
ADD /directory/trunks/shared/ldap/src/main/antlr/schema-extension.g
ADD /directory/trunks/shared/ldap/src/main/antlr/schema-value.g
ADD /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserObjectClassDescriptionTest.java

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.

Stefan Seelmann made changes - 12/Dec/06 11:45 PM
Attachment shared-ldap-trunks-ATD-LSD.patch [ 12347048 ]
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 :)

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)

Stefan Seelmann made changes - 16/Dec/06 05:21 PM
Attachment shared-ldap-trunks-MRD.patch [ 12347348 ]
Repository Revision Date User Message
ASF #487835 Sat Dec 16 17:51:11 UTC 2006 akarasulu applying patch from seelmann associated with DIRSERVER-793
Files Changed
MODIFY /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescriptionSyntaxCheckerTest.java
MODIFY /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/parser/ObjectClassDescriptionSchemaParser.java
MODIFY /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/LdapSyntaxDescription.java
MODIFY /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeDescription.java
MODIFY /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassDescription.java
MODIFY /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserLdapSyntaxDescriptionTest.java
MODIFY /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/parser/LdapSyntaxDescriptionSchemaParser.java
MODIFY /directory/trunks/shared/ldap/src/main/antlr/schema.g
MODIFY /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassDescriptionSyntaxCheckerTest.java
MODIFY /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserAttributeTypeDescriptionTest.java
MODIFY /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeDescriptionSyntaxCheckerTest.java
MODIFY /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/parser/AttributeTypeDescriptionSchemaParser.java
MODIFY /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserObjectClassDescriptionTest.java

Alex Karasulu added a comment - 16/Dec/06 05:52 PM
Applied shared-ldap-trunks-MRD.patch on commit revision 487835 here:

     http://svn.apache.org/viewvc?view=rev&revision=487835

Thanks Seelmann!!!

Stefan Seelmann added a comment - 16/Dec/06 08:35 PM
Some file were missing in the last patch, sorry.

Stefan Seelmann made changes - 16/Dec/06 08:35 PM
Attachment shared-ldap-trunks-MRD2.patch [ 12347350 ]

Emmanuel Lecharny made changes - 16/Dec/06 09:15 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Emmanuel Lecharny added a comment - 16/Dec/06 09:20 PM
Was closed a little bit too early :)

Emmanuel Lecharny made changes - 16/Dec/06 09:20 PM
Status Resolved [ 5 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
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.

Stefan Seelmann made changes - 17/Dec/06 07:35 PM
Attachment shared-ldap-trunks-DCRD-DSRD-NFD.patch [ 12347364 ]
Repository Revision Date User Message
ASF #488033 Sun Dec 17 19:51:56 UTC 2006 ersiner Applied Stefan Seelmann latest patch for DIRSERVER-793.
Files Changed
MODIFY /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleUseDescriptionSyntaxChecker.java
MODIFY /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserMatchingRuleUseDescriptionTest.java
MODIFY /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/ObjectClassDescriptionSyntaxChecker.java
MODIFY /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserMatchingRuleDescriptionTest.java
MODIFY /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserLdapSyntaxDescriptionTest.java
MODIFY /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/AttributeTypeDescriptionSyntaxChecker.java
MODIFY /directory/trunks/shared/ldap/src/main/antlr/schema.g
MODIFY /directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/MatchingRuleDescriptionSyntaxChecker.java
MODIFY /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserAttributeTypeDescriptionTest.java
MODIFY /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserTestUtils.java
MODIFY /directory/trunks/shared/ldap/src/main/antlr/schema-value.g
MODIFY /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserObjectClassDescriptionTest.java

Ersin Er added a comment - 17/Dec/06 07:53 PM
shared-ldap-trunks-DCRD-DSRD-NFD.patch has been committed here:

http://svn.apache.org/viewvc?view=rev&revision=488033

I think we're close to end of this big parser party. Go Stefan!

Ersin Er added a comment - 17/Dec/06 08:01 PM

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.

Stefan Seelmann added a comment - 18/Dec/06 10:46 PM
Unescapes escaped backslash and single-quote in qdstring

Stefan Seelmann made changes - 18/Dec/06 10:46 PM
Attachment shared-ldap-trunks-UNESC.patch [ 12347450 ]
Repository Revision Date User Message
ASF #488456 Mon Dec 18 23:42:52 UTC 2006 akarasulu committing patch from seelmann for JIRA issue DIRSERVER-793
Files Changed
MODIFY /directory/trunks/shared/ldap/src/main/antlr/schema-qdstring.g
MODIFY /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserTestUtils.java

Ersin Er added a comment - 05/Feb/07 12:47 PM
Assigning this issue to Stefan, so that he can review for last time and resolve it.

Ersin Er made changes - 05/Feb/07 12:47 PM
Assignee Stefan Seelmann [ seelmann ]
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.

Repository Revision Date User Message
ASF #503922 Mon Feb 05 23:31:57 UTC 2007 seelmann DIRSERVER-793: Replaced unicode characters by string literals
Files Changed
MODIFY /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserMatchingRuleDescriptionTest.java
MODIFY /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserLdapSyntaxDescriptionTest.java
MODIFY /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserAttributeTypeDescriptionTest.java
MODIFY /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserNameFormDescriptionTest.java
MODIFY /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserObjectClassDescriptionTest.java
MODIFY /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserTestUtils.java
MODIFY /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserDITStructureRuleDescriptionTest.java
MODIFY /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserMatchingRuleUseDescriptionTest.java
MODIFY /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/SchemaParserDITContentRuleDescriptionTest.java

Stefan Seelmann added a comment - 16/Feb/07 11:07 PM
The three ADS specific parsers were added here: http://svn.apache.org/viewvc?view=rev&rev=504368
The schema syntaxes are here: http://cwiki.apache.org/confluence/display/DIRxSRVx11/ApacheDS+Specific+Schema+Descriptions

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

Alex Karasulu added a comment - 23/Feb/07 08:24 PM
It's all been done. Thanks Stefan!

Alex Karasulu made changes - 23/Feb/07 08:24 PM
Resolution Fixed [ 1 ]
Status Reopened [ 4 ] Closed [ 6 ]