Wednesday, May 30, 2018

Introduction to publishing a form template

Introduction to publishing a form template

After you finish designing a form template, you must save and publish the form template so that your users can fill out forms that are based on it.

In this article

How publishing works

Publishing a browser-compatible form template

Publishing a form template with full trust

Sending a form template in an e-mail message

Modifying or moving a published form template

How publishing works

When you publish a form template, you first save the form template and then use the Publishing Wizard to distribute the form template to your users. The Publishing Wizard modifies the form template for distribution by adding the publish location and processing instructions, so that users can open forms that are based on this form template. The processing instructions allow forms that are based on this form template to be automatically updated if you make changes to the form template after publishing it. When a user first opens the form, Microsoft Office InfoPath downloads the form template from the location that is specified in the processing instructions to the user's computer, and then InfoPath creates a form that is based on this form template. If the user saves the form and then later opens the form, InfoPath compares the version of the form template on the user's computer with the version of the form template that is specified in the processing instructions. If the version in the location specified in the processing instructions is newer than the version on the user's computer, InfoPath downloads the newer version of the form template and then updates the form with the new version of the form template.

After modifying the form template with the publish location and processing instructions, the wizard then saves the modified form template to the publish location that you specify. You can publish a form template to the following locations:

  • A server running Microsoft Windows SharePoint Services    When you publish a form template to a server that is running Microsoft Windows SharePoint Services, you can do one of two things: You can publish the form template to a document library, where it will be used as the template for all of the documents that users fill out in that document library. Or you can publish the form template as a site content type. This means that the form template can be used as a template in several site collections.

  • A server running InfoPath Forms Services    You can publish a browser-compatible form template to a server that is running InfoPath Forms Services. Browser-compatible form templates allow users without InfoPath to fill out forms that are based on your form template by using a Web browser.

  • As part of an e-mail message    You can publish a form template by sending it in an e-mail message to your users. Users can then open the e-mail message and fill out the form.

  • A shared network folder    You can publish a form template to a shared network folder that your users can access. Your users can go to the shared folder and create a form that is based on the form template.

    Note: This feature replaces the functionality in Microsoft Office InfoPath 2003 SP1 that enabled you to publish a form template to a Web server.

  • As an installable file    If you have Microsoft Visual Studio .NET 2003 or Microsoft Visual Studio 2005 installed on your computer, you can publish a form template as an installable file that is stored on a shared network folder. Users can download and run the installable file to install and register the form template on their computer. If you do not have Visual Studio, you can publish the form template to a shared network location and have InfoPath create a script file that registers the form template. A user can then download both the form template and the script, and then run the script to register the form template.

When a user wants to fill out a form for the first time, he or she goes to the location where the form template was published and opens a form that is based on the form template. Therefore, it is important that your users have access to the location where you publish your form template. When a user creates a new form, InfoPath stores (or caches) the form template on the user's computer. This allows the user to fill out the form even when working offline. If the user saves the form and then opens it later to finish filling it out or opens another blank form that is based on the form template, InfoPath determines if the user's computer is connected to the published location of the form template. If there is a connection, InfoPath checks for any updates to the form template, applies those updates, and then opens the form. If there is no connection, InfoPath opens the form that is based on the form template that is stored on the user's computer.

Publishing a form template is not the same as saving a form template. When you save a form template, you are saving it to preserve your work, just as you do when you save a file to your computer. The following table outlines the different choices that you have for saving a form template.

Command

Description

When to use

Save

Saves the form template to its current location, using the same name. If you are modifying a form template that has already been published to a document library on a server running Microsoft Windows SharePoint Services, InfoPath allows you to save the form template only to a location other than the publish location.

Click this command to save your changes when designing a form template. If you are modifying a published form template, click the Save As command to save the form template to a new location.

Save As

Saves the form template to a new location or to the same location but with a new name. If you are modifying a form template that has already been published, clicking Save As will not update the published form template.

Click this command when you need to modify a copy of a form template.

Save as Source Files

Saves the form template to a new location as a set of form files instead of as a single .xsn file.

Click this command when you need to modify the form template's individual form files; for example, if you want to update one of the resource files included in the form template. In most cases, you won't need to work with a form template's individual form files.

Note: You should always use the Publishing Wizard when you want to distribute your form template to your users.

Top of Page

Publishing a browser-compatible form template

In earlier versions of Microsoft Office InfoPath, your users needed InfoPath installed on their computers in order to fill out forms that were based on a form template. In Office InfoPath 2007, you can design a browser-compatible form template whose forms can be filled out either in a Web browser or in InfoPath. To allow users to fill out a form in a Web browser, you publish the form template to a server that is running InfoPath Forms Services.

Note: A form template that contains code cannot be directly published to a server running InfoPath Forms Services. For many reasons, including server manageability, security, and performance, a form template that contains custom code requires administrator approval before it can be associated with a document library or generally available as a Web application. You publish the form template that contains code to a shared network location, and then the administrator uploads the form template into the server.

Top of Page

Publishing a form template with full trust

Forms that are allowed full access to system resources, such as files on your computer or other settings, are called fully trusted forms. A fully trusted form is created from a form template that either is digitally signed with a trusted certificate or is installed on the user's computer. A form template that is digitally signed with a trusted certificate does not have to be installed or registered on the user's computer. This kind of form template can be distributed as an attachment in an e-mail message, or users can download this form template from a document library or shared network folder.

Fully trusted forms can access information that is stored in the form itself, as well as information from any of the following locations:

  • The same domain as the form

  • All other domains that the form can access

  • All files and settings on the computer that the person filling out the form can access

To publish a form template with full trust, you can do one of following:

  • You can digitally sign the form template with a certificate from a trusted certificate authority and then publish the form template to a shared network location. Your users can then open the form template from the shared network location.

  • If you have Visual Studio .NET 2003 or Visual Studio 2005, you can use the Publishing Wizard to create an installation package that installs and registers the form template on your users' computers. A user with administrator rights on the computer can then run the installation package to install and register the form template.

  • If you do not have Visual Studio .NET 2003 or Visual Studio 2005, you can use the Publishing Wizard to publish the form template to a shared network location and to create a script to register the form template on your users' computers. A user with the appropriate user rights on the computer can copy both files to the computer and then run the script to register the form template.

Top of Page

Sending a form template in an e-mail message

You can use the Publishing Wizard to distribute your form template to your users in an e-mail message. Users who have Microsoft Office Outlook 2007 and InfoPath installed on their computers can fill out the form directly in the e-mail message when they first open the e-mail message. Users with earlier versions of Outlook or with other e-mail applications receive an e-mail message with the form template and the form as attachments. These users must first click the form template attachment to install the form template on their computers. After installing the form template, users can then click the form attachment in the e-mail message to fill out the form in InfoPath.

If the form template needs to access the system resources on a user's computer or you are sending your form template to users in another domain, you should digitally sign the form template with a certificate from a trusted certificate authority prior to publishing. Your users in another domain may encounter errors if they open a form template without a certificate.

Top of Page

Modifying or moving a published form template

If you modify a form template after it has been published and there are existing forms based on this form template, the changes that you make to the form template will be reflected in those existing forms. For example, if you delete a section in your form template that contains a table, that table and all of the data in that table will be deleted in all of the existing forms that are based on that form template. This can result in data loss. Therefore, you should plan to test any changes that you make to your form template to determine the effects on the existing forms.

To modify a form template that has been published, you modify the working copy of the form template. The working copy is the version that is stored on your computer or in a version control program, such as Microsoft Visual SourceSafe. After you modify the working copy, you can publish it to the publish location. If you do not have a working copy of your form template, you may be able to get a copy from the publish location and then save that copy to a location other than the publish location. After modifying the working copy of your form template, you use the Publishing Wizard to republish the form template to the original publish location. The Publishing Wizard overwrites the existing version of the form template in the publish location with your modified version. Because InfoPath determines the identity of a form template based on its name and location, it is important not to change these when you republish the form template.

If you want to move a published form template to a different location, you can publish the working copy of the form template to the new location. Before you publish the form template to its new location, you may have to modify it to reflect the new location. For example, the locations of the external data sources used by your form template may have changed. You need to update the data connections with the new locations for the external data sources before you publish the form template to its new location.

If there are existing forms based on the published form template, you also need to link the existing forms to the form template that you publish in the new location. If you do not do so, your users may not be able to open their existing forms.

Top of Page

No comments:

Post a Comment