The FixedWidth data handler is a data-conversion module whose primary role is to convert business objects to and from strings or streams that have a format of fixed-width fields. A fixed-width string or stream is serialized data with the text/fixedwidth MIME type. The data handler parses text data using fixed-width fields. The field lengths are specified by the MaxLength property of each business object attribute. The value of this property is stored in the business object definition.
The default top-level connector meta-object (MO_DataHandler_Default) supports the text/fixedwidth MIME type. Therefore, a connector that is configured to support the MO_DataHandler_Default data-handler meta-object can call the FixedWidth data handler. For an access client to be able to call this data handler when using the InterChange Server integration broker, you must modify the MO_Server_DataHandler meta-object to support the text/fixedwidth MIME type. For more information, see Modifying the top-level meta-object.
The FixedWidth data handler uses the value of the MaxLength property of attributes in a business object definition to determine how to read and write data. MaxLength is defines the maximum number of characters of the attribute value, including padding to allow for right-justified or left-justified text.
You can configure a pad character that represents spaces to add to or remove from the data for alignment. Pad characters are added when converting business objects to strings and removed when converting strings to business objects. You can also configure the alignment of a business object attribute value to be left- or right-justified. This makes it possible for the attribute value data to retain meaningful characters. Table 56 describes the values for the Alignment meta-object attribute.
Table 56. Values of the Alignment meta-object attribute
Value | Description |
---|---|
LEFT | Trims left side and pads right side. |
RIGHT | Trims right side and pads left side. |
BOTH | When converting strings to business objects, trims both right and left sides. When converting business objects to strings, pads right side with pad characters. |
In addition, with the Truncation meta-object attribute, you can configure the FixedWidth data handler to truncate business object values to their MaxLength, or generate an error if an attribute value is a string longer that MaxLength. You can also set the size of the length to be used for the business object name, verb, and business object count for cardinality 1 or n child objects.
Use Business Object Designer to set the value of the MaxLength property of String attributes. To change the value of the MaxLength property of other types (such as Integer, Double, and so forth), you must save the business object definition to a file, edit the file manually, and then import the modified definition into the business integration system.
The FixedWidth data handler performs the operations listed in Table 57.
Table 57. Data operations for the FixedWidth data handler
Data-handler operation | For more information |
---|---|
Receives a business object from the caller, converts the business object into a FixedWidth string or stream, and passes the FixedWidth data to the caller. | Converting business objects to FixedWidth documents |
Receives a string or stream from the caller, builds a business object, and returns the business object to the caller. | Converting FixedWidth documents to business objects |