Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Common Desktop Environment: Advanced User's and System Administrator's Guide > Chapter 11 Creating Data Types Manually

Creating a Data Type Manually: General Steps

» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

This section describes how to create a data type configuration file.

Configuration Files for Data Types

The requirements for configuration files containing data type definitions are:

  • The files must use the naming convention name.dt

  • The files must be located on the database search path. The default search path is:

    Personal data types

    HomeDirectory/.dt/types

    System-wide data types

    /etc/dt/appconfig/types/language

    Built-in data types

    /usr/dt/appconfig/types/language. You should not use this directory.

For information on modifying the database search path, see “Setting the Value of a Search Path”.

To Create a Data Type Definition

  1. Open an existing database file or create a new one.

    For more information, see the previous section, “Configuration Files for Data Types”.

  2. Define the data attributes for the data type using the syntax:

    DATA_ATTRIBUTES data_type_name
    {
    ICON image_name
    DESCRIPTION string
    attribute_field
    attribute_field
    ...
    }

    where:

    data_type_name

    A unique name given to this data type.

    image_name

    File name or path of an icon file. Use the base name for the file. For example, for icon files myimage.m.pm and myimage.t.pm, use myimage.

    attribute_field

    Field that defines the appearance or behavior of the data type.

    string

    Character string. The contents will be the on-item help for the data type.

    See “Example of Creating a Personal Action and Data Type”.

  3. Define the data criteria for the data type using the syntax:

    DATA_CRITERIA criteria_name
    {
    DATA_ATTRIBUTES_NAME data_type_name
    criteria_field
    criteria_field
    ...
    }

    where:

    criteria_name

    Unique name for this criteria definition

    data_type_name

    Name used in the DATA_ATTRIBUTES definition

    criteria_field

    Field used to define the criteria for assigning a file to this data type

    See “Defining the Data Criteria for a Data Type”.

  4. Save the database file.

  5. Create the icons for the data type.

    For more information, see “Specifying the Icon Image Used for a Data Type”.

  6. If necessary, create the actions listed in the ACTIONS field of the attributes definition.

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

Example of Creating a Personal Action and Data Type

Suppose your system contains an application named xgif, which displays GIF pictures. Ordinarily, you run the program by executing:

xgif filename

You want to be able to display GIF pictures several ways:

  • By double-clicking a GIF data file

  • By selecting the data file and choosing the application from the Selected menu

    1. Open a new file HomeDirectory/.dt/types/GifViewer.dt for editing.

    2. Type the data type definitions:

      DATA_ATTRIBUTES Gif
      {
      DESCRIPTION Gif image file.
      ICON GifIcon
      ACTIONS View
      }
      DATA_CRITERIA Gif_Criteria
      {
      DATA_ATTRIBUTES_NAME Gif
      NAME_PATTERN *.gif
      }
    3. Type the action definition for the GifViewer action:

      ACTION GifViewer
      {
      EXEC_STRING xgif %(File)Arg_1"Gif file to view:"
      WINDOW_TYPE NO_STDIO
      DESCRIPTION Double-click or drop a file to \
      start the Gif viewer.
      }

      Since the definition does not include an ICON field, the action will use the system's default icon.

    4. Type the following map action to connect the GifViewer action to the View action listed in the data type definition. Use the ARG_TYPE field to restrict this view action to Gif-type files.

      ACTION View
      {
      ARG_TYPE Gif
      TYPE MAP
      MAP_ACTION GifViewer
      }
    5. Save the file.

    6. Double-click Reload Actions in the Desktop_Tools application group to reread the database.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.