|
|
SCOadmin applications and hierarchies must be configured and maintained using the scoadmin command line.
The SCOadmin management object hierarchy is located in:
/opt/K/sco/unixos/revision/var/etc/sysadm.d/desktop
where revision is substituted with the revision number of the operating system. At installation time of the SCOadmin desktop, this directory is exported to /etc/sysadm.d/SCOadmin.ts.
At installation, the SCOadmin object hierarchy is
preconfigured into an initial state. This preconfiguration
includes the following standard folders (application
categories):
Filesystems
Mail
Printers
Networks
Sysadmsh Legacy
System (including subdirectories for Logs and Security)
foo.obj
|
|
-----------------------------------
| | |
activate activate.scoadmin en_US
|
|
-------------------------------
| | | |
title text picture.px open.px
The activate script invokes the corresponding management application. There are no limitations placed on the implementation of this deskshell script. Developers should reference X.desktop documentation for help with deskshell. The activate.scoadmin file permits the object to be invoked from scoadmin. This file must be a valid executable type (such as a binary, shell or tcl script). scoadmin simply invokes the file assuming it is an executable. If activate.scoadmin is a script, then the #! mechanism must be used to invoke the appropriate interpreter. The suggested permissions are 0555.
If this file is not found when a user attempts to invoke the application from scoadmin, a message is displayed that the application cannot be invoked.
Two environment variables are set by scoadmin in the environment of activate.scoadmin:
The following subsections describe the data which may reside in the language directories.
If the desktop cannot find a language directory matching the current language setting or an en_US language directory, it uses the name of the management object directory as the title of the application. The same applies if the desktop finds the appropriate language directory, but does not find a title file in it. In either of those cases, if the management object directory was named Printer Manager.obj then it will use Printer Manager as the title. It is recommended that management object directories have meaningful names. In the example given here, a space character is used in the name of the directory such that the title appears more legible. Note that this default behavior by X.desktop can be avoided by including an en_US language directory in each object.
Note that the text file is used to internationalize an object only by X.desktop and not by scoadmin. If an object is expected to be internationalized when invoked from scoadmin, the internationalization must be built into the activate.scoadmin executable. The only internationalization of an object handled by scoadmin is the title of the object.
This activate file is very simple and merely executes the application:
begin /usr/bin/fooGUI finishNote the use of the begin and finish deskshell keywords. Although these keywords are optional in the most generic case, it is necessary if X.desktop is to use the open.px file to display a variant pixmap to indicate that the application is open. In other words, two things are needed in order for X.desktop to use a specific pixmap icon to indicate that the application is in use: an open.px file and the use of begin and finish in the activate file.
The following is a simple executable script:
#! /bin/shNote that the first line invokes the shell. This file could have also been a csh, ksh, or Tcl executable, including a binary executable./usr/bin/fooGUI
This very simple deskshell script puts up a scoterm, gives it a title, and runs the application in it:
begin shell -t ''$myTitle'' mkdev hd; xdtwait finishIt uses the command xdtwait to ensure that the scoterm stays up until the application exits. Note that the title of the scoterm window is internationalized. A variable, myTitle is used in place of the title. myTitle is a variable which must be defined in the text file in each of the language directories of this management object. For example, the en_US directory should have a file named text with the following assignment:
myTitle='Hard Disk Configuration'
#! /bin/shNote the use of the SCOADMIN_UIMODE environment variable. When scoadmin executes this script, it sets SCOADMIN_UIMODE to either MOTIF or CHARM according to the display environment. It is then up to the character-only management object to ensure that the management application is invoked correctly. In this example, if the MOTIF environment is detected, the application is run in a scoterm.if [ "$SCOADMIN_UIMODE" = CHARM ] then mkdev hd else scoterm -title "mkdev hd" -e sh -c "mkdev hd" fi
There are no tricks involved in the deskshell activate script of a MOTIF only application:
begin /usr/bin/X11/scomail finish
Here the SCOADMIN_UIMODE environment variable is used to identify the display environment. In a character environment, the application cannot be invoked and scoadmin is used to display a message to that effect:
#! /bin/shif [ "$SCOADMIN_UIMODE" = CHARM ] then scoadmin -m "This application must be run in a MOTIF environment." else /usr/bin/X11/scomail fi
SCO Visual Tcl Programmer's Guide and Reference .