Professional InfoPath 2003 [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Professional InfoPath 2003 [Electronic resources] - نسخه متنی

Ian Williams, Pierre Greborio

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید











Handling Template Modifications

Before you make changes to a template, you should to be aware of how your changes will impact the existing forms based on it. Some changes have a more severe impact than others, to the extent that in the worst case, it is sometimes better to start with a clean slate and create an entirely new design. Here are some of the changes that can impact your users:



Renaming elements or attributes in a data source, or adding, removing, or moving them



Renaming or moving a template



Changing repeating items to nonrepeating



Altering the data type of a field



Manually changing the version number of a template




Changes to the Data Source


When you design a form, InfoPath assumes that the data source is completely and correctly defined, and it won’t adapt to subsequent changes you make to the underlying form, database, or Web service schema. When you need to change a data source, several form files will be affected to some degree. The table shows the form files you’ll need to modify and the type of changes you will have to make.

























File


Type of Change


Form definition


xmlToEdit elements. ADO or Web service queries.


Template


Element and attributes.


Schema


Element and attributes.


View transform


xsl:apply-templates and the match attribute of xsl:template elements.


Script


XPath statements.


The extent of change will depend on the number of data source elements or attributes that you alter, and the kind of modifications you make. The next table shows the impact of these changes on existing forms and the actions you will need to take. The changes are listed in the order of increasing level of complexity.






















Change


Impact on Existing Forms


Action Summary


Rename


Forms become incompatible with schema unless they are updated.


All files require that a corresponding item has to be updated.


Add


All XML forms will open with the new schema unless the new items are required by the schema.


XSF, XSN, and XSD require corresponding items to be added.


Delete


Forms become incompatible with the data source schema unless they are updated.

Views may not display content.


All files require that a corresponding item has to be removed.


Move


Forms become incompatible with the data source schema unless they are updated.

Views may not display content.


Effectively combines the actions of adding and deleting.




Changes to Trusted Forms


The way you make changes to trusted form depends on whether you are making design mode changes to the form template or to the extracted files. If you change the template, your users can replace the existing templates with the new one. If you alter the extracted files, you have to repackage them and have users reinstall the trusted form. In this case you can use the form registration tool to convert the template to a fully trusted form. Its use is described in Chapter 10.


Updating XML Data


The InfoPath SDK contains a processing instruction update tool that simplifies the task of updating the processing instructions of a form’s underlying XML document. This is a command-line utility you can use to update a single form or to handle multiple updates. The filename is pifix.exe, and it is usually located in the tools folder in C:\Program Files\Microsoft Office 2003 Developer Resources\Microsoft Office InfoPath 2003 SDK.

Here’s a reminder of how a PI looks:


<?mso-infoPathSolution productVersion="11.0.5531" PIVersion="1.0.0.0"
href="file:///D:\infopath\meta2\manifest\manifest.xsf" language="en-us"
solutionVersion="1.0.0.89" ?>

To use the utility, open a command prompt and type pifix followed by the command-line switches and values described in the table. All the switches are optional except for the filename. The tool updates the PIs and creates a log file.


































Switch


Description


/O


Path and name of the output file(s).


/URN


URN is to replace the existing URN.


/URL


URL is to replace the existing URL.


/V


Version number of the form that is to replace the existing version number. If part of the version number is not specified, 0 is used by default.


/IV


Name of the initial view.


/L


Path and name of the XML log file.


/?|/h|/help


Help for the tool.


filename


Required. Full path, which can contain wildcard characters, of the form(s) to update.


Here’s a multiple update example:

pifix /URN urn:metadata:newsline /V 1.0.0.19 /IV contributor /L updatelog.xml d:\newsline\stories\week08\*.xml


Some Precautions


InfoPath has an automatic upgrade option that helps ensure that your modifications can be made without affecting your users’ ability to continue working with existing forms. If the option is enabled (default), InfoPath can reconstruct the form to conform to a new schema. If this option is disabled, the forms won’t be upgraded and may not open or function correctly. The third possibility is to upgrade using a script. You see how that works later in this chapter.

In design mode, choose Tools→Form Options and go to the Advanced tab. In the On version upgrade drop-down list, select the version upgrade method you want to use. Figure 9-1 shows the interface.


Figure 9-1: Choosing an upgrade option.

Additionally, you can minimize or avoid risk by following some other basic precautions:



Make backup copies of the extracted files before you modify them.



Add fields or groups to the data source but don’t remove them.



Don’t move data source objects unless the structural change is vital.



Don’t alter the names of groups or fields after they have been published.



Publish modified templates with a new name or location, instead of overwriting the existing ones.



/ 166