PMDF System Manager's Guide


Previous Contents Index

6.4 Service Conversions

PMDF's conversion service facility may be used to process with site-supplied procedures a message so as to produce a new form of the message. Unlike either the sorts of CHARSET-CONVERSION operations discussed above or the conversion channel, which operate on the content of individual MIME message parts, conversion services operate on entire MIME message parts (MIME headers and content) as well as entire MIME messages. Also, unlike other CHARSET-CONVERSION operations or conversion channel operations, conversion services are expected to do their own MIME disassembly, decoding, re-encoding, and reassembly.

Like other CHARSET-CONVERSION operations, conversion services are enabled through the CHARSET-CONVERSION mapping table. If the first probe of the CHARSET-CONVERSION mapping table yields a "Yes" or "Always" keyword, then PMDF will check for the presence of a PMDF conversions file. 6 If a conversions file exists, then PMDF will look in it for an entry specifying a SERVICE-COMMAND, and if it finds such an entry, execute it. The conversions file entries should have the form


in-chan=channel-pattern; 
  in-type=type-pattern; in-subtype=subtype-pattern; 
  service-command=command
Of key interest is the command string. This is the command which should be executed to perform a service conversion (e.g., invoke a document converter). The command must process an input file containing the message text to be serviced and produce as output a file containing the new message text. On OpenVMS, the command must exit with an odd-valued status code if successful and an even-valued status code if unsuccessful. On UNIX, the command must exit with a 0 if successful and a non-zero value otherwise.

For instance, the combination of a CHARSET-CONVERSION table such as


CHARSET-CONVERSION 
 
  IN-CHAN=bsout_*;OUT-CHAN=*;CONVERT     Yes 
 
and a PMDF conversions file entry on OpenVMS of


in-chan=bsout_*; in-type=*; in-subtype=*; 
  service-command="@PMDF_COM:COMPRESS.COM COMPRESS 'INPUT_FILE' 'OUTPUT_FILE'" 
or on UNIX of


in-chan=bsout_*; in-type=*; in-subtype=*; 
  service-command="/pmdf/bin/compress.sh compress $INPUT_FILE $OUTPUT_FILE" 
or on NT of


in-chan=bsout_*; in-type=*; in-subtype=*; 
  service-command="c:\pmdf\bin\compress.exe %INPUT_FILE% %OUTPUT_FILE%" 

will result in all messages coming from a bsout_* channel being compressed.

DCL symbols (OpenVMS) or environment variables (UNIX and NT) are used to pass the names of the input and output files as well as the name of a file containing the list of the message's envelope recipient addresses. The names of these environment variables are:
Variable Usage
INPUT_FILE Name of the input file to process
OUTPUT_FILE Name of the output file to produce
INFO_FILE Name of the file containing envelope recipient addresses
The values of these three environment variables may be substituted into the command line by using standard command line substitution: i.e., preceding and following the variable's name with an apostrophe on OpenVMS, preceding the variable's name with a dollar character on UNIX, or preceding and following the variable's name with a percent sign on NT. For example, when INPUT_FILE and OUTPUT_FILE have the values a.in and a.out, then the following declaration on OpenVMS,


in-chan=bsout_*; in-type=*; in-subtype=*; 
  service-command="@PMDF_COM:CONVERT.COM 'INPUT_FILE' 'OUTPUT_FILE'" 
executes the command


@PMDF_COM:CONVERT.COM A.IN A.OUT 
On UNIX, the declaration


in-chan=bsout_*; in-type=*; in-subtype=*; 
  service-command="/pmdf/bin/convert.sh $INPUT_FILE $OUTPUT_FILE" 
executes the command


/pmdf/bin/convert.sh a.in a.out 
On NT, the declaration


in-chan-bsout_*; in-type=*; in-subtype=*; 
  service-command="c:\pmdf\bin\convert.exe %INPUT_FILE% %OUTPUT_FILE%" 
executes the command


c:\pmdf\bin\convert.exe a.in a.out 

Note

6 The conversions file is located via the PMDF_CONVERSION_FILE logical (OpenVMS) or PMDF tailor file option (UNIX), or Registry entry (NT), and is usually PMDF_TABLE:conversions. (OpenVMS) or /pmdf/table/conversions (UNIX) or C:\pmdf\table\conversions (NT).


Previous Next Contents Index