Chapter 8. Integration with IBM DB2 Content Manager 253
The typical sequence of steps for the CM integration is as follows:
1. The user searches the CM repository for a specific blank form (template) using Web
Application JSP pages using content item attributes.
2. A list of all content items matching the search is generated and delivered to the HTML
eClient for display.
3. The user selects and “opens” a content item. The content item (blank form template) is
retrieved and opened within the IBM Workplace Forms Viewer, acting as a standard
plug-in to the client browser.
4. The user completes and submits the form.
5. IBM Workplace Forms CM Connector receives the form submission and stores in CM
repository. The form is stored and data from within the form is exposed as content item
attributes for comprehensive indexing and searching.
For the scenario we describe in this redbook, the Content Manager does not serve as a
repository for form templates. We extended our example described in the previous chapters
by both submitting completed forms to the Content Manager using a Submit button, and by
submitting only approved forms to the Content Manager using servlet to servlet
communication as described in 8.3.3, “Servlet to servlet communication” on page 266.
8.2 Basic design of Content Manager integration
A basic connector to the Content Manager as described here makes it simple for developers
to:
򐂰 Store forms as items in Content Manager (with attribute values set based on form data).
򐂰 Retrieve form items from Content Manager.
򐂰 Update existing form items within Content Manager.
Figure 8-3 illustrates the basic design of the Forms-CM integration.
Figure 8-3 Basic Design of Workplace Forms and CM Integration
On the left is the Workplace Forms Viewer invoked either standalone or from within a Web
browser. The form is filled in as needed and then submitted via a Submit button. This causes
the servlet (middle section) to be executed, which will process the form, extracting the Item
Type, Attributes, and other form data, and will store the entire, filled-in form into CM. If the
Form Viewer was invoked to display an existing Form saved to CM using this servlet, then the
stored form will be updated.
The ContentManagerMetaData instance contains all of the information needed to describe
this form’s integration to Content Manager – thus making the form document completely
self-describing with regards to how it is stored or represented in Content Manager.
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.

Get IBM Workplace Forms: Guide to Building and Integrating a Sample Workplace Forms Application now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.