Stay Informed

Sign up to whitepaper announcements here.

From the Isode blog...

Subscribe to RSS headline updates from:
Powered by FeedBurner

 

Creative Commons

Creative Commons License
Isode's whitepapers are licenced under a Creative Commons Licence.

Summary: This Isode White Paper describes the Isode strategy for the development of it's management tools, and explains the rationale for using Tcl/Tk as a scripting language and framework for developing extensible management tools used in conjunction with Isode server products. The document describes the extensibility and integration that is enabled by the Tcl/Tk programming environment, and includes illustrations of how Tcl and Tk libraries fit into a component-based management tool architecture.

Share this whitepaper:

Isode is a leading supplier of messaging and directory server products, which provide connectivity within and between organizations in a multi-vendor environment. These servers are managed by a set of flexible and extensible configuration tools, based on the Tcl/Tk scripting language and graphical toolkit.
Introduction

Electronic messaging, directory, and security technology is increasingly critical to the enterprise. In many cases a proprietary approach and inflexible management tools inhibit effective deployment. What is needed is a more open, flexible and extensible architecture so that customizing, integrating, and extending the management tools is possible. Scripting language technology and windowing can provide the framework within which to build powerful enterprise-wide server and management tools.

In addition to the flexibility and extensibility that is offered by Tcl, it also typically provides a reduction in development to about 20% of that which would be required for a systems language such as C++ or Java. (The March 1998 edition of IEEE Computer has an article by John Ousterhout, entitled 'Scripting: Higher Level Programming for the 21st Century' which is available at http://home.pacbell.net/ouster/scripting.html). This is a significant commercial advantage for Isode, as it reduces development costs and time to market.

The Tcl and Tk Toolkits

Tcl is a proven scripting language technology, openly available from Scriptics Incorporated. The language has an extensible command syntax that integrates well with existing C or C++ libraries. Tcl is designed to be used in conjunction with an interpreter embedded in an application. The Tk extension to Tcl provides graphical capabilities for Tcl programs. The combined scripting and graphical presentation capabilities of the combined Tcl/Tk toolkit permit rapid implementation of graphical user interfaces on both UNIX and Microsoft Windows platforms in such a way that the tools can be easily extended and integrated with other tools built using Tcl/Tk.

The major feature of the Tcl language and interpreter is that Tcl commands can be defined for the primitive operations in an application, where those operations are C or C++ functions. Tcl scripts can call these commands, as well as define new commands in the Tcl language, and dynamically load other Tcl scripts or compiled C libraries into the interpreter. The advantage of this approach is that the performance critical functionality can be implemented in a systems programming language like C or C++, with Tcl providing a higher-level, lightweight scripting language layer that facilitates building extensible tools and graphical user interfaces.

Tcl with the Tk toolkit is similar in its goals to VisualBasic in the sense that both provide a scripting language that is used to build GUIs, and both call upon C or C++ code to do the real work of managing windows, widgets, etc. Although Tcl/Tk was originally developed for the X-Windows system on UNIX platforms, it has been ported to the Windows platform, which makes it an open, portable, and powerful competitor to VisualBasic. In addition, integration of Tcl with the new JavaT programming language for the World Wide Web and Tcl Plug-ins for web browsers will ensure its continued success as a key internet/intranet scripting technology.

The system programming language Java, is frequently discussed alongside Tcl. The power of Java is its integration with popular web browsers and the ability to transmit executable content on the Web. Tcl has the same capability, but in many cases, Java is a more acceptable language framework for distributing executable content over a network because of the browser integration and a machine independent representation of compiled Java. Java has the potential to become the de facto language for programming the presentation of information that flows across a network. Because Java has much broader goals, it is less suitable for building Isode tools for the following reasons:

  • Java is not targeted to support other embedded languages.
  • Strong typing, while useful for systems languages, is less desirable for GUI and scripting interfaces.
  • Development cycles would be longer.

A more detailed analysis of Java and other languages in relation to Tcl is given in the paper referred to earlier entitled 'Scripting: Higher Level Programming for the 21st Century' by John Ousterhout http://home.pacbell.net/ouster/scripting.html).

The Tcl language is a simple language to learn and start using. The only data types in Tcl are numbers, strings, lists and arrays. More powerful data structures can be implemented in C, C++, or Java, and made accessible to Tcl as objects, yielding a simple form of object-oriented programming in which data items have persistent state and well-defined procedural interfaces.

Tk models a window in an application's graphical user interface as containing a hierarchical organization of widgets. Each widget is an object, representing a graphical component. Tk includes support for frames, text entries, images, buttons, scrollbars and other widgets. From these components the application designer can assemble more complicated objects, such as menu bars and dialog boxes.

An important advantage of Tk is its dynamic geometry management. The application designer need only specify the elements to be shown on the screen and their relationships, and the Tk library will determine the position and size of these elements, as well as handle moving or resizing them when the screen layout is modified. This allows graphical proportions and alignments to be maintained while allowing the user to resize windows.

An example of Tcl/Tk code to draw a simple window is shown below:

label .l -text 'Title' 
pack .l -side top
listbox .lbpack .lb -side top -fill both -expand 1
button .q -text 'Quit' -command 'destroy .'pack .q -side top
.lb insert end 'Line 1'.lb insert end 'Line 2'

Most applications using Tcl have the application's functionality implemented in C or C++, and provide a set of commands to the Tcl interpreter for calling functions individually. The graphical layout of each window is described in a Tcl script associated with the application, which the Tcl interpreter uses when handling events, such as requests to redraw the screen or interpreting a mouse button click.

Tcl and Tk were primarily developed by John Ousterhout at the University of California, Berkeley. The most recent versions of Tcl/Tk are very well integrated with the Microsoft Windows environment and provide a look and feel that is indistinguishable from native Microsoft Windows applications.

Interest in Tcl and Tk has grown since first released to the Internet community several years ago. There are a number of books describing the packages, and freeware extensions add various new features such as networking support or prepackaged widgets. The TIX extensions in particular provide a useful set of graphical widgets for GUI development. Several companies use Tcl and Tk in their commercial products, as there are no license or royalty costs associated with the current openly available version from Scriptics Incorporated, which builds Tcl/Tk development products.

Tcl in the Isode Software Architecture

In the Isode product set several of the clients and management tools contain Tcl interpreters. This section describes how these applications are structured.

All Isode server and management applications link with the Isode run-time library, which contains X.509 security services, the upper layer protocol stack, and the Directory Access Protocol. Additional libraries implement cryptography, transport layer services and other functions. As there are several Tcl-based programs with common functionality, the common elements of directory access, certificate management and window layout are provided as separate libraries and special-purpose interpreters. A key advantage of this approach is that it enables Isode OEMs and Customers to develop their own scripts and graphical user interfaces which make use of the library functions.

The following picture illustrates the architecture of the Isode management and client software. For simplicity the Tcl and Tk libraries are not shown.

The directory access library is used by clients and management tools which connect with or configure the X.500 Directory services.

The library adds commands to a Tcl interpreter for connecting to a directory service, managing directory distinguished names and attributes and invoking operations. It provides string representations of the directory protocol elements, including names and attribute values, so that the applications are independent of the encodings used to transfer these elements. For example, a command to add an attribute to a directory entry would resemble:

directory modifyentry \
-name [dname '<CN=John Smith,O=MNN,C=WW>'] \
-addAttr title [list 'CEO' 'President']

 

Isode's Tcl-based Applications

The Isode products which make use of Tcl are:

  • EDM
  • WebXS
  • EMMA

These are briefly summarized in the following sections, with further information given in the respective product overviews.

Isode also provides underlying scripting interfaces and libraries, which are described below.

EDM

The Enterprise Directory Manager products allow client/server management of enterprise directories. The diagrams below show how the product is used to manage directory server configuration and access control.

DDM

The Directory Data Manager product enables flexible client/server management of data in a directory. It is essentially built as a tool which operates using the directory access libraries. It can operate over either X.500 DAP or LDAP. This multi-protocol behavior is enabled by common Tcl APIs.

WebXS

The Web-Directory Access Server allows a World Wide Web user to access an LDAP Directory or an X.500 Directory supporting LDAP, transparently, using the hypertext document model available with today's Web browsers. It is important to be able to customize the presentation and mapping of X.500 Directory information to the WWW HTML format, in order to tailor the service for particular clients.

Unlike other similar products, the conversion of information is performed by Tcl procedures that can be easily customized or completely redefined. For example, the administrator can control the selection of attributes, and can add text and hypertext links to automatically generated pages. The product is illustrated below.

EMMA

In a large organization there are often many thousands of mail users and tens or hundreds of messaging servers (message switches, POP3 servers, IMAP servers etc.). Keeping their configurations updated with the latest information about user location is a very difficult task. The Isode technology strategy addressing this synchronization problem is to enable all messaging server components to access the directory service. This is managed in a client/server manner by the Enterprise Messaging Manager and Administrator tool.

Scripting Interfaces

All of the GUIs illustrated above provide Tcl scripting APIs. An example of this for directory access is TclDish which is a command-line remote management client (DUA) for the X.500 directory. Its implements a programmable directory shell, based on a Tcl interpreter.

Designed for the expert directory user, it provides access to all supported X.500 operations. Scripts can be written for performing these operations automatically, and TclDish includes commands to perform bulk updates in the directory.

TclDish can also be used interactively for maintaining directory entries and managing access control, as shown in the following exchange.

TclDish% dlist
1 organizationName=MNN 
TclDish% dshow 1
objectClass           - top
objectClass           - organization
organizationName      - MNN
organizationName      - Multi-National Network
telephoneNumber       - +1 212 555 1212
TclDish% dlist 1
2 commonName=John Smith
TclDish% dlist 1 -subentries
3 commonName=access control subentry
TclDish% dmanager -grant -user 2 -subentry 3
TclDish%

Supporting Libraries

Many of the products shown above are based on configuration using the directory, and utilize common infrastructure and libraries to enable this functionality. Isode packages this code in source form, to enable similar directory based management products to be developed.

  • These include Tcl and the Tk Toolkit by John Ousterhout, Addison-Wesley, 1994, ISBN 0-201-63337-X, and Practical Programming in Tcl and Tk, by Brent Welch, Prentice-Hall, 1995, ISBN 0-13-182007-9, 2nd Edition 1997, ISBN 0-13-616830-2.
Copyright © 2010 Isode sitemap    privacy   feedback Subscribe to our rss newsfeed