254 IBM Workplace Forms: Guide to Building and Integrating a Sample Workplace Forms Application
We will add the Instance Data Model required and bind certain fields in the Form to this
Instance Data Model. The current servlet provided on the CM Demo Platform has some very
specific requirements for integration. Specifically, two entities must exist:
1. An invisible field is added to the form for the CM PID (generated when a Form is stored in
CM) and must be called “PID”.
2. Example 8-1 shows the syntax required by the servlet (shown here in the Form's XML
format with my comments added). This is an example of what must be defined in the Data
Instance Model.
Example 8-1 Data Instance Model required by the CMSubmission Servlet
<!-the ID MUST BE CMAttributes -->
<xforms:instance xmlns=http://www.PureEdge.com/XFDL/Custom id="CMAttributes">
< !-the ContenManagerMetaData tag is required -->
<ContentManagerMetaData>
<!-insert the name of the Item Type in CM -->
<ItemType>MyForm</ItemType>
<!-insert the number of Attributes that will be used -->
<NumberItemAttributes>4</NumberItemAttributes>
<! - repeating tags occur now as necessary for the number of Attributes -->
<!-insert the Attribute Name here -->
<ItemAttributeName0>MyFirstAttr</ItemAttributeName0>
<!-this will contain the Attribute Value when the form is completed -->
<ItemAttributeValue0></ItemAttributeValue0>
<ItemAttributeName1>MySecondAttr</ItemAttributeName1>
<ItemAttributeValue1>External Wire Transfer Request</ItemAttributeValue1>
<ItemAttributeName2>MyThirdAttr</ItemAttributeName2>
<ItemAttributeValue2></ItemAttributeValue2>
<ItemAttributeName3>MyFourthAttr</ItemAttributeName3>
<ItemAttributeValue3></ItemAttributeValue3>
<!- the tags above must follow the sequence up to the required number -->
<!-PID is a required entry and will be filled in when the form is completed -->
<PID></PID>
<!-CMUserName will default to icmadmin if not provided here -->
<CMUserName>icmadmin</CMUserName>
<!-CMUserPassword will default to password if not provided here -->
<CMPassword>password</CMPassword>
<!-CMLibServerName will default to icmnlsdb if not provided here -->
<CMLibServerName>icmnlsdb</CMLibServerName>
<!-CMSchemaName will default to SCHEMA=ICMADMIN if not provided here -->
<CMSchemaName>SCHEMA=ICMADMINicmadmin</CMSchemaName>
<!-ItemMimeType will default to application/vnd.xfdl if not provided here -->
<ItemMimeType>application/vnd.xfdl</ItemMimeType>
</ContentManagerMetaData>
</xforms:instance>
The preceding example shows the syntax required by the servlet. The tag values (that is, the
information between the tag pairs) are just examples in this case.
In the next sections we describe how to enhance our existing Sales Quote Application to store
the forms along with some metadata attributes in DB2 Content Manager.