Chapter 7: Creating the Information Retrieval Visio XML Application


Component Object Model (COM) add-in provides Visio users an access to .NET framework technologies, such as .NET remoting and Web services, to facilitate the use of eXtensible Markup Language (XML) data in the Visio documents. The SolutionXMLElement is an element of a Visio document that provides the functions to store XML data in Visio documents.

This chapter explains how to use COM add-in for Visio to extract data from a Web service. It also describes how the SolutionXMLElement element of Visio saves the extracted data in an XML format in a Visio document.

Architecture of the Information Retrieval Visio XML Application

The Information Retrieval Visio XML application uses a COM add-in to retrieve information about various services, such as hotels, hospitals , and motels, the companies that provides these services, and the locations in which these services are located. For example, a company XYZ in locations Street1, Street2, and Street5 and a company ABC in Street 4, provide a Motel service. The Information Retrieval Visio XML application allows an end user to open a Visio document and request the COM add-in to retrieve information about the motels. The COM add-in retrieves the information such as the complete address and phone number about the motels that the ABC and XYZ companies provide. The end user can extract this data with the help of the SolutionXMLElement element of the Visio document.

The Information Retrieval Visio XML application consists of two projects:

  • InformationRetrievalCOMAddIn

  • InformationRetrievalWebService

The InformationRetrievalCOMAddIn project enables an end user to access the InformationRetrieval COM add-in from a Visio document. The InformationRetrieval COM-add-in retrieves information for services, such as hotels, motels, hospitals, and eating joints from a Web service. The COM add-in provides various windows to the end user to browse through the data provided and extract the data in XML format. The SolutionXMLElement element of a Visio document saves the extracted XML data in that Visio document. The InformationRetrievalCOMAddIn project loads the InformationRetrieval COM add-in when the end user creates a new Visio document in Microsoft Visio 2003.

The InformationRetrievalWebService project creates a Web service that exposes methods to retrieve information regarding services, the companies that provide these services, their location, address, and phone numbers from the services_info database.

Figure 7-1 shows the architecture of the Information Retrieval Visio XML application:

click to expand: this figure shows the interaction between different components, such as informationretrievalcomaddin project, informationretrievalwebservice project, and the visio 2003 document of the information retrieval visio xml application.
Figure 7-1: The Information Retrieval Visio XML Application Architecture

The InformationRetrievalCOMAddIn project consists of the following files:

  • Connect.vb : Provides the Connect class that connects to Microsoft Visio as a COM add-in.

  • EventSink.vb : Provides the EventSink class to trap Visio events that occur when an end user creates a Visio document in Microsoft Visio. The EventSink class also writes XML data in the SolutionXMLElement element of that Visio document.

  • frmServices.vb : Provides the Services class that defines the Services window, which lists the available service categories. The Services window enables an end user to select a service category to view the contact details of all the companies that provide the services associated with a particular service category.

  • frmLocations.vb : Provides the Locations class that defines the Locations window. This window enables an end user to select a location to view all the services available in that location.

  • frmCompanies.vb : Provides the Companies class that defines the Companies window. This window enables an end user to select a company to view all the services provided by that company.

  • frmNearbyLocations.vb : Provides the NearbyLocations class that defines the Nearby Locations window, where end users can locate services in areas close to their place of residence or work.

  • frmCompanyLocation.vb : Provides the CompanyLocation class that defines the Company Location window. This window lists the companies that provide certain services, along with their contact information. An end user selects the category of service required in the Services window, and views a list of companies based on the service category selected.

  • frmCompanyServices.vb : Provides the CompanyServices class that defines the Company Services window. The Company Services window lists the companies and the services provided by these companies based on the location that the end user selects in the Locations window.

  • frmServiceDetails.vb : Provides the ServiceDetails class that defines the Service Information window. The Service Information window provides information, such as service categories, companies, locations, addresses, and phone numbers based on the options that the end user selects from the Company Location or Company Services windows.

  • Shared.vb : Provides the Shared module that declares a public XMLds dataset that contains the extracted XML data from the Web service.

The InformationRetrievalWebService project consists of one file, InformationRetrievalService.asmx.vb that provides the InformationRetrievalService class. The InformationRetrievalService class defines the Web service that connects to the services_info database to retrieve information about services, companies, and locations.

Figure 7-2 shows the class diagram for the Information Retrieval Visio XML application:

the figure shows the classes informationretrievalservice, companies, companylocation, companyservices, connect, eventsink, locations, nearbylocations, servicedetails, and services, as well as a module called shared, used in the information retrieval visio xml application.
Figure 7-2: The Class Diagram for the Information Retrieval Visio XML Application



NET InstantCode. UML with Visio and Visual Studio .NET
NET InstantCode. UML with Visio and Visual Studio .NET
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 49

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