Using Auxiliary Classes When Making NDS Schema Extensions
Articles and Tips: tip
15 Nov 2000
Prior to NDS 8, the only way you could add additional attributes to an NDS object was to extend the base class of that object. This meant that you couldn't remove schema extensions added to the base class. NDS 8 has added the capability to use an "auxiliary class" in order to define additional attributes for an NDS object.
An auxiliary class is a collection of attributes defined by an object class. Auxiliary classes are different from standard schema classes, in that they are applied to existing objects. An auxiliary class can be used instead of adding attributes to existing schema classes, or deriving a new class from an existing class.
There are several benefits to using auxiliary classes:
They don't have to go on every object of a specific type, only on those objects that really need the attributes.
They can be applied to any type of object rather that being added to several existing base classes. For example, you might want some attributes available for User objects, Group objects, and Server objects.
They are easier to remove. Because auxiliary classes are not added to base schema elements, they can be deleted once there are no longer any objects using them. If attributes are added to existing classes, they can't be removed from those classes unless the whole class is deleted and recreated (extensions made to base schema classes cannot be removed at all.)
They don't change published definitions of base classes.
There are also limitations when using auxiliary classes:
They are not available to NDS versions that are prior to NDS8.
They may not be the best choice if every object of a specific type needs the attribute.
To use auxiliary classes, you simply write the auxiliary class name to the object class type of an existing object. Then you can add any values to attributes defined by the auxiliary class.
If you're a network administrator, you must use ConsoleOne and not NDSMGR32 to create auxiliary classes.
If you're a developer you can create auxiliary classes by performing the following:
Use the API NWDSDefineClass() function, the same as you would any new NDS Object class. The Class_Info_T structure must have the classFlags value set with the DS_CONTAINER_CLASS and DS_EFFECTIVE_CLASS flags disabled, and the DS_AUXILIARY_CLASS flag enabled. If these flags are not set properly, the class will appear to be created, but you won't be able use it as an Auxiliary Class. Instead you will receive a -628 error when you attempt to add an improperly created object class to the "Object Class" attribute.
Auxiliary classes don't require a "Super Class" classification and often just include the optional attributes you wish to define for an NDS object.
Add the auxiliary class to an existing instance of an NDS object. This is accomplished by adding the auxiliary class to the "Object Class" attribute of the NDS object instance. Prior to NDS 8, the "Object Class" was read-only. It has been changed in NDS 8 to accommodate auxiliary classes. The API call NWDSModifyObject() can be used to add the auxiliary class to the "Object Class" of the attribute.
Add values for the new attributes as defined by the auxiliary class. The API call NWDSModifyObject() can be used to add attribute values for attributes that are defined by the auxiliary class.
That is all there is to it! To remove the auxiliary class you must remove all values of attributes that are defined by the auxiliary class, then remove the auxiliary class value from the "Object Class" attribute of the NDS object instance.
* Originally published in Novell AppNotes
The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.