Overview

This is a tool for browsing and editing a naming or directory service. You can use this program to browse any namespace or directory for which there is a JNDI service provider. To run it, type runnit (or runnit.bat on Windows).

The browser consists of several tabbed panels. To use a particular provider, click on its tab.

Each tabbed panel consists of a toolbar, a tree area on the left, a list area on the right, and a status line on the bottom. The tree area is for displaying the namespace hierarchy. The list area is for displaying the contents of the selected tree node, or the results of a search. Each tabbed panel is independent and maintains its own state. Here's an overview of the components of this tool.

Toolbar

Here is a summary of the function of each button on the toolbar.
Class
Displays the class name of the selected list or tree node.
Attributes
Brings up a dialog for viewing and updating attributes of the selected list or tree node.
Search
Brings up a dialog for specifying a search starting from the selected tree node.
Schema
Brings up a dialog for viewing the selected tree node's schema. (not yet implemented)
New
Creates a child of the selected tree node.
Remove
Removes the selected tree node.
Reload
Reloads the subtree being selected from the underlying naming system/directory.
Configure
Configure root and environment properties. If changes are applied, reinitialize using the new root and properties.
Console
Displays a console for viewing stack traces.
Help
Displays information on how to use this browser.

Namespace Tree

The tree area is used to display the namespace hierarchy. The root of the namespace is set up when the panel is initialized (see Environment Configuration). You can reset the root using the Configure button. This will reinitialize the namespace hierarchy with the new root.

If a folder is displayed, that means it is a context. The context may be empty. Otherwise, a dot is displayed beside the name. The folder and dot icons are defaults. You can substitute the icon to use by providing a file that maps class names to icon files. (see Icons).

Clicking the dot will expand/close the tree node. Selecting a tree node displays the children of that node in the list area. Clicking a selected node's string name allows you to rename the node. At this point you can edit the string name and press RETURN to rename the node. If you accidentally get into this mode, just select another node or just press RETURN to exit this mode.

List Area

When you select a tree node, the browser updates the list area with the node's children. Double clicking on an entry in the list brings up a dialog for viewing and modifying the attributes of that entry.

If you perform a search, the results of the search are displayed in the list area (previous contents of the list area are cleared). Again, you can double-click on one of these entries to bring up a dialog for viewing and modifying its attributes.

Attributes Dialog

This dialog is for viewing and updating attributes. It consists of a two column table. The left column lists the attribute identifiers. The right column lists the corresponding attribute values. A multivalued attribute will have multiple rows. The dialog has the following buttons.
Add
Adds a blank row for entering a new attribute id/value pair.
Remove
Removes the selected attributes.
Apply
Applies the changes made in this dialog to the underlying directory. The changes are made by removing the attributes that have been renamed or deleted, and replacing the entry's attributes with those being displayed in the dialog.
Dismiss
Dismisses the dialog without making any changes to the directory.
Reload
Reloads the dialog using the attributes with which it was originally created. Any Add/Remove or edits are lost.
To modify an existing attribute id or value, double click on the cell until it is selected for editing.

Note that you cannot have any empty attribute ids. You must delete such rows before pressing Apply.

Note also that after modifying either an attribute id or value, you must hit RETURN or select another attribute id or value to register the change. For example, if you have an attribute id that is still in "editing" mode when you press Apply, the previous value of attribute id will be used.

Search Dialog

This dialog is for specifying a search. It contains a text field for entering the search filter and the search controls to be used with the search. Hitting RETURN in the text field, or pushing the Search button will execute the search and display the results in the list area. The filter and control settings are maintained between different invocations of the Search Dialog. The dialog contains the following buttons.
Search
Executes the search using the filter and controls specified.
Dismiss
Dismisses the dialog without performing the search.
Reload
Reinitializes the dialog using the filter and controls from the last executed search.

Schema Dialog

This dialog is for viewing the schema of the selected tree node. It brings up a panel that resembles the original browser.

New Dialog

This dialog is for creating a new child of the selected tree load. It is similar to the Attributes Dialog with the following two differences:
  1. It contains a text field for entering the name of the child.
  2. The Apply button has been replaced with Create. The Create button executes creation.

The dialog's attributes are initialized using the attributes of the parent. The creation is performed using DirContext.createSubcontext() if the table of attributes contains at least one attribute; otherwise Context.createSubcontext() is used.

Environment Configuration

The browser is preconfigured with a number of providers that JavaSoft has built but it can work with any service provider. In fact, the browser itself has no knowledge of any service provider--the configuration information is provided as arguments to the program. Each parameter to the program is a bar-character ('|') separated string. Each such string consists of the following (in order).
tab label
The label that appears on the tab of the tabbed panel (e.g. LDAP).
class name
Value of the java.naming.factory.initial property (e.g. com.sun.jndi.ldap.LdapCtxFactory).
url
Value of the java.naming.provider.url property (e.g. ldap://wiz.com:389).
root
Root of namespace to browse (e.g. o=wiz,c=us).
auth
Value of java.naming.security.authentication (e.g. CRAM-MD5, none, simple, strong).
principal
Value of the java.naming.security.principal property (e.g. o=Admin,o=wiz,c=us).
passphrase
Value of the java.naming.security.credentials property (e.g. mysecret).

All but the first two are optional. The following is an example of arguments for using JavaSoft's LDAP service provider, using anonymous bind.

LDAP="LDAP|com.sun.jndi.ldap.LdapCtxFactory|ldap://wiz.eng:489|o=wiz,c=us|none"

Because these strings are just passed as is to the java interpreter, there can be no blanks or other special characters in the string. If this is a problem for your provider, you can always modify these environment properties using the Configuration Dialog once you've started the browser.

Configuration Dialog

This dialog is for viewing and updating the namespace root and environment properties. It contains a text field for entering the new root. The center panel consists of a two column table. The left column lists the property names. The right column lists the corresponding property values. The dialog has the following buttons.

Note that after modifying either a property name or value, you must hit RETURN or select another property name or value to register the change. For example, if you have a property value that is still in "editing" mode when you press Apply, the previous value of the property will be used.

Add
Adds a blank row for entering a new property name/value.
Remove
Removes the selected properties.
Apply
Applies the changes made in this dialog to the browser/panel. The namespace hierarchy is reinitialized using the new root and environment properties.
Dismiss
Dismisses the dialog without updating the root or environment properties.
Reload
Reloads the root and properties with which this dialog was originally created. Any Add/Remove or edits are lost.

Console

This window displays stack traces of exceptions thrown by the browser. The stack traces are accumulated even when the console is not visible. Clicking the Clear button clears the display and the current accumulation of stack traces.

Help Dialog

This dialog brings up the documentation for this browser.

Icons

In the tree and list areas, nodes are displayed as either folders or dots. These are the default icons. You can substitute the icons to use by providing a iconmap.properties file. This file contains a mapping of class names to image file names. For example, the following defines three mappings.

java.lang.String=string.gif
com.wiz.Coffee=coffeecup.gif
com.wiz.Person=person.gif

A class can have an expanded version of the icon.

java.lang.File=openFolder.gif
java.lang.File/expanded=openFolder.gif

The above defines two icons for the java.lang.File class: one when the node is expanded and one closed. If only one image is specified, it is used for both the expanded and close images.

The class name used is that returned by NameClassPair.getClassName and its subclasses (Binding and SearchResult).

The iconmap.properties file is found in the directory examples/browser/images, which is the same directory that contains the image files for the browser.