Is it possible to programmatically add an extension...
Articles and Tips: qna
01 Jul 2003
Q.
Is it possible to programmatically add an extension to objects? I have created a new auxiliary class, but I can't find any documentation on adding this to an object. Can an auxiliary class be added to base class definitions, so that when an object of that type is created, it automatically has the auxiliary class extension?
A.
You can add an auxiliary class extension to an object by modifying the objectClass attribute of the target object. Add the name of the auxiliary class you wish to add to the objectClass attribute. You remove auxiliary classes by removing the class name from the objectClass attribute.
In versions of eDirectory that pre-date auxiliary classes, this attribute cannot be modified. In versions of eDirectory that do support auxiliary classes, the modification of this attribute value is the only supported mechanism for adding/removing an auxiliary class definition to or from an existing object instance in the tree.
Adding auxiliary classes to a base class definition, however, would go against the concept of what auxiliary classes are supposed to be. Adding extensions to the base object classes is a non-reversible action. Once you extend the schema of a base object class, you can't go back and undo it later on.
With the advent of the auxiliary class, it is possible to create schema extensions that can be applied as necessary to an instance of an object without having to extend that object's base object class definition. What you should do instead is write a snap-in for the NWADMN32/ConsoleOne utilities so that the presence of the auxiliary class relationship is tested for and added, if necessary, before you attempt to add or modify attribute values that belong to the auxiliary class.
* Originally published in Novell AppNotes
Disclaimer
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.