The article follows a Q&A [question and answer] approach for understanding InfoPath forms in SharePoint.
What, where, when, and how in InfoPath!
What is an InfoPath?
InfoPath is an XML based electronic forms development product.
What are the benefits of InfoPath 2007?
Prior to the introduction of Office 2007, the InfoPath client application, like other Office products, had to be installed on every user's computer.
In order to develop and use a form:
- The form had to be designed using InfoPath.
- The resulting form template should be hosted in a network file share, or installed in individual user machines, or uploaded into a form library in SharePoint, from where users could fill the forms.
- Filling up forms required InfoPath to be installed on the client machine.
- Developing a connected InfoPath was complicated for end users.
- Developers didn't have an integrated development platform.
- The product didn't integrate with other Office products such as Word and Excel.
Benefits of Office 2007
This introduced a new server-side runtime to host InfoPath forms known as InfoPath Form Services. The new capabilities include:
- Ability to convert Word and Excel documents into InfoPath form templates.
- With the help of InfoPath form services, a InfoPath form can be browser enabled.
- The new InfoPath forms can be embedded in Outlook.
- The form can be built once and rendered in different modes and devices, .i.e., Design Once.
- Introduction of the document information panel. I.e., an InfoPath form that is hosted inside Word 2007 or PowerPoint 2007 can be used to edit document properties.
- Introduction of logic inspector. The components which provide visual view of all the rules embedded in the form.
- The new InfoPath forms can be published to content types.
- Introduction of template parts, i.e., reusable code sections.
- Introduction of an integrated development environment inside Visual Studio 2005 using Visual Studio Tools for Office.
- The information right management can be used to protect sensitive data in the form.
What is the structure of an InfoPath form template?
The InfoPath form template (.xsn file) is actually a CAB file [can also be considered a zip file] containing the different component files of which InfoPath is built. Following are some of the important files contained inside that CAB file:
- .htm and other resource files.
What is a .xsf file? Or what is the Form Definition file [XSF file]? Or what is a manifest.xsf file?
It's a manifest file that provides the basic definition of other form files. This file contains XML code that describes all aspects of a form. The .xsf file is automatically created by InfoPath when a new form template is created and saved in Design mode. As form designers and developers change the form template or add new features to it, InfoPath updates the .xsf file to reflect those changes.
Note: The .xsf file can also be modified directly by using any text or XML editor, such as Microsoft Notepad. However, care should be taken when making modifications to the .xsf file: if an invalid entry is made, the form that the file is associated with may be left in an unusable state. However, some customizations can be made to the .xsf file that cannot be generated in Design mode.
The .xsf file is the core file of an InfoPath form because it contains information about the form as a whole. Some of the data it contains includes processing metadata, user interface customizations, schema definitions, views, business logic declarations, event handlers, and deployment information.
The following are some of the items that the .xsf file contains:
- A unique identifier for the form
- Global metadata information about the form, including deployment and publishing information
- The XML schema definitions for the XML document that the form produces
- Definition of views and their associated user interface components (menus, toolbars, and buttons)
- Definition of editing actions that are made available using user interface components, and how their availability will be determined contextually
- Workflow and routing information
- Event handlers, data validation, and business logic that is associated with individual XML nodes of the form's underlying XML document, or with the XML document itself
- Event handlers associated with the form as a whole
- Packaging information about all of the files contained within the form template
The .xsf file is based on the
xsf namespace. Its root element is the
<xsf:xDocumentClass trustSetting="automatic" solutionFormatVersion="184.108.40.206"
dataFormSolution="yes" solutionVersion="220.127.116.11" productVersion="12.0.0"
<xsf:property name="namespace" type="string"
<xsf:property name="rootElement" type="string"
<xsf:property name="namespace" type="string"
<xsf:property name="editability" type="string"
<xsf:property name="namespace" type="string"
<xsf:property name="editability" type="string"
<xsf:property name="fileType" type="string"
<xsf:property name="lang" type="string" value="1033"></xsf:property>
<xsf:property name="queryView" type="string" value="yes"></xsf:property>
<xsf:property name="componentId" type="string" value="12"></xsf:property>
<xsf:property name="xmlToEditName" type="string" value="12"></xsf:property>
<xsf:property name="mode" type="string" value="1"></xsf:property>
<xsf2:solutionDefinition runtimeCompatibility="client server"
<xsf2:offline openIfQueryFails="yes" cacheQueries="yes"></xsf2:offline>
<xsf2:server isPreSubmitPostBackEnabled="no" isMobileEnabled="no"
<xsf:views default="View 1">
<xsf:view name="View 1" caption="View 1">
<xsf:chooseFragment parent="dfs:dataFields" innerFragment="d:DimCustomer">
<d:DimCustomer CustomerKey="" Title=""
FirstName="" MiddleName="" LastName=""
Suffix="" Gender="" EmailAddress=""
<xsf:button action="xCollection::insertBefore" xmlToEdit="DimCustomer_7"
caption="Insert DimCustomer before" showIf="immediate"></xsf:button>
<xsf:button action="xCollection::insertAfter" xmlToEdit="DimCustomer_7"
caption="Insert DimCustomer after" showIf="immediate"></xsf:button>
<xsf:button action="xCollection::remove" xmlToEdit="DimCustomer_7"
caption="Remove DimCustomer" showIf="immediate"></xsf:button>
<xsf:button action="xCollection::insert" xmlToEdit="DimCustomer_7"
caption="Insert DimCustomer" showIf="immediate"></xsf:button>
<xsf:applicationParameters application="InfoPath Design Mode">
<xsf:adoAdapter connectionString="Provider=SQLOLEDB.1;Integrated Security=SSPI;
Persist Security Info=True;Initial Catalog=AdventureWorksDW;
Data Source=[Source];Use Procedure for Prepare=1;
Auto Translate=True;Packet Size=4096;Workstation ID=[ID];
Use Encryption for Data=False;
Tag with column collation when possible=False"
queryAllowed="yes" name="Main connection"
xsf:extensions element is used to bind the form to other platforms, like SharePoint.
What are the Form View files in InfoPath? Or XSL files?
The .xsl file is the form view file that provide a way to represent different information, depending upon the runtime environment and other factors, including the security profile of end users. They are based on XML stylesheets that can be formatted depending upon the condition. [Conditional formatting is itself an inbuilt property of XSL.]
What is an .XSD file in InfoPath?
It is the form schema file of InfoPath. It determines the format of data that InfoPath recognizes.
Where does data get stored in an InfoPath form?
Data is stored in XML files.
Explain in brief the architecture of InfoPath forms
An InfoPath form template is actually a CAB File containing different component files.
Below is a list of files which forms part of an InfoPath template.
- .xsf file: A manifest file that describes the basic definition of other form files.
- .xsl file: Defines the transformation for data into different views.
- .xsd file: Defines the data source schema.
- .dll file: Carries the custom logic built into .NET or COM.
- .htm and other resource files: Custom HTML resource files and other resources for the form.
When a form template is uploaded using Administrative deployment, the template is stored in the content database of the site. Office Forms Services provide a server-runtime environment for InfoPath Forms Services. While running on the browser, all rules, validations, and calculations are executed in the browser using client-side script.
All business logic is executed on the server. So when a browser requests business logic execution, a postback is executed using low cost XMLHTTP. FormsServer.aspx is an Infopath Forms Services page that accesses the form's data from the content database and renders it to the client.
What are the main components of InfoPath Form Services that are responsible for rendering the .xsn file on browsers?
The InfoPath Form Services consists of four components that are responsible for rendering the .xsn file on browsers:
- ASP.NET modules: Return HTML to the browser.
- Infopath Form Services HTTPHandlers: Forward requests from IIS to the page generator.
- Converter: Responsible for converting the .xsn file into .aspx pages.
- Page generator: Communicates with internal data sources, and is responsible for processing postback data from the browser and maintaining session states.
What is Logic Inspector?
Logic Inspector is a tool in InfoPath 2007 that shows all of the code dependencies for the form in a single dialog. Depending on how you access the Logic Inspector, you initially see either the overview pane or both the overview pane and the details pane.
What are Template Parts?
It's a kind of reusable section in InfoPath forms. A template part is a portion of a form template that can be saved for reuse in multiple form templates. A typical template part consists of controls and a data source (data source: the collection of fields and groups that define and store the data for an InfoPath form). Controls in the form are bound to the fields and groups in the data source and may also include features such as data connections (data connection: the connection between an InfoPath form and an external data source, such as a database, Web Service, SharePoint library, or XML file). Data connections are used to query and submit data. Data validation is the process of testing the accuracy of data; a set of rules you can apply to a control to specify the type and range of data that users can enter. A rule is a condition or action, or a set of conditions or actions, that automatically performs tasks based on events and values in the form.
By creating and using template parts, you can help ensure that the form templates in your organization are consistent in tone, structure, and behavior. For example, a human resources department might use a single "Contact Information" template part in all of its form templates.
The file extension for a template part is .xtp. To design a template part, you must select the Template Part option instead of the Form Template option in the Design a Form Template task pane. When you open a template part, a (Template Part Design) prefix appears in the InfoPath title bar, indicating that you are in the correct mode for designing a template part.
Unlike a form template, you don't publish a template part when you finish designing it. Instead, you save it as a template part (.xtp) file. Then you can make your .xtp file available to other form designers who will need to use it. For example, you can copy the .xtp file to a file server on your organization's network and then send an e-mail message to form designers that describes the purpose of the template part, where it is located, and how they can add it to the Controls task pane in InfoPath.
When a form designer inserts a template part on a form template, it becomes part of the form template, and a form designer can customize it, if necessary. Note: There is no way to prevent form designers from changing a template part after they insert it on a form template. If you don't want others to customize the template part, you should make that clear when you distribute it.
To insert your template part on an InfoPath form template, form designers must first add the template part to the Controls task pane by using the Add Custom Control Wizard. After they complete the wizard, the template part appears in the Controls task pane, under the Custom heading.
To modify a template part, you open it in InfoPath Design mode, make the changes that you need, and then resave the template part. You must then send the updated template part to any form designer who uses the original version of the template part. Form designers can use the Add Custom Control Wizard to add the updated version of the template part to the Controls task pane. After they do this, they can open each affected form template and have InfoPath replace the original template part with the newer version.
Note: If your organization creates a large number of template parts, you can build a repository of template parts that can be accessed from a common location on a company network, such as a shared folder, a web server, or a form library located on a Microsoft Windows SharePoint Services site. It is possible to configure the InfoPath settings in the Registry so that template parts appear automatically in the Controls task pane for users who have InfoPath installed. To make this happen, you may need to work with your information technology (IT) department, or with someone who is responsible for administering InfoPath in your organization. For more information about this topic, see the InfoPath documentation on Microsoft TechNet. TechNet is the resource that IT professionals use to successfully plan, deploy, manage, and support Microsoft products.
What are the steps to create a Template Part?
In the Design a Form dialog box, you can choose to design a template part instead of a form template. If you do this, InfoPath features that aren't supported in template parts are either hidden or disabled so that you aren't tempted to use them in your template part.
- On the File menu, click Design a Form Template.
- In the Design a Form Template dialog box, click Template Part.
- In the Based on gallery, do one of the following:
- To define the data source (Data source: the collection of fields and groups that define and store the data for an InfoPath form. Controls in the form are bound to the fields and groups in the data source.), as you design the template part, click Blank.
- To use an XML document (.xml) file or an XML schema (XML schema: A formal specification, written in XML, that defines the structure of an XML document, including element names and rich data types, which elements can appear in combination, and which attributes are available for each element.) (.xsd) file as the data source for the template part, click XML or Schema.
Note: If you base your template part on an XML document or XML schema, InfoPath populates the Data Source task pane with fields (field: an element or attribute in the data source that can contain data; if the field is an element, it can contain attribute fields; fields store data that is entered into controls) and groups (group: an element in the data source that can contain fields and other groups; controls that contain other controls, such as repeating tables and sections, are bound to groups) that map to XML elements (XML element: an XML structure that consists of a start tag, an end tag, and the information between the tags; elements can have attributes and can contain other elements) in the document or schema. The data source is locked. Depending on the document or schema, you might not be able to add new fields or groups to part or all of the data source, or to change certain aspects of existing fields and groups.
- To make your template part compatible with InfoPath Forms Services, select the Enable browser-compatible features only check box.
- Click OK.
A new template part opens in InfoPath.
- Design your template part.
- When you finish designing the template part, on the File menu, click Save.
How to reuse Template Parts
If you want to base the design of a new template part on an existing template part, you must open the existing template part, change its name in the Template Part Properties dialog box, and then save the new template part with another, distinguishing file name. When you change the template part name in the Template Part Properties dialog box, the template part ID is updated automatically. This ID further distinguishes one template part from another.
- On the File menu, click Design a Form Template.
- Under Open a form template in the Design a Form Template dialog box, click On My Computer.
- In the Files of type list, click InfoPath Template Parts.
- Browse to and click the template part that you want to open, and then click Open.
- On the File menu, click Properties.
- In the Template Part Properties dialog box, enter a new name in the Template part name box.
When you do this, the identifying text in the Template part ID box reflects the new name. The template part ID is generated automatically by InfoPath. It must be unique for each new template part that you create.
- On the File menu, click Save As, and enter a new file name for the template part.
What is Document Information Panel?
When you create a document with Office Word 2007, Office Excel 2007, or Office PowerPoint 2007, a Document Information Panel is created for you automatically. This default Document Information Panel includes standard properties, such as Author, Title, and Subject. Alternatively, you can add custom properties by designing a Document Information Panel from scratch and then associating it with a document, or by customizing an existing Document Information Panel.
A document information panel is a form that is displayed within the client application, and which contains fields for the document metadata. Document information panels enable users to enter important metadata about a file anytime they want, without having to leave the Microsoft Office system client application.
How to create a custom Document Information Panel from InfoPath?
Starting from the Microsoft Office InfoPath 2007 application, you can browse to the desired site or list and select the content type for which you want to create a custom document information panel. Microsoft Office InfoPath 2007 sets the selected content type as your primary data source, as well as the auto-generated form as a starting point. After you are finished with the form, you can publish it to the content type or another location. To create a custom property panel p from InfoPath:
- In Microsoft Office InfoPath 2007, on the File menu, click Design a Form. On the Design a Form dialog box, under Design a new, select Form Template, select XML or Schema, and click OK. The Data Source Wizard appears.
- Navigate to the Windows SharePoint Services 3.0 site or list on which the content type resides. Click Next.
Microsoft Office InfoPath 2007 queries the server and displays a list of content types residing on the specified list or site. If you entered a site URL, Microsoft Office InfoPath 2007 displays a list of the site content types on that site. If you enter a document library URL, Microsoft Office InfoPath 2007 displays a list of content types available for that document library.
- Select the content type for which you want to customize the document information panel, and click Next.
Microsoft Office InfoPath 2007 warns you if a custom document information panel has already been created for this content type. To create another custom form, click OK.
Note: The existing form is not altered until you publish your new form to the content type.
- Click Finish.
Microsoft Office InfoPath 2007 loads an auto-generated document information panel, based on the content type schema.
- Edit and customize the form as you want, and then save the form.
Note: Because the custom form is based on the content type schema, you cannot edit the form schema as you can with typical Microsoft Office InfoPath 2007 forms. To change the custom document information form schema, you would first have to change the content type schema itself in Windows SharePoint Services 3.0.
- Publish the form. You can choose to publish the form directly to the content type, or to a location. Exit Microsoft Office InfoPath 2007 when you have published the form to the desired location.
To publish the custom document information panel to the content type:
- In Microsoft Office InfoPath 2007, from the File menu, click Publish to open the Publishing Wizard. Click Next.
- Verify the content type information displayed by the wizard, and then click Publish.
Microsoft Office InfoPath 2007 warns you if a custom document information panel has already been specified for this content type. To override those settings, click Yes.
Note: If the initial custom form was published directly to the content type, then that form is overwritten with the new custom form. If the initial form was published to some other location, however, the new custom form is published directly to the content type, and only the content type setting specifying the location of the custom document information panel is overwritten. If you publish to a shared location, you will need to update this location using the content type settings page.
Microsoft Office InfoPath 2007 displays a dialog box confirming that the form was published successfully.
- Click Close.
To publish the custom document information panel to some other location:
- In Microsoft Office InfoPath 2007, from the File menu, click Publish to open the Publishing Wizard, and then click Next.
- Select a destination other than As a Document Information Panel template for a SharePoint site content, or list content type as your publishing location, and then click Next.
- Complete the Publishing Wizard as you would for publishing any other form.
- Within the Windows SharePoint Services 3.0 user interface, navigate to the settings page for the content type, and then click Change Document Information Panel settings.
- Select Use existing custom template (URL, UNC, or URN), and enter the URL or URN location of your custom document information panel. Click OK.
What are the main configuration elements of InfoPath Form Services? Where does the server level configuration elements reside?
The InfoPath form services server-level configuration elements are located in SharePoint Central Administration.
How many sections are there inside the InfoPath Form Services element?
There are five sections:
- Manage Form Templates
- Configure InfoPath Services
- Upload form templates
- Manage Data Connection files
- Manage the Web Service proxy
What set of functions can we perform with the help of Manage Form Templates?
This section allows the administrator to perform the following actions:
- Activate a form template to a site collection.
- De-activate a form template from a site collection.
- Quiesce a form template.
- Remove a form template.
What does quiescing a Form Template mean?
Quiescing is a process that takes the form templates offline gradually and prevents new sessions from being created. It allows existing sessions to be completed, thereby preventing data loss. When a form template is quiesced by the administrator, the form templates from all the site collections are taken offline.
What are the set of functions we can perform with the help of "Configure InfoPath Form services"?
This page allows an Administrator to configure some of the basic settings for the InfoPath Form Services. There are so many sections in the page, but the important of them are following:
- User Browser-enabled form templates
- Data connection time out
- HTTP data connections
- Cross domain access for User Form Templates
- Form session states
How is form session state maintained?
The InfoPath Form Services can maintain data in two modes:
- SQL Server database: This approach is termed as using Session State Services.
- ASP.NET view states stored in the client side: Termed form view.
Points to be noted: The application needs to be associated with the Shared Service Provider.
When to use which session state mode?
Session State Service mode [SQL Server database] is recommended for low bandwidth users, as the form view states hamper the performance for low bandwidth. Whereas, Form View can be used for environments with small groups of users.
The administrator can also enter a value for the session data size allowed for Form View State. InfoPath Form Services will automatically revert to Session State Service when session data size exceeds the value associated with the form view mode.
What is the required feature that needs to be activated within a site collection for InfoPath Form to work?
The feature called Office SharePoint Server Enterprise Site Collection Features must be activated within the site collection.
What will happen if "Office SharePoint Server Enterprise Site Collection Features" is not activated?
It would require the InfoPath Client Application to be installed.
What are the main integration areas of InfoPath with SharePoint?
Following are the main integration areas of InfoPath with SharePoint:
- Publishing into Windows SharePoint Services Form Library.
- Integrating with SharePoint form libraries using Property Promotion and Property Demotion.
- Publishing as SharePoint Content Types.
- Using Document Information Panel.
- Timesheets, expense reports, travel request, help desk request, etc.
Exploring the path of Butterflies.
Md Athar Raza Faridi,Programmer Anaylst [MCTS],Sharepoint/MOSS2007/Sharepoint 2010/.net/Biztalk Developer.