Using the type tree example
To access the adapter example files, navigate to install_dir/examples/adapters.
The data stream presented to the MIME Adapter to be encoded, or returned from the adapter when decoding MIME data, must comply to the type tree mime.mtt provided in the examples directory. The document element in this tree is the group Message which has the following components:
The MessageHeader group is an unordered collection of MIME header items. If the MIME message is a multi-part message then there will be one or more MessagePart groups. If the message is not multi-part then there will be no MessagePart groups, and the message data will be contained within the MessageData Content choice group.
A MessagePart consists of the following components:
The Header group is similar to the MessageHeader group but contains less components, since there are fewer relevant MIME header fields in an individual message part.
The MessageData Content is a choice group: the data contained within is either binary or text. If binary, the data is sized and the item Sizeof contains the size of the following binary item.
When the MIME Adapter decodes MIME data and returns it, the adapter fills in the Sizeof item with the correct size so that subsequent validation can determine the limits of the binary data. When using the mime.mtt type tree to build XML formatted input for the MIME Adapter, it is not necessary to map a value for the size, since the adapter will look for the </Message-Part-Data> delimiter to determine the end of the binary data.
The NestedPart group is used to build nested MIME data (such as is constructed by e-mail clients when messages are forwarded and the prior e-mail is attached).
The example maps in the examples directory show how this type tree can be used to build data to be encoded by the MIME Adapter and to decode MIME data.