Consider the following points when extending the schema:
- Never modify the default schema files because doing so could damage the Directory Server’s processing capabilities.
- Define all attributes before they can be used in an object class. If you are using the Schema Editor to add new schema elements, use the Quick Add Attributes option when defining new object classes.
- Define the parent object class before creating object classes that inherit from the parent.
- You must name custom schema files according to the following syntax:
- Begin with exactly two digits.
- Follow the two digits with a non-digit character.
- Follow the non-digit character with a zero or more characters.
- End in .ldif.
The two digits don't need to be followed by a dash ("-").
Any files that do not meet this criteria are ignored and either a NOTICE or SEVERE_WARNING message is logged.
Any file in the <server-root>/config/schema directory with a name that starts with "." or ends with a tilde (’~’), .swp, or .tmp generates a NOTICE message indicating that temporary files will be ignored. Any other file that does not meet the naming criteria generates a SEVERE_WARNING message indicating that it will be ignored.
- Define custom attributes and object classes in one file. Typically, this file is the
99-user.ldif. You can specify a different file name that the Directory Server writes to using the
X-SCHEMA-FILEelement and the file name in the definition, as in the following example.
add: attributeTypes attributeTypes: ( 184.108.40.206.4.1.324220.127.116.11.1 NAME 'contractorStatus' EQUALITY booleanMatch SYNTAX 18.104.22.168.4.1.1422.214.171.124.7 SINGLE-VALUE USAGE userApplications X-ORIGIN 'Directory Server Example' X-SCHEMA-FILE '99-custom.ldif' )
- In the white space characters in the schema definitions,
WSPmeans zero or more space characters, and
SPmeans one or more space characters. The LDIF specification states that LDIF parsers should ignore exactly one space at the beginning of each continuation line because continuation lines must begin with a space character.
If you define a new schema definition with each keyword on a separate continuation line, you should add two spaces before an element keyword to guarantee correct formatting. For example, the following attribute definition has two spaces before the keywords
attributeTypes: ( 126.96.36.199 NAME 'owner' SUP distinguishedName X-ORIGIN 'RFC 4519' )
- In a replicated topology, any new schema additions are replicated to other replication
servers to their respective Schema backend. The additions are written to the file specified
X-SCHEMA-FILEextension or written to 99-user.ldif if no file is specified.