# Adding and Administering Applications

Application Manager is the desktop container for applications available to the user.

SAG.CnfAM.mkr.2
SAG.CnfAM.mkr.6
SAG.CnfAM.mkr.10
SAG.CnfAM.mkr.11
SAG.CnfAM.mkr.13
SAG.CnfAM.mkr.14

## Structure of Application Manager

The top level of Application Manager generally contains directories. Each of these directories, and its contents, is called an
application group.

### Application groups in Application Manager

The application groups and their contents are gathered from multiple locations locally and throughout the network.

### Directory Location of Application Manager

In the file system, Application Manager is the directory `/var/dt/appconfig/appmanager/`login`-`hostname`-`display`.` The directory is created dynamically each time the user logs in.

For example, if user `ronv` logs in from display `wxyz:0`, the Application Manager directory `/var/dt/appconfig/appmanager/ronv-wxyz-0` is created.

### How Application Manager Finds and Gathers Applications

Application Manager is built by gathering local and remote application groups. The application groups are gathered from directories located along the
application search path.

The default application search path consists of these locations:

Scope | Location
Built-in | `/usr/dt/appconfig/appmanager/`language
System-wide | `/etc/dt/appconfig/appmanager/`language
Personal | HomeDirectory`/.dt/appmanager`

To create the top level of Application Manager, links are created at login time from the application groups (directories) located in directories on the application search path to the Application Manager directory `/var/dt/appconfig/appmanager/`login`-`hostname`-`display. The gathering operation is done by the desktop utility `dtappgather`, which is automatically run by Login Manager after the user has successfully logged in.

For example, the desktop provides the built-in application group:

    /usr/dt/appconfig/appmanager/language/Desktop_Tools

At login time, a
symbolic link is created to:

    /var/dt/appconfig/appmanager/login-hostname-display/Desktop_Tools

The application search path can include remote directories. This provides a way to gather application groups from systems located throughout the network. For more information, see SAG.CnfAM.mkr.12.

### Precedence Rules in Gathering Applications

Where duplicates exist along the search path, personal application groups have precedence over system-wide groups, and system-wide groups have precedence over built-in groups. For example, if both `/usr/dt/appconfig/appmanager/C/Desktop_Tools` and `/etc/dt/appconfig/appmanager/C/Desktop_Tools` exist, the application group under `/etc` will be the one used.

### Application Groups Provided with the Default Desktop

The uncustomized desktop provides four application groups.

- Desktop_Apps

- Desktop_Tools

- Information

- System_Admin

### Example of How Application Groups Are Gathered

SAG.CnfAM.mkr.4 shows an Application Manager window containing a variety of application groups. SAG.CnfAM.mkr.5 shows the directories from which the application groups were gathered.

#### A typical Application Manager window

### Source of Application Groups for SAG.CnfAM.mkr.4

`Name` | `Directory Gathered`
CAD_App | `/net/ApServA/etc/dt/appconfig/appmanager/C/CAD_App`
DrawingApp | `/etc/dt/appconfig/appmanager/C/DrawingApp`
Desktop_Apps | `/usr/dt/appconfig/appmanager/C/Desktop_Apps`
Desktop_Tools | /`usr/dt/appconfig/appmanager/C/Desktop_Tools`
Information | `/usr/dt/appconfig/appmanager/C/Information`
System_Admin | `/etc/dt/appconfig/appmanager/C/System_Admin`
MySpreadSheet | /`users/anna/.dt/appmanager/MySpreadSheet`
Media_Tools | `/etc/dt/appconfig/appmanager/C/`Media_Tools

If the Information or System_Admin application groups have been customized, they will be gathered from `/etc/dt/appconfig/appmanager/C` instead.

The CAD_App group is gathered because a system named `ApServA` has been added to the application search path (see SAG.CnfAM.mkr.12). MySpreadSheet is a personal application group, available only to user `anna`.

## Adding Applications to Application Manager

When an application has been added to Application Manager, there is an icon in an application group that starts that application.

Many applications provide an application group. The application group is a directory at the top level of Application Manager that contains the application icon and other files related to the application.

Some applications may not have their own application group. Instead, the icon to start the application is located in a general application group. For example, you could create an empty application group named “Games” that you use as a container for all the games you install on the system.

### Ways to Add Applications to Application Manager

There are two ways to add an application to Application Manager:

- Registering the application

- Adding an application icon without registering the application

#### Registering the Application

Application registration provides full application integration.

A registered application:

- Has its own application group.

- Has its desktop configuration files gathered under a single location. This group of desktop configuration files is called the
  registration package.

- May have a registered help volume.

There are two ways an application can become registered:

- When you install a desktop-smart application, registration occurs automatically. See SAG.CnfAM.mkr.7.

- An existing application can be registered by creating a registration package. See SAG.CnfAM.mkr.8.

The use of a registration package makes the application easier to administer on the desktop. The registration package is created somewhere in the file system other than the locations used for desktop configuration files.

#### Adding the Application without Using a Registration Package.

This is the preferred way to add application when you want Application Manager to contain only an icon to start the application.

An application added without using a registration package:

- May have its own application group, but usually has its icon placed in an existing application group

- Has its desktop configuration files placed directly in locations along the desktop's search paths.

See SAG.CnfAM.mkr.9.

### To Add a Desktop-Smart Application to Application Manager

A desktop-smart application is an application that is automatically registered into Application Manager when the application is installed. The application's filesets include the registration package required by the desktop.

1. Install the application using instructions provided with the application.

2. When installation is complete, double-click Reload Applications in the Desktop_Tools application group.

3. Verify that installation is complete:

   1. Open Application Manager and check for the presence of the new application group.

   2. To open the application, open the application group and double-click the application's icon.

### To Register an Existing or Non-Desktop Smart Application

This is the preferred way to fully integrate an application into the desktop.

The desktop provides a tool, `dtappintegrate`, that creates links between the registration package files and the directories on the desktop search path.

Desktop registration is explained in SAG.RegAp.div.1.

### To Add an Application Icon to an Existing Application Group

This procedure explains how to add an application icon to an existing application group.

For example, the desktop provides an application group named System_Admin that has been reserved for various applications and scripts related to administering systems. If you have a script that users frequently run, you might want users to be able to run the script by double-clicking an icon in the System_Admin application group.

1. Use Create Action to create an action definition for the application.

   For more information about Create Action, see SAG.dtCrA.div.1.

2. Create an executable file with the same name as the action name in the directory for the application group. The content of the file is irrelevant.

   For example, if you've created an action named “Cleanup” that runs a system administration tool, you would create the executable file:

       /etc/dt/appconfig/appmanager/language/System_Admin/Cleanup

## Creating and Administering General Application Groups

A general application is an application group (directory) that is not associated with one particular application product. For example, the built-in Desktop_Tools application group is a general group containing icons for a large number of applications that are related, but not part of a single product.

You can create additional general application groups. For example, you might want to create a group called Games to group together the various games available on the system.

A general application group can be system-wide or personal in scope.

### To Create a System-Wide General Application Group

1. Log in as root.

2. Create a directory in `/etc/dt/appconfig/appmanager/`language.

   The name of the directory becomes the name of the
   application group.

3. Double-click Reload Applications in the Desktop_Tools application group.

### To Create a Personal General Application Group

1. Create a directory in HomeDirectory`/.dt/appmanager`.

   The name of the directory becomes the name of the application group.

2. Double-click Reload Applications in the Desktop_Tools application group.

### To Customize a Built-In Application Group

1. Log in as root.

2. If the application group is located in `/usr/dt/appconfig/appmanager/`language, copy the application group to /`etc/dt/appconfig/appmanager/`language.

   For example, the following command copies the Desktop_Tools application group:

       cp -r /usr/dt/appconfig/appmanager/C/Desktop_Tools /etc/dt/appconfig/appmanager/C

   The new copy of the application group will have precedence over the built- in version.

3. Modify the copy of the application group. For example, you can add new action files (executable files with the same name as actions).

4. To see the changes, log out and back in.

## Modifying the Search Path Used To Locate Applications

The major reason for modifying the application search path is to add an
application server. When you add an application server to the search path, Application Manager gathers all the server's system-wide application groups.

For more information on the application search path, see SAG.Datab.div.7.

### The Default Search Path

The default application search path includes these directories:

Scope | Search Path Directory
Personal | HomeDirectory`/.dt/appmanager`
System-wide | `/etc/dt/appconfig/appmanager/`language
Built-in | `/usr/dt/appconfig/appmanager/`language

### Adding an Application Server to the Application Search Path

In addition to modifying the application search path, it may be necessary to perform additional configuration tasks to enable communication with the application server. See SAG.ClSrv.div.32.

#### To Set a System-Wide Application Search Path

1. Log in as root.

2. If the file /`etc/dt/config/Xsession.d/0010.dtpaths` doesn't exist, create it by copying `/usr/dt/config/Xsession.d/0010.dtpaths`.

3. Open /`etc/dt/Xsession.d/0010.paths` for editing. Add or edit a line setting the `
   DTSPSYSAPPHOSTS` variable:

       DTSPSYSAPPHOSTS=hostname:[,hostname]

   For example, the following line adds the system `ApServA` to the application search path:

       DTSPSYSAPPHOSTS=ApServA:

4. Inform all users on the system that they must log out and then log back in for the change to take effect.

#### To Set a Personal Application Search Path

1. Open HomeDirectory`/.dtprofile` for editing.

2. Add or edit a line setting the `
   DTSPUSERAPPHOSTS` variable:

       DTSPUSERAPPHOSTS=hostname:[,hostname]

   For example, the following line adds the systems `ApServB` and `ApServC` to the application search path:

       DTSPUSERAPPHOSTS=ApServB:,ApServC:

3. Log out and then log back in.

## General Application Manager Administration

General Application Manager administration tasks include:

- Removing an application

- Rereading the database of applications during a session

### To Remove an Application

If an application has been registered using the `dtappintegrate` tool, you can also use `dtappintegrate` to reverse the process. When an application is unregistered, its application group is removed from Application Manager, and its actions, data types, icons, and help are no longer available.

1. Log in as root.

2. Run the command:

       dtappintegrate -s app_root -u

### To Update Application Manager During a Session

You must rebuild Application Manager if you add applications and want those changes to take effect immediately.

1. Open the Desktop_Tools application group and double-click Reload Applications.

Reload Applications is useful for updating Application Manager when applications are added to an application server. However,
Reload Applications does not detect applications that have been removed from an application server, or applications that have been moved from one location to another. These changes take effect when the user logs out and back in.

## Changing the Text Editor and Terminal Emulator

Both the text editor and terminal emulator applications can be started by choosing a control in the Front Panel, or by double-clicking an icon in Application Manager.

These applications are also started by other desktop activities.

- The text editor application opens when the user selects a text file in File Manager and chooses Open from the Selected menu. The default text editor is `dtpad`.

- A terminal emulator runs when a user chooses Open Terminal from File Manager's File menu, or when an action opens a terminal emulator window. The default terminal emulator is `dtterm`.

You can configure the desktop to use a different text editor or terminal emulator application in these situations.

### To Change the Default Text Editor or Terminal Emulator

1. If the change is system-wide, log in as root.

2. Create an action for the new text editor or terminal emulator application.

   - You can use the Create Action application. SAG.CnfAM.mkr.15 shows a Create Action window filled in for an application named TextPad. For more information about Create Action, see SAG.dtCrA.div.1.

     #### Create Action window

   - Or, you can create the action definition manually; for example:.

         ACTION TextPad
         {
           LABEL        TextPad
           TYPE         COMMAND
           WINDOW_TYPE  NO_STDIO
           EXEC_STRING  /usr/TP/bin/TextPad %(File)Arg_1%
           DESCRIPTION  Double-click this icon to start the \
                        TextPad application.
         }

     For information on creating action definitions manually, see SAG.CrAct.div.1.

3. Place the configuration file containing the new action in the proper directory:

   - System-wide: `/etc/dt/appconfig/types/`language

   - Personal: HomeDirectory`/.dt/types`

4. If it doesn't already exist, create the appropriate `user-prefs.dt` file by copying `/usr/dt/appconfig/types/`language`/user-prefs.dt` to:

   - System-wide: the `/etc/dt/appconfig/types/`language directory

   - Personal: the HomeDirectory`/.dt/types` directory

5. Edit the TextEditor or Terminal action in the system-wide or personal `user-prefs.dt` file. Modify the `MAP_ACTION` line to map the action to the new action.

   For example, change the line:

       MAP_ACTION Dtpad

   to:

       MAP_ACTION TextPad

6. Save the `user-prefs.dt` file.

7. Double-click Reload Actions in the Desktop_Tools application group to reload the actions database.