Sun Desktop Manager 1.0 Developer Guide

The Profile Package Format

Templates are embedded into a deployment container, which is similar to a "package" in the JavaTM programming language. A package can also contain optional files, such as resource files for GUI localization, HTML files for online help, and arbitrary support files.

The Desktop Manager uses a special directory and a file name format to access the templates and all necessary optional files. This directory and file name structure is called the profile package format.

All profile packages are located in a unique subdirectory below the /usr/share/webconsole/apoc/packages directory. For the "Hello, world!" example, HelloWorld was chosen, resulting in a /usr/share/webconsole/apoc/packages/HelloWorld directory.


Tip –

Use the product name and product version of the software for which you are installing the package. This ensures a unique package directory. For instance, HelloWorld3.1 is a better choice than HelloWorld.


Below the specific package directory, which should not be confused with the packages directory, the following subdirectories are allowed:

templates 

The templates subdirectory must contain all templates of the profile package. Files that have the postfix .xml are considered to be templates. The name of the file must correlate with the value of the apt:name attribute of the page element. Templates can be organized in any way, although they should be located in the same directory hierarchy, as specified by their category hierarchy.

classes 

The classes subdirectory must contain all class files of the profile package. Files that have the postfix .class are considered to be Java class files. The name of the file has to correlate with the name of the class defined in that file. The files have to be located in the same directory hierarchy as specified by their package hierarchy.

web 

The web subdirectory must contain all HTML help files of the profile package and must contain images referenced by the profile package. Files that have the postfix .html are considered to be HTML files. Correlate the name of the HTML file with the name of the template using the HTML file. Locate HTML files in the same directory hierarchy as the template using the HTML file.

res 

The res subdirectory must contain all resource files of the profile package. Files that have the postfix .properties are considered to be Java-compliant resource files. You can correlate the names and paths of the resource file with the names and paths of the template files that use them. You can also specify one directory hierarchy containing one resource file for all templates.

lib 

The lib subdirectory must contain all library files of the profile package. Files that have the postfix .jar are considered to be libraries. Libraries are automatically loaded by the Desktop Manager's class loader. Their content is accessed by using the root directory in the jar file as the root directory for absolute paths. The typical use for library files is to act as a container for class or resource files , and for directories that are normally located in the classes and res directories.

Other file types have no special meaning to the Desktop Manager. Nevertheless, the files types can be placed in the classes or web directories, if they are needed by class or HTML files.

To further illustrate the package format, Figure 2–1 shows a mature HelloWorld package:

Figure 2–1 HelloWorld Package

HelloWorld Package

The deployment of packages is completely up to the developer of the package, as long as you follow the rules defined previously in this chapter. You can provide a collection of files with instructions about how to copy the files to the correct locations, or you can provide a zip file, or you can use the deployment mechanisms provided by the operating systems, such as .pkg files for SolarisTM. The last method is recommended, as the enhanced means for maintaining and removing software offered by the corresponding operating system provide better support for the end user.