Solaris Common Desktop Environment: Advanced User's and System Administrator's Guide

To Create a Data Type with Several Independent Criteria

You can create a data type with several independent criteria—that is, the file is assigned to the data type if it meets either (or both) of the criteria.

  1. Create the DATA_ATTRIBUTES definition for the data type.

  2. Create a DATA_CRITERIA definition for each criteria.

    Use the DATA_ATTRIBUTES_NAME field to connect each criteria to the same DATA_ATTRIBUTES definition.

    For example, the following definitions create the Mif data type. Typing is based on name or content.

    DATA_ATTRIBUTES Mif
    {
     	ICON								Frame
     	ACTION_LIST						Open,Print
     }
    
     DATA_CRITERIA Mif_Name_Criteria
     {
     	DATA_ATTRIBUTES_NAME				Mif
     	NAME_PATTERN							*.mif
     }
    
     DATA_CRITERIA Mif_Content_Criteria
     {
     	DATA_ATTRIBUTES_NAME		Mif
     	CONTENT							1 string MIFFile
     }