A Common Desktop Environment type can be thought of as the class of a desktop object. Using this analogy, actions can be thought of as the methods available on instances of a class. Thus, the actions attribute in a type attribute list describes operations that are available for the type. A single action in the actions and data-types database has multiple parts, many of which are optional. These parts include:
A description of how to invoke the operation: for example, through ToolTalk, through an execution string passed to the SPC mechanism, from within a terminal emulator, and so on.
A description of the type of arguments associated with the action. The type of the desktop objects (files and buffers) that it accepts is defined by the actions and data-types database. Actions are polymorphic with respect to data types. For example, the Open action invokes a text editor for arguments that are text files and a graphics editor for arguments that are graphics files.
A description of the number of arguments, if any, associated with the action.
An optional indication as to where to carry out the operation: the local machine, a particular remote machine, the machine on which the executable resides, and so on. In addition, these execution locations can be included in a list so that if a host is not available then the next host on the list is tried. This provides a measure of redundancy that can be used to increase the likelihood of application launch, even in the face of remote host unavailability. Thus, actions provide network distribution guidance, implemented either through built-in ToolTalk facilities or through the SPC mechanism directly.
An optional label, help string, and icon that the user sees when interacting with the action's GUI. These are hints to an application about how to represent the action to the user. These hints may be ignored, as the Front Panel does by ignoring the icon if the Front Panel configuration file supplies an alternative icon.
The collection of actions available to the user is assembled at the same time as the system is collecting type database information. In fact, related action and type information usually reside together in the same file. Desktop-defined, system-administrator-defined (host-specific), and user-defined files are assembled in order into a single (actions and data-types) database, with later definitions taking precedence. This ordering of search path precedence and traversal is used elsewhere by the desktop for such things as help volume and icon file searches.
The actions and data-types database and the File Manager use action files to instantiate actions as file system objects that can be viewed, invoked, moved, copied, and so on. The database contains references to an action's implementation (for example "run /usr/bin/app on machine net_app_svr"). However, a representation is needed of an action as an object that the user can directly manipulate. This is achieved by using an object's name, which identifies it as an action to any object manager that is looking for actions. Thus, if there is an executable file named Dtstyle and an action named Dtstyle, the File Manager will interpret that file, regardless of its content, as the Dtstyle action reference. In addition, the File Manager uses the action's label as the name that the user sees for this file. Action labels are localizable, whereas action names are programmatic entities that should not be localized.
The good feature about using files simply as pointers into the actions and data-types database is that the underlying implementation can evolve without the user having to do anything. However, one user's actions and data-types database may not match another user's actions and data-types database. Thus, a user cannot exchange an action reference, for example as a mail message attachment, and expect another person to have a comparable definition for that action. Exchanging a Desktop Korn shell script is the best solution to this problem.
Actions are useful because they integrate both legacy command-line applications and ToolTalk applications into the desktop as polymorphic, distributed operations on desktop objects.