9.3. Managing Object Classes
The Directory Server Console can manage and show the directory schema's object classes. You can view all of the current object classes and create, edit, and delete object class extensions to the schema. The following sections describe how to manage object classes:
For information on managing attributes, see Section 9.2, “Managing Attributes”.
To view information about all object classes that currently exist in the directory schema, do the following:
In the Directory Server Console, select the Configuration tab.
In the navigation tree, select the Schema folder, and then select the Object Classes tab in the right pane.
In the Object Classes list, select the object class to view.
This tab displays information about the standard or user-defined object class selected.
The fields and lists in the Object Classes tab are described in Table 9.2, “Object Classes Tab Reference”.
Field | Description | |||
---|---|---|---|---|
Parent |
The parent identifies the object class from which this object class inherits its attributes and structure. For example, the parent object for the inetOrgPerson object class is the organizationalPerson object. That means that an entry with the object class inetOrgPerson must also include the object class organizationalPerson .
|
|||
OID |
The object identifier of the attribute. An OID is a string, usually of dotted decimal numbers, that uniquely identifies an object, such as an object class or an attribute. If an OID is not specified, the Directory Server automatically uses object-class_name-oid . For example, if the object division is created without supplying an OID, the Directory Server automatically uses division-oid as the OID.
CAUTION
Using an alphanumeric OID such as |
|||
Object Classes | Lists all of the standard and user-defined object classes in the Directory Server schema. | |||
Required Attributes | Contains a list of attributes that must be present in entries that use this object class, including inherited attributes. | |||
Allowed Attributes | Contains a list of attributes that may be present in entries that use this object class, including inherited attributes. |
A new object class must be created with a unique name, a parent object, and required and optional attributes. To create an object class, do the following:
In the Directory Server Console, select the Configuration tab.
In the navigation tree, select the Schema folder, and then select the Object Classes tab in the right pane.
In the Object Classes list, select the object class.
Click Create in the Object Classes tab.
The Create Object Class dialog box opens.
Enter a unique name for the object class in the Name text box.
Enter an object identifier for the new object class in the OID (Optional) text box.
OIDs are described in Table 9.2, “Object Classes Tab Reference”.
Select a parent object for the object class from the Parent drop-down menu.
Any existing object class can be the parent of the new object class. See Table 9.2, “Object Classes Tab Reference” for more information on parent object classes.
To add an attribute that must be present in entries that use the new object class, highlight the attribute in the Available Attributes list, and then click the Add button to the left of the Required Attributes box.
Both standard attributes and user-defined are allowed. For information on creating custom attributes, see Section 9.2.2, “Creating Attributes”.
To add an attribute that may optionally be present in entries that use the new object class, highlight the attribute in the Available Attributes list, and then click the Add button to the left of the Allowed Attributes box.
To remove an attribute belonging to the object class, highlight the attribute in the Required Attributes list or the Allowed Attributes list, and then click the Remove button.
Attributes that are inherited from the parent object classes cannot be removed, regardless of whether they are allowed or required.
Click OK to save the new object class.
Only user-defined object classes can be edited. You cannot edit a standard object class. To edit a user-defined object class in the Directory Server Console, do the following:
In the Directory Server Console, select the Configuration tab.
In the navigation tree, select the Schema folder, and then select the Object Classes tab in the right pane.
Select the object class to edit from the Object Classes list, and click Edit.
The Edit Object Class dialog box opens.
To change the name of the object class, enter the new name in the Name text box.
To change the object identifier for the object class, enter the new OID in the OID (Optional) text box. OIDs are described in Table 9.2, “Object Classes Tab Reference”.
To change the parent object for the object class, select the new parent from the Parent pull-down menu.
To add an attribute that must be present in entries that use the new object class, highlight the attribute in the Available Attributes list, and then click the Add button to the left of the Required Attributes box.
Both standard attributes and user-defined attributes are allowed for the object class. Creating custom attributes is described in Section 9.2.2, “Creating Attributes”.
To add an attribute that may be present in entries that use the new object class, highlight the attribute in the Available Attributes list, and then click the Add button to the left of the Allowed Attributes box.
To remove an attribute from the object class, highlight the attribute in the Required Attributes list or the Allowed Attributes list, and then click the Remove button.
Inherited attributes cannot be removed, regardless of whether they are required or allowed.
Click OK.
Only user-defined object classes can be deleted. You cannot delete standard object classes. To delete an object class, do the following:
In the Directory Server Console, select the Configuration tab.
In the navigation tree, select the Schema folder, and then select the Object Classes tab in the right pane.
Select the object class to remove, and click Delete.
If prompted, confirm the delete.
The server immediately deletes the object class. There is no undo.