I want to…
…deploy a few InfoPath forms based on content types. Some of the site columns are used across many content types. I need some level of control on the content type generation and deployment.
How…
The deployment of browser-enabled InfoPath forms using features is described in http://blah.winsmarts.com/2008-8-Deploying_InfoPath_2007_Forms_to_Forms_Server_-and-ndash_Properly.aspx post. However this post is not specific to content type based forms and it doesn’t describe how to deploy the associated content types.
Steps:
- Create site columns and content types. (You can create this in your Sharepoint site as a manual operation). You can reuse site columns across content types.
- Publish form with “Publishing Wizard”.
- Select “To a SharePoint server with or without InfoPath Forms Services” and click next.
- Select the Sharepoint site and click next.
- Select “Site Content Type (advanced)” and click next. Note: If this option is not available you have to remove the code behind during this process.
- Select “Update an existing site content type”, choose one of the content types created at step 1 and click next.
- Map form fields to content type site columns.
- Publish.
- Export the updated content types using the stsadm extension available here http://stsadm.blogspot.com/2008/02/export-content-types.html. The exported fields will look similar to:
. The Node property refers to the form field. - Create a feature that installs the exported content types. Note: Remove the unrecognized Field properties (a few of them are used behind the scene and are not validated by the schema).
Conclusion
The publishing process should be automatic and reproducible. Publishing relying on “Publishing Wizard” is an administration operation more than a deployment one. The described solution provides a mechanism for controlling the creation and deployment of InfoPath content types.


See my blog post where I take you step-by-step with relevant snapshots covering the following:
a. Converting InfoPath Data Connections to DCL library in SharePoint.
b. Publishing InfoPath form to a SharePoint List/Library
c. Creating a .wsp solution package for the InfoPath form and its code-behind
d. Creating a batch script that will deploy the InfoPath form on your Production site.
e. Ensuring the InfoPath form has been deployed as a feature
f. Modify the DCL’s in the production environment.
g. Associate the InfoPath Content Type with the Document/Forms Library
See the full blog post at: http://www.sharepointfix.com/2009/12/infopath-2007-form-and-nintex-workflows.html