Object Manager

Quick contents

Object manager is a tool used to manipulate the internals of a specific object. When object manager is invoked on a VLAB object, all files constituting this object are copied to a temporary space, called the "lab table", where the user can safely modify them without worrying about destroying the original. The set of possible actions on an object is read from its specifications file, displayed on the screen as a pull-down menu. The user can then perform actions on an object by choosing items from this menu, without any detailed knowledge of the programs and data files involved in these actions. The changes made to an object while it is on the lab table can be saved back to the database, added to the database as a new extension, or ignored altogether. The menus are available by pressing the third button anywhere on the object's icon in the object manager's window (see the figure).

The object manager performs the following tasks:

The tools associated with the object are defined in two files: the object's specifications file, and the generic object file residing in the vlab config directory.

Specifications File

The specifications file serves three purposes:

Selecting a menu item allows the user to apply a tool to the object as a whole, without detailed knowledge of the program or the component files involved. An example specifications file is given here:
 

example specifications file:

tree.l
tree.v
panel.v
tree.ras
text
*
image:
        generate:
                cpfg  tree.l tree.v 
        snap:
                snap tree.ras
        ipaste:
                ipaste tree.ras

text:
        TEXT text

; this is a comment

The object Configuration File

The object file is a configuration file for the object manager, and is located in the VLAB config directory. It describes generic tools that may be used within an object's specifications file. Entries in the object file may be accessed by all objects in the virtual laboratory, thus eliminating the need for providing details of commonly used tools in each object. The object file resides in the vlab config directory. Entries in this file consist of a generic name, plus a list of tools. The list resembles the tool descriptions in the specifications file. Each entry in the object configuration file has the following format:

Several tools may be associated with a single generic name. Entries must be separated by a blank line. The parameters to be used with the tool are not specified on the command line in the object file. They will be appended to the command using arguments in the specifications file.

For example, TEXT may be defined as follows:

TEXT
display:
        xless
edit:
        EDITOR
print:
        enscript -Palw3

The above global definition will be substituted for each occurrence of the word TEXT in the specifications file. Such global definitions facilitate customization of the lab for each system configuration.

The object file may also include comment lines and global definitions. Comments start with a semicolon followed by any text on the same line. Comment lines may be inserted anywhere in the file.

Global names may be defined using the syntax:

#define SYMBOLNAME definition_string

where definition_string is a UNIX command to execute.

For example:

#define EDITOR emacs -font "-*-courier-medium-r-*-*-14-*-*"

These definitions must occur at the beginning of the file.

Customization

The following procedure can be used to customize the editors used by the object manager.

The first two lines of the object file define what editors are to be used by default. The names OBJED and OBJDEMOED are reserved and interpreted by the object manager when invoking shells for editing. By default, they are set to the vi editor. OBJED is for regular editing and OBJDEMOED is for editing while performing demos (the font size is bigger). If you wish to use a different editor (such as emacs), change the two lines;

#define OBJED     xwsh -s 80,24 -f Courier-Bold18 -c vi -w24
#define OBJDEMOED xwsh -s 60,12 -f Courier-Bold24 -c vi -w12

for example, like this

#define OBJED     emacs -font
"-*-courier-medium-r-*-*-14-*-*" #define OBJDEMOED emacs -font
"-*-courier-medium-r-*-*-18-*-*"

Note that the program you specify must open its own window. Since emacs does, it can be listed as above. Since vi doesn't, the lines must open a shell which then runs the editor.

Note that the names OBJED and OBJDEMOED can be used in the remainder of the object file like any other names (in particular, they could have been used instead of EDITOR in the previous example).

The Utilities Submenu

In addition to the items defined in the specifications file, the menu displayed by the object manager always includes a Utilities submenu and a Quit item.

The Utilities submenu includes the following menu items:

The Lab Table

The lab table is a temporary directory normally created in /tmp. All files listed in the specifications file are copied to this directory and as tools are selected from the object menu they are applied to these temporary files, leaving the original files untouched. Users may modify parameters and change the object's definition by manipulating the data files in the object on the lab table. New tools, with accompanying data files, may also be added to the object by editing the specifications file.

Before removing the object from the lab table (by selecting Quit from the menu), the user must decide whether the modified object should be permanently stored. It may be stored as a replacement of the original object, or as an extension of that object. If an extension is requested, the user is prompted for its name and a new directory is created in the ext directory of the original object. In both cases, the files on the lab table are compared with the files in the object's prototype. Files that differ from the prototype are copied to the object's directory; the remaining files are created by establishing UNIX symbolic links to the corresponding files in the prototype.

References

L. Mercer. The Virtual laboratory. Master's thesis, University of Regina, Regina, Canada, 1991.

L. Mercer, P. Prusinkiewicz, J. Hanan. The Concept and Design of a Virtual Laboratory. In Graphics Interface '90 Conference proceedings, pages 149-155. Canadian Information Processing Society, 1990.

Credits

L. Mercer, P. Federl - object manager implementation

Selected routines for image manipulation copyright 1994 by John Bradley. Used with permission.

M. James - implementation of the makeicon utility

D. Ratcliffe, P. Haeberli - authors of the snap and ipaste program, parts of their code was incorporated in the makeicon utility. Used with permission.

I. Hernadi, L. Mercer, P. Prusinkiewicz - object manager documentation

Bugs

1. The Copy and Paste commands are not implemented (but the Directory items provide similar functionality).

2. Manipulating the object's files "by hand" is possible, but the user must remember to update the specifications file accordingly, otherwise the new files will not be saved with the object.

3. The specifications and object files must have tabs placed correctly, spaces won't do. The menus will not be created properly if these files contain spaces instead of tabs, and no warning messages are generated. This problem is particularly annoying while using the SGI system-wide "cut and paste" facility, because it replaces tabs with spaces.

4. When the user quits the object and there are too many files on the lab table to report to the user, the window gets so big that buttons on the dialog cannot be seen. This prevents the user from quitting the object.

5. The Help facility is not yet implemented.
 


Last updated July 12th, 1999 by Pavol Federl