Introducing Microsoft InfoPath 2003


In a number of scenarios, Office documents are used as electronic forms. For instance if you were to create a vacation request form or submit a timesheet or an expense report, you typically end up filling out either a Word or an Excel template and sending it off to another user , primarily through email. Even though business problems can potentially be solved using this approach, it isn't really the right usage for the right tool. InfoPath, a new product in Office System 2003, builds on Office applications, but instead of simply providing a free-form document-editing application, it adds a lot of structure to the types of documents created by it. With simple dragging and dropping of elements and settings, InfoPath can be used to create a dynamic XML-based electronic form that can be routed to internal and external users, saved into enterprise databases and Web services, and have full form-validation logic included with it. For instance, take a look at a simple time sheet form (shown in Figure 12.5) that enables a user to log the time spent on different projects on a series of dates. The information submitted as part of this electronic form can be automatically sent to relational databases where further processing and posting of this information can occur. Although it is possible to utilize Excel and/or Word document templates for this scenario, the solution will probably end up with a limited set of functionality and/or a much larger development time.

Figure 12.5. A simple InfoPath electronic form for submitting time sheets.

Although InfoPath would typically be used to submit data directly to relational databases and/or Web Services, instances of InfoPath forms can also be stored as XML documents either locally or remotely on a file/SharePoint repository. This feature can be utilized to store instances of XML forms created by InfoPath in a local machine for any offline use. InfoPath XML forms are always XML instances and have a processing instruction that allows the Microsoft Windows operating system to know which particular InfoPath form template is associated with a particular instance.

SHOP TALK : ELECTRONIC FORMS AND INFOPATH, THE KILLER APP FOR XML AND WEB SERVICES

Electronic forms and, in particular, InfoPath in a number of ways is a killer application leveraging XML capabilities from an end-user perspective. Even though it is currently in its first release, InfoPath has the potential of being as ubiquitous as Microsoft Office. Also because the information captured by InfoPath is tagged, which means that it can be stored in a structured repository, searched, reported , audited and so on, InfoPath documents (also known as electronic forms) can potentially be more useful than Office documents. The real benefit of InfoPath, however, lies in its adoption. If InfoPath gets even the fraction of success that Office productivity applications such as Word, Excel, and PowerPoint have enjoyed, you can be sure that my next book will be written as an InfoPath document instead of a Word document. In fact, there exist standard vocabularies in XML for electronic books that can be used. The only major obstacles lie in the mechanism for users to fill forms. In my opinion, it is very important for Microsoft to make available InfoPath's client (filling out forms and reading forms) functionality (or a subset of it) through a low-cost (perhaps free) and/or Web-based zero-client interface. This way, my insurance agent can send me an InfoPath-based application form; I can fill in my part and send it back to him without having to buy an InfoPath client. From a competitive perspective, in addition to InfoPath, Adobe Acrobat PDF is another commonly used document exchange format, that has electronic form capabilities (which from my understanding is moving towards XML) and enjoys platform independence as Acrobat Readers are available on multiple platforms.


Listing 12.3 shows the actual XML content of the InfoPath Form instance. Notice that the XML document created by InfoPath is really like any other XML document, but for the two processing instructions <?mso- ?> . These instructions allow XML forms created by InfoPath to be associated with the InfoPath application when the file is double-clicked to open it. If you want to look at the actual XML content, you will probably need to open the file with a simple text editor such as Notepad or Textpad.

Listing 12.3 Order XML Data
 <?xml version="1.0" encoding="UTF-8"?>  <?mso-infoPathSolution solutionVersion="1.0.0.1"   productVersion="11.0.5329" PIVersion="1.0.0.0"   href="file:///C:\TimeSheet.xsn"?>   <?mso-application progid="InfoPath.Document"?>  <my:TimeSheet     xmlns:my="http://schemas.microsoft.com/office/infopath/2003/... "     xml:lang="en-us">       <my:name>Hitesh Seth</my:name>       <my:period xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">          2003-08-30       </my:period>       <my:TimeLogs>             <my:TimeLog>                  <my:project>Install SharePoint</my:project>                  <my:hours>10</my:hours>            </my:TimeLog>            <my:TimeLog>                 <my:project>Configure SharePoint</my:project>                 <my:hours>5</my:hours>            </my:TimeLog>            <my:TimeLog>                 <my:project>Create Authorization Web Parts</my:project>                 <my:hours>25</my:hours>            </my:TimeLog>      </my:TimeLogs>      <my:VacationLogs>         <my:VacationLog>             <my:type>Vacation</my:type>             <my:fromDate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">                   2003-08-26             </my:fromDate>             <my:toDate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">                   2003-08-29             </my:toDate>         </my:VacationLog>     </my:VacationLogs> </my:TimeSheet> 

InfoPath As a Web Services Front End

As an electronic form, InfoPath can also be used as a front end to a Web service. Basically, InfoPath allows data elements of the form to bind to external Web services using the visual designer. Forms created using InfoPath can invoke Web services for sending data, receiving data, or both. InfoPath invokes the underlying Web services by creating a standard SOAP request and then processing an associated SOAP response. After the Web service receives the SOAP request, it can continue the downstream processing, such as invoking a workflow (implemented perhaps using BizTalk Server), or integrating the transactional data with back-office applications (again integrated using BizTalk Server). InfoPath is integrated tightly with Windows SharePoint Services, a new collaboration component of Windows 2003 Server technology that allows electronic forms instances to be published to a Windows SharePoint Services repository. You will explore SharePoint technologies in detail in Chapter 13, "Leveraging Windows Server System with .NET."

WHAT IS WINDOWS SHAREPOINT SERVICES?

Windows SharePoint Services (WSS) is an evolution of Microsoft SharePoint Team Services, which was released as part of the FrontPage XP product. WSS is now an integral part of Windows 2003 Server and can be downloaded as a free add-on from the Windows Update Web site.


For instance, in Figure 12.6, InfoPath has been utilized to create a Web services “based data query application using the Customer Lookup Web service that you developed earlier in Chapter 9, "Developing Web Services."

Figure 12.6. InfoPath as a Web services front end.

A key feature of InfoPath is that one InfoPath form can be used to interact with several Web services. For instance, one Web service can be used to initialize the form, a set of Web services can be used to validate and provide input value options, and another Web service can be used to submit the form itself.

Although InfoPath provides built-in mechanisms for validating form controls, it is possible for a developer to build complex validation and processing logic using an underlying script engine. VBScript is the programming language for InfoPath. In addition, .NET components can be used with InfoPath through COM interoperability (as discussed in the previous chapter). An InfoPath-based electronic form can invoke a .NET component using COM interoperability as part of the processing logic of the InfoPath form. You can also add scripting to InfoPath forms using the included Microsoft Script Editor, which uses JavaScript.

Creating New XML Schemas Using InfoPath

In most scenarios, you will typically create InfoPath forms that attach to existing XML Schemas, Web services and/or databases. Although it isn't really the main purpose of the InfoPath application, it can be used to author XML Schemas. As you drag and drop the various controls onto an InfoPath form and an element hierarchy is built with the designer, InfoPath creates an underlying XML Schema representation for the information. In fact, under the covers, the InfoPath Form stores the underlying XML Schema utilized for the form.



Microsoft.Net Kick Start
Microsoft .NET Kick Start
ISBN: 0672325748
EAN: 2147483647
Year: 2003
Pages: 195
Authors: Hitesh Seth

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net