Novell is now a part of Micro Focus

White Pages Application NDS Programming Tutorial: The Demo Application

Articles and Tips: article

LARRY FISHER
Senior Research Engineer
DeveloperNet University

01 Aug 1999


Second in a two-part DeveloperNet University tutorial. Discusses the application look and feel, application description, and directory object model. To proceed with this tutorial, you will need a basic understanding of the OrgChart application and how it is used.

Introduction

To proceed with this tutorial, you need a basic understanding of the OrgChart application and how to use it. To prove to yourself that you understand the application concepts well enough to comprehend the rest of the course, you should take the self-assessment.

This article covers the following areas:

  • Application look and feel

  • Application description

  • Directory object model

Application Look and Feel

All examples in the DeveloperNet tutorial series are buildable Win32 applications. The GUI (Windows programming) part of the application is hidden from you as much as possible. The programming described in this course deals only with the source code pertinent to directory access.

The login window shown in Figure 1 is the first window displayed by the OrgChart application.

Figure 1: OrgChart login window.

By using the login window, a user can obtain an authenticated connection to an NDS directory. Later, we will discuss the code necessary to obtain an authenticated connection. In order for you to obtain an authenticated connection to the NDS directory, the information entered into the login dialog fields must be accurate.

The "Location" field should contain the name of the server or tree as required by your selected access method.

The "User Name" field should contain the distinguished name describing the location of the user object being used to authenticate the connection. Usually, the distinguished name syntax for each access method is different. For information on constructing a distinguished name in your selected access method, refer to Building a Distinguished Name.

The "Password" field should contain the password associated with the user object entered in User Name.

The OrgChart application allows a user to browse an organization in the tree called "VerySmallCompany" which can be installed in the tree with tools from this course's downloadable project directory. When a successful authentication occurs, the OrgChart's main window will appear with the top group in the Very Small Company organization displayed (shown in Figure 2).

Figure 2: OrgChart main window with top group displayed.

All Smiths in the company are managers and so possess organization charts for their groups. All Jones are individual contributors. Selecting a manager's name (for example, Jedd Smith) causes OrgChart to list the members of that manager's group as shown in Figures 3 and 4.

Figure 3: OrgChart list for manager Jedd Smith.

Figure 4: OrgChart list for manager David Smith.

Selecting an individual contributor (for example, Terry Jones) displays that employee's information as shown in the Figure 5.

Figure 5: OrgChart listing for an individual employee.

To view a manager's employee information, select the manager's button from within his organization's chart.

Selecting the "Search" button displays the main search window as shown in Figure 6 with two search options:

  • Last Name. This allows the user to find all user objects in the "VerySmall Company" organization with the entered string value (for example, Jones) as the value in their "surname" attribute.

  • Common Name. This allows the user to find all user objects in the "VerySmall Company" organization with the entered string value as a "cn" value.

Figure 6: The main search window.

A search for "Terry Jones" would result in the window shown in Figure 7.

Figure 7: Search result for an individual employee.

Selecting the search result would result in the window shown in the Figure 8.

Figure 8: Selecting the search result.

Application Description

The application for this tutorial is called OrgChart. Its purpose is to obtain organization (company) personnel information from a network directory for display in a GUI browser.

The application executable consists of two main pieces:

  • OrgChart.EXE. This supplies the GUI you can use to navigate the organization chart. This executable is supplied for you. It loads OrgFunc.DLL.

  • OrgFunc.DLL. This provides directory access functionality to OrgChart. You will write the code for this dynamic library during lessons 201-204 of the White Pages Application NDS Programming Tutorial.

Initially, sample OrgChart data for your test tree is supplied in a ConsoleOne snap-in, which creates an NDS organization called "VerySmallCompany."

However, during lessons 301-402 you will write code for an organization installer to use to install the same data using the directory access method you selected for the tutorial, as shown in Figure 9.

Figure 9: OrgChart.exe and related components.

Directory Object Model

The OrgChart application extends the schema in your target tree to facilitate the links between organizations and users that are necessary to produce an organization chart.

Two main extensions occur:

  • A new class called DNU:OrgChart is added. It is recommended that companies register their new classes in order to keep their class names unique, thereby preventing naming conflicts. For example, in "DNU:OrgChart", the DNU specifies that the class was designed by DeveloperNet University and OrgChart specifies the purpose of the new class.

  • The User class is extended with three new OrgChart specific optional attributes.

The DNU:OrgChart Class

Since the DNU:OrgChart class (shown in Figure 10) inherits from "Top," it gets all of Top's attributes by inheritance. In addition, OrgChart receives three additional attributes from the pool of base attributes that come with the stock NDS schema:

  • Title. This contains the name of the group or department in the organization that the OrgChart object is to describe.

  • Owner. This identifies the user object belonging to the manager who owns (manages) the group in the organization that the OrgChart object is describing.

  • Member. This is a multi-valued attribute. Each distinguished name value added to Member will identify a member of the group.

Figure 10: The DNU OrgChart class.

The User Object, Extended for OrgChart

Because the User class (shown in Figure 11) inherits from several other classes in the NDS base inheritance hierarchy, it already possesses many inherited attributes (not shown). OrgChart extends User so that objects instantiated from it can contain three new OrgChart specific optional attributes:

  • DNU:OrgChart:Manager. This contains the distinguished name of this user's manager. If the user has no manager (for example, the president and CEO), then this attribute is set to [Root], establishing the user at the head of the linked list.

  • DNU:OrgChart:Organization. If the user is a manager, this attribute identifies his or her OrgChart object. If the user is an individual contributor, this attribute is set to [Root], establishing the user as one of the leaf nodes in the linked list.

  • DNU:OrgChart:Picture. This is a Stream attribute containing a picture of the user.

Figure 11: User class.

The extended user objects and OrgChart objects reference each other to form a linked list with forward links and backward links, (as shown in the diagram of a typical group with three members in Figure 12). The information in this group of objects would comprise one page in the OrgChart application.

Note: You can identify end nodes or leafs by their not possessing an "Organization" attribute. You can identify the head of the list by its not possessing a "Manager" attribute.

Figure 12: Diagram of a typical group.

When several OrgChart and user objects are put together, they describe a complete organization as shown in Figure 13.

Note: OrgChart always assumes that there is exactly one manager in each group.

Figure 13: A complete organization.

Summary

This article discussed the OrgChart application and how to use it. The areas covered included the following:

  • Application look and feel

  • Application description

  • Directory object model

After studying this article, you can test your knowledge by going to the Application Concepts Assessment at http://developer.novell.com/education/orgchart_assess.htm.

* 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.

© Copyright Micro Focus or one of its affiliates