Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
  Previous   Contents   Next 
   
 
Chapter 13

Creating Data Types Manually

There are two ways to create a data type definition:

  • By manually creating the data type definition.

Creating a data type manually requires you to edit a database file.

This chapter describes how to manually create data type definitions.

  • For reference information about data type definitions, see the dtddsfile(4) man page.

Reasons You Must Create a Data Type Manually

Manually creating a data type lets you use all the capabilities built into the syntax of data type definitions.

You must create an data type manually if you want to use these features of data types:

  • Location (path)-based data typing

  • The ability to specify actions associated with the data type other than Open and Print

  • Multiple name, pattern, or content criteria for the same data type--for example, a data type based on files named *.abc or *.def

  • Link-based data typing

Components of a Data Type Definition: Criteria and Attributes

A data type definition consists of two separate database definitions:

  • The DATA_ATTRIBUTES definition.

    The DATA_ATTRIBUTES definition describes the data type's name and the appearance and behavior of files of this type.

  • The DATA_CRITERIA definition.

    The DATA_CRITERIA definition describes the typing criteria. Each criteria definition specifies the DATA_ATTRIBUTES definition to which the criteria apply.

There must be at least one DATA_CRITERIA definition for each DATA_ATTRIBUTES definition; a DATA_ATTRIBUTES definition can have multiple DATA_CRITERIA associated with it.

For example, you could create an attributes definition for PostScript files that described how PostScript files look and behave in File Manager. Then, you could create two separate criteria for the PostScript data type-- one based on file name and the other based on file content.

For more information, see "Defining the Data Criteria for a Data Type".

Creating a Data Type Manually: General Steps

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".

 
 
 
  Previous   Contents   Next