14.5. Form Deployment and Distribution

There are many ways to deploy and distribute forms, and the method you choose depends on several factors. These include the location from which you want users to access the form and the level of security you want to enforce when the form is filled out. As mentioned earlier, restricted mode forms can be distributed by simply sharing the XSN file, but the usefulness of such forms is limited to simple data gathering. In most cases, you will need to publish your forms. The following sections examine the publishing process in detail.

14.5.1. How Form Publishing Works

InfoPath uses the term publishing to refer to the process of preparing a form for distribution and actually placing it into the desired location. Saving a form template and then copying it to another location is not the same as publishing the template. Publishing a template is analogous to compiling a source file for an executable program. You can save the source file as often as you like, but you can't run it until it is compiled. Compiling the file accomplishes several goals. First, it validates the source code so that the programmer can identify and correct logical and syntactical errors. Second, it transforms the source file into a format the target machine can understand.

Form publishing works the same way. InfoPath examines the contents of the form template and validates it, allowing the form developer to correct any problems, and then it transforms the template so that it can run properly in the specified target environment. In the case of a source file, the compiler is only concerned with the runtime execution. In the case of a form template, there are at least two scenarios that have to be covered: the creation and storage of form data when the template is "executed," and the storage and configuration of the form template itself.

14.5.2. Publishing to a SharePoint Site

When a form template is published to a SharePoint site, the template is updated to reflect its new location and the modified template is attached to the form library as the document template for that library. When a new form is created, the form data file contains a reference to the form library. The following example illustrates the steps involved:

  1. Open the Meeting Agenda sample form in design mode.

  2. Select Publish from the File menu to start the Publishing Wizard.

  3. Select To a SharePoint server with or without InfoPath Forms Services, and click Next.

  4. Enter the URL of the target site, and select Document Library as the publishing target. You can either create a new library or update an existing one.

  5. Select the columns you want to promote, and then click Next. You are presented with a summary page indicating the target library, its location, the server type, and the security level that has been determined by InfoPath based on the form options and other factors such as whether the form contains embedded code. The Meeting Agenda sample is marked as restricted because it does not contain any code, just rules. Restricted mode allows it to run anywhere.

  6. Click Publish to complete the wizard and publish the form. You should see a dialog like the one shown in Figure 14-18.

    Figure 14.18. Figure 14-18

14.5.3. Publishing to a Content Type

InfoPath 2007 adds the ability to publish a form to a content type. This is a new feature that eliminates the IT bottleneck associated with publishing a form directly to a form library, as in the previous example. The bottleneck occurs because the publishing step often requires knowledge of how the form works. For example, the person publishing the form has to decide which columns to promote. Typically, this person is the form designer. After the form is up and running, a site administrator may need to deploy the same form to another form library. This means that the form designer must open the form in design mode and repeat the steps required to publish the form to the new location.

Content types eliminate this, allowing site administrators to attach the same form to multiple form libraries without the help of the form designer. They can simply enable the selected content type on the new library by using the SharePoint user interface. The steps for publishing to a content type are similar to those used when publishing to a form library, except that you select Site Content Type in the Publishing Wizard dialog, as shown in Figure 14-19.

Instead of creating or updating a document library, you create or update a content type, as shown in Figure 14-20.

The important part of this process is that the resulting content type will contain a reference to the form template after it is published. It is essential that this reference be accessible to users of the content type. This carries security implications as well, especially for forms that rely on the domain security mode. Recall that domain security mode restricts a form from accessing resources outside its domain. It is important to ensure that the location and file name you choose for such templates is within the same domain as the content type. Typically, this means publishing the form template to a document library on the same site, as shown in Figure 14-21.

Figure 14.19. Figure 14-19

Figure 14.20. Figure 14-20

Figure 14.21. Figure 14-21

Publishing the template and publishing to the content type are two distinct operations. The location and file name you specify in the Publishing Wizard when publishing to a content type is what is written into the content type definition. You have to ensure that the location and file name match the actual location of the form template. If they don't match, then you'll get an error when trying to create form data items from the content type.

When you have completed the Publishing Wizard, you will see a dialog that contains a link to the content type page of the site. From there, you can manage the new content type. Figure 14-22 shows the resulting content type in the SharePoint user interface.

Figure 14.22. Figure 14-22

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.62.34