6.1.3 Schema Class Object

The Schema Class object is used to define a class of objects that can be created in the namespace. This object supports the mandatory interface IADs, as well as one COM interface, IADsClass. A given Schema Class object contains lists of the property names it must contain in the MandatoryProperties list. Optional poperties that the class may contain appear in the OptionalProperties list Properties used to name this object appear in the NamingProperties list. The IADs.Name property for a Schema Class object must be valid for use in filter and create operations in the containers that appear in the IADsClass.Containment array, if supported (see below).

Figure 5 illustrates how a Class object relates to other Class objects and Property objects, to create a definition of a class.

Figure 7 - Definition of a Class

Schema Classes are identified in the schema by name. The CLSID property indicates which COM object implements the class.

6.1.3.1 IADsClass

The IADsClass interface is used to get and set the properties on a class object. The interface definition is as follows

[ object, uuid(IID_IADsClass), oleautomation, dual ]

interface IADsClass: IADs

{

// Read-only Properties

[propget]

HRESULT PrimaryInterface ([out, retval]BSTR *pbstrGUID);

// Read/write properties.

[propget]

HRESULT CLSID ([out, retval]BSTR *pbstrCLSID);

[propput]

HRESULT CLSID ([in]BSTR bstrCLSID);

[propget]

HRESULT OID ([out, retval]BSTR *pbstrOID);

[propput]

HRESULT OID ([in]BSTR bstrOID);

[propget]

HRESULT Abstract([out, retval]boolean *pbAbstract);

[propput]

HRESULT Abstract([in]boolean bAbstract);

[propget]

HRESULT Auxiliary([out, retval]boolean *pbAuxilary);

[propput]

HRESULT Auxiliary([in]boolean bAuxiliary);

[propget]

HRESULT MandatoryProperties ([out, retval]VARIANT *pvarMandatory);

[propput]

HRESULT MandatoryProperties ([in]VARIANT varMandatory);

[propget]

HRESULT OptionalProperties ([out, retval]VARIANT *pvarOptionak);

[propput]

HRESULT OptionalProperties ([in]VARIANT varOptional);

[propget]

HRESULT NamingProperties ([out, retval]VARIANT *pvarNaming);

[propput]

HRESULT NamingProperties ([in]VARIANT varNaming);

[propget]

HRESULT DerivedFrom ([out, retval]VARIANT *pvDerivedFrom);

[propput]

HRESULT DerivedFrom ([in]VARIANT vDerivedFrom);

[propget]

HRESULT AuxDerivedFrom ([out, retval]VARIANT *pvAuxDerivedFrom);

[propput]

HRESULT AuxDerivedFrom ([in]VARIANT vAuxDerivedFrom);

[propget]

HRESULT PossibleSuperiors ([out, retval]VARIANT *pvSuperiors);

[propput]

HRESULT POssibleSuperiors ([in]VARIANT vSuperiors);

[propget]

HRESULT Containment ([out, retval]VARIANT *pvContainment);

[propput]

HRESULT Containment ([in]VARIANT vContainment);

[propget]

HRESULT Container ([out, retval]boolean *pbContainer);

[propput]

HRESULT Container ([in]boolean bContainer);

[propget]

HRESULT HelpFileName ([out, retval]BSTR *pbstrHelpFile);

[propput]

HRESULT HelpFileName ([in]BSTR bstrHelpFile);

[propget]

HRESULT HelpFileContext ([out, retval]long *plHelpContext);

[propput]

HRESULT HelpFileContext ([in]long lHelpContext);

// Methods

HRESULT Qualifiers([out, retval]IADsCollection **ppQualifiers)

};

Method

Description

CLSID

Gets and sets the CLSID of the code implementing the Active Directory object for this class.

OID

Gets and sets the namespace-specific Object Identifier defining this class. This is provided to allow schema extension via Active Directory in namespaces that require namespace-specific OIDs for classes.

Abstract

Gets and sets a Boolean value indicating whether this class is Abstract or non-abstract. When TRUE this class is an Abstract class and cannot be directly instantiated in the DS. Abstract classes can only be used as superclasses.

Auxiliary

Gets and sets a Boolean value indicating whether this class is Auxiliary. When TRUE this class is an Auxiliary class and cannot be directly instantiated in the DS. Auxiliary classes can only be used as superclasses of other Auxiliary classes or as a source of additional properties on structural classes..

MandatoryProperties

Gets and sets an array of BSTRs listing the properties that must be set for this class to be written to storage

OptionalProperties

Gets and sets an array of BSTRs listing the additional properties that may be set for this class.

NamingProperties

Gets and sets and array of BSTRs listing the properties that provide the Relative Distinguished Name (RDN) for this property.

PrimaryInterface

Gets and sets the primary interface identifier for objects of this class. This is the IID for the interface defining the class, for example the "user" class is defined by supporting IADsUser; the Primary interface is identified by the GUID represented by IID_IADsUser.

Must be in the standard string format of a GUID as defined by COM. This GUID is the value that will appear in the IADs.GUID property in instances of this class.

Identifying a schema class by IID of the class code's primary interface enables the use of QueryInterface at run time to determine whether an object is of the desired class.

For objects that directly support properties this interface must be the interface that supports the property get/put VTABLE, if one is provided. Objects that do not support a specific dual interface for property get and put must return IID_IADs in this property.

See below.

DerivedFrom

Gets an array of ADsPath strings that indicate the immediate superclasses from which this class was derived.

AuxDerivedFrom

Gets an array of ADsPath strings that indicate the Auxiliary classes contributing to this class.

PossibleSuperiors

Gets an array of ADsPath strings that indicate classes that can contain instances of this class..

Containment

Gets and sets the object types that can be contained within this container.

Object creation is done as a container operation e.g. the container decides whether or not an object can be created within it

Container

Gets and sets the property that determines if this class is a DS container.

HelpFileName

OPTIONAL. Gets and sets the name of a help file (no path) that contains further information about objects of this class. Providers that do not implement this property must return E_ADS_PROPERTY_NOT_SUPPORTED when this property is referenced.

HelpFileContext

OPTIONAL. Gets and sets the context ID inside HelpFileName where specific information on this class can be found. . Providers that do not implement this property must return E_ADS_PROPERTY_NOT_SUPPORTED when this property is referenced.

Qualifiers

OPTIONAL method returning a collection of Active Directory objects describing additional qualifiers of this property. Qualifier objects are provider specific.

Providers that do not implement the Qualifiers collection must return E_NOTIMPL when the Qualifiers method is called.


6.1.3.2 Primary Interface

All Active Directory objects are identified by a "Primary Interface". This is the IID of the object specific interface supported by the object's implementation, This is the interface that supports the VTABLE methods for getting and setting the property values. PrimaryInterface also allows a client program to determine at run time whether an interface pointer returned by an Active Directory operation (enumeration for example) is of the desired class by calling QueryInterface. For example, a client has an interface pointer returned by enumeration. To determine if the returned interface is that of a user object, the client QI's for IID_IADsUser. If the client does not know what interface to query for, the PrimaryInterface field in the Schema Class for that object can be used.

When a provider does not know what interface should be returned as the primary interface, IID_IADs should be returned, since all the IADs interface provides name-bound access to all properties of an object through IDispatch and through the ::Get and ::Put methods.