DirXML Lab1

Welcome to the DirXML Overview course Lab 1. This lab utilizes the VRTest application developed by the Novell DirXML team for testing DirXML.

Install the VRTest driver

The VRTest application was created to test the DirXML infrastructure and to provide an example of a DirXML driver. It consists of four components:

  • VRTestServer -- A configurable server that acts as the external application. Configuration files have been set up so that it can simulate either a flat or a hierarchical directory.

  • VRTestClient -- A client application that allows you to view and manipulate server data. From this application, you can create, delete, and modify records. You can then watch these modifications as they are synchronized into eDirectory.

  • VRTestAPI -- The programming interface for communicating with the VRTestServer application. Both vrtest_driver and VRTestClient use this interface. You can compare this interface to the interface available from your external application to determine if your application's interface contains the functionality required for a DirXML driver.

  • vrtest_driver -- The DirXML driver that connects eDirectory and the VRTestServer and allows data to synchronize between the two.

VRTest Application

The VRTest application is a Novell-written application used internally by the DirXML team for testing DirXML. The VRTest application can simulate various types of applications including directories with a hierarchical structure and applications with a flat structure. The executables are:

  • VRTestServer.exe -- A server application with a configurable schema. The server application uses TCP/IP to communicate with clients.

  • VRTestClient.exe -- A client application used to communicate with an instance of the server application.

  • vrtest_driver.dll -- A DirXML driver used to connect a Novell Directory Services server running DirXML with an instance of the VRTest server application.

  • VRTestAPI.dll -- An API dll used by the client application and the DirXML driver to communicate with the server application.

  • sal.dll -- A dll used to provide LDAP funtionality.

The VRTest application is found in the installation location\DirXML\VRDriver, which contain the executable, a batch file to simplify invoking separate instances of the server and client, and several preconfigured schema/DirXML driver combinations. The following preconfigured schemas and preconfigured DirXML driver files are provided in directories named:

  • 01 - A simple, flat application containing a user class.

  • 02 - A simple, hierarchical directory simulation containing a user class, and organization class, and an organizational unit class.

  • Ex - A schema that simulates the Microsoft Exchange schema supported by the DirXML Exchange driver.

  • Ps - A schema that simulates the default PeopleSoft schema supported by the DirXML PeopleSoft driver.

Requirements and Installation

The VRTestServer application requires a Win32 client or server running eDirectory 8.5 or greater. To install the application and driver, complete the following steps.

  1. Download VRDriver_Lab1.zip by selecting the download button on the bottom of the screen.

  2. From the VRDriver\drivers\vrtest\Programs directory, copy the following files to the c:\Novell\NDS directory. The c:\Novell\NDS directory is the default installation directory for eDirectory. Change the path to match your installation.

    VRTestAPI.dll
    vrtest_driver.dll
    sal.dll
  1. Import the appropriate preconfigured driver file using ConsoleOne. The preconfigured driver files are found in the rules subdirectory under the primary instance directory. For example, VRDriver\drivers\vrtest\01\rules\vrtest_02.xml contains a preconfigured driver file that can be used with the 02 schema.

  2. Start DSTrace.

  3. Start the driver from driverSet->Properties in ConsoleOne.

Running VRTest

The VRTest server and client are typically invoked via a batch file from the Program directory found in the distribution. To load the VRTest server with the sample hierarchical schema, open a DOS box the following command is used:

vrtest server 02 load

To load the VRTest client application and communicate with the server the following command is used:

vrtest client 02

To unload the VRTest server with the server the following command is used:

vrtest server 02 unload

To invoke instances with other schemas simply replace the "02" in the above command with "01", "Ex", or "Ps".

You should be able to modify the directory or the application using the application and ConsoleOne.

VRTestServer

URTestServer has a wealth of command line parameter as detailed in the table below.

Usage: vrtestserver {-iu?} [-config=filename] | [[-port=TCP port] [-schema=filename] [-storage=filename]]

Parameter Description
i
Install or load the server.
u
Uninstall or unload the server.
?
Display the usage message
config=filename
Specify a configuration file which contains the TCP port, schema file name, and storage file name.

The format of the file is:
portnumber
schema filename
storage filename
port=portnumber
Specify the base TCP port number. The base port number and the base port number plus one are used. Defaults to 3000.
schema=filename
Specify the name of the file containing the schema definition. Defaults to "schema.txt".

storage=filename
Specify the name of the file containing the persistent store for the server. Defaults to "storage.txt".

Note:
A VRTest server instance uses two TCP ports: the specified port number and the specified port number plus 1. For example, if 3000 is specified, 3000 and 3001 are used.

VRTestClient

VRTestClient also had command line parameters. See the table below for more information.

usage: vrtestclient [-host=hostname -port=portnumber] | [-config=filename]

Parameter Description
-host=hostname
host name or IP address of server running the VRTest server instance with which to connect. Defaults to "localhost".
-port=portnumber
TCP port number on which to connect to server. This must match the port number specified for the server instance. Default to 3000.
-config=filename
Specify a configuration file which contains the host name and TCP port number to use.

The format of the file is:
hostname
portnumber

Creating a Custom Schema

The schema for an instance of the VRTest server is specified by a text file containing schema information. The default name of the schema file is "schema.txt".

The following in an example schema file.

//Test schema
Schema "First Test Schema"
casesensitive false
hierarchical true
subtreedelete true
uniqueids true

class
name " Organization"
container true
attribute
name "Name"
maxLength 128
indexed true
class
name "Organizational Unit"
container true
attribute
name "Name"
maxLength 128
indexed true

class
name "User"
container false
attribute
name "cn"
maxLength 20
required true
multiValued false
indexed true
// unique true
// casesensitive true
attribute
name "Surname"
maxLength 30
required false
multiValued false
indexed false
unique false
casesensitive false
attribute
name "Given Name"
maxLength 20
required false
multivalued false
indexed false
unique false
casesensitive false
attribute
name "Telephone Number"
maxLength 15
required false
multiValued true
/*
attribute
name "phone number"
maxLength 15
required false
multiValued true
*/

class
name "Bogus"
container false
attribute
name "Whatever"
maxLength 50
multiValued true

Schema, class, and attribute names are enclosed in double quotes. This allows spaces to be used in names. Boolean values are specified using "true" and "false". Numeric values are specified using positive integers.

Comments may be specified in a schema file in the C++ fashion: a double forward slash indicates that all characters following the "//" on the line are comments. A block of text may be delimited as a comment using "/*" and "*/".

The schema as a whole may have the following properties specified:

Property Description Default Value
Schema
The name of the schema.
none
casesensitive
If "true", object attribute values in the schema are compared in a case-sensitive fashion.
true
hierarchical
If "true", classes may be containers, i.e., they may contain objects.
false
subtreedelete
If "true", subtree hierarchies rooted at a container may be deleted by deleting the subtree root. If "false", containers may not be deleted unless empty.
false
uniqueids
If "true", each object is identified by a unique value generated by the server instance. Note that unique ids must be true to use a schema instance with the DirXML driver for VRTest.
true

Each class in the schema may have the following properties specified:

Property Description Default Value
name
The name of the class. This must be specified and must be unique among classes in the schema.
none
container
If "true", and if the schema is declared to be hierarchical, then the class is a container and may contain other objects.
false
casesensitive
If "true", object attribute values in the class are compared in a case-sensitive fashion. This value overrides the schema-wide setting for the class containing the value.
true

Each attribute in a schema may have the following properties specified:

Property Description Default Value
name
The name of the attribute. This must be specified and must be unique among attributes defined in the containing class.
none
maxLength
The maximum length, in characters, of a value of the attribute.
unlimited
required
If "true", the attribute value must be specified on an object or the object cannot be created.
false
multiValued
If "true", multiple values are allowed for the attribute on an object.
false
indexed
If "true", an internal index is built and maintained by the server to improve search performance.
false
unique
If "true", the attribute value must be unique among all objects of the class contained in the server.
false
casesensitive
If "true", object attribute values are compared in a case-sensitive fashion. This value overrides the schema-wide and class-wide setting.
true

Note:
Do not change the schema definition file without first deleting any storage file ("storage.txt" by default).

DirXML Driver

The DirXML driver for the VRTest application is found in vrtest_driver.dll. This file, together with VRTestAPI.dll must be copied to the executable directory of eDirectory (normally C:\Novell\Nds).

Driver Parameters

Parameter Description Default Value
Host name or IP address
Specifies the name or IP address of the server to which the driver is to connect to the VRTest server instance.
localhost
TCP port number
Specifies the base TCP port through which the driver is to connect to the VRTest server instance.
none
Allow Loopback
Allow events initiated on the driver's subscriber channel to loop back to DirXML via the publisher channel. Useful for simulating drivers that cannot detect loopback.
no
Use Filter
Use the publisher filter that is passed from DirXML to the driver's publisher init method. If the filter is not used, all events on classes and attributes will be submitted to DirXML even if the class or attribute is not in the publisher filter.
yes
Log Input To Nds
Create a log file containing all documents sent to DirXML on the publisher channel. The log file is named "publisher.log" and will be placed in the system's temp directory.
no
Save state with each event
Write driver state information with each event published. This is normally only useful for testing the DirXML engine.
no
Simulate record-level-only change notification
Simulate a driver that can only tell that a record changed, not which field within a record changed.
no



Download Sample Code - 16.4MB
Previous blank Table of Contents blank Next