2. The Directory Server Access Control Model
3. Understanding the Directory Server Schema
Matching Rule Description Format
Partial Date Or Time Matching Rules
Understanding Attribute Syntaxes
The Attribute Syntax Description Format
Commonly Used Attribute Syntaxes
The Pattern-Matching Syntax Extension
Attribute Type Description Format
Object Class Description Format
Directory Server Object Class Implementation
Understanding DIT Content Rules
DIT Content Rule Description Format
DIT Content Rule Implementation
Understanding DIT Structure Rules
DIT Structure Rule Description Format
DIT Structure Rules and Multiple Schemas
Understanding Matching Rule Uses
4. Directory Server Index Databases
5. Understanding Directory Server Plug-Ins
6. Directory Server Replication
The X-ENUM attribute syntax extension can be used to define new string syntaxes with values restricted to a set of defined, ordered values. The following example defines an X-ENUM attribute to the schema.
$ ldapmodify -p 1389 -h localhost -D "cn=Directory Manager" -w password dn: cn=schema changetype: modify add: ldapsyntaxes ldapSyntaxes: ( 1.3.6.1.4.1.32473.4 DESC 'Day Of The Week' X-ENUM ( 'monday' 'tuesday' 'wednesday' 'thursday' 'friday' 'saturday' 'sunday' ) )
This new syntax can be used to define attributes and object classes, as shown in the following example.
$ ldapmodify -p 1389 -h localhost -D "cn=Directory Manager" -w password dn: cn=schema changetype: modify add: attributetypes attributetypes: ( 1.3.6.1.4.1.32473.5 NAME 'example-attr-enum' SYNTAX 1.3.6.1.4.1.32473.4 ) - add: objectclasses objectclasses: ( 1.3.6.1.4.1.32473.6 NAME 'exampleOCenum' SUP top AUXILIARY MUST example-attr-enum)
Values for example-attr-enum attributes must match the defined pattern, or the server rejects them.
Enumerated values are not case-sensitive, so both of the following examples are accepted:
example-attr-enum: thursday example-attr-enum: Thursday
Enumerated attribute values are literal (and not internationalized), so the following example does not match the pattern and is rejected, regardless of any semantic equivalence:
example-attr-enum: jeudi
The defined values specify an order, so enumerated attributes can be used in relative comparison filters, as shown in the following example:
(example-attr-enum>=wednesday)
The preceding comparison filter matches, for example, a value of thursday. The comparison is based on the order of the enumerated values, and ASCII values are not applicable in this case.