Step 1: Set Up the Project for the Federated Search HTML to RSS Converter
Note
This topic describes functionality that is part of the Infrastructure Update for Microsoft Office Servers. To download the update, see Description of the SharePoint Server 2007 infrastructure update: July 15, 2008.
Before you can use the sample, you need to create a new Web site and load the required object hierarchies. The tasks involved include:
Creating the Web Site project
Building the HtmlAgilityPack assembly.
Adding the required references
Creating the Web Site Project
The sample is designed to be built and deployed by using Visual Studio 2005.
To create the Web Site project
In Visual Studio 2005, on the File menu, point to New, and then click Web Site.
In Visual Studio installed templates, click ASP.NET Web Site.
In Location, click File System, and, if necessary, click Browse to find the correct location for this Web site. This can be the standard location for your Visual Studio projects and Web sites or the location under your Web site's virtual directory where you will deploy this Web application.
Note
This sample is designed to be deployed on a different Web site. However, it might be more convenient and simpler architecturally to deploy it in the
_layouts
directory of an Office SharePoint Server 2007 site. For more information, see How to: Create a Web Application in a SharePoint Web Site and Getting Started with Customizing a SharePoint Web Site in Visual Studio. These instructions also apply for deploying it on any SharePoint Web site.In Language, click Visual C#, and then click OK.
Building the HtmlAgilityPack Assembly
The Federated Search HTML to RSS Converter uses the HtmlAgilityPack assembly, an HTML parser used to build structured XML documents from HTML documents and streams. This assembly is lightweight and easy to use, and it enables you to move through an HTML document by using XPath queries. However, you might choose to use another HTML parser for your scenario. You can also extract HTML by using regular expression mapping. If you use this approach, however, you do not need HtmlAgilityPack. See Regular Expression Examples for examples of code that extracts and manipulates text by using regular expressions.
If you choose to use the HtmlAgilityPack assembly, you must download and compile its source code so that you can add it as a reference to this solution.
To build the HtmlAgilityPack assembly
From the Source Code tab of the HtmlAgilityPack site on CodePlex, download and unzip the latest version of the source code to the appropriate location in your file system.
In Visual Studio 2005, on the File menu, point to Open, and then click Project/Solution.
In Open Project, locate and open the HtmlAgilityPack.csproj file.
On the Build menu, click Build Solution.
Verify that the compiled component file (HtmlAgilityPack.dll) is built. By default it should build to the /bin/debug directory of your project. If you want to change this location, on the Project menu, click HtmlAgilityPack Properties. In HtmlAgilityPack, on the Build tab, change the value for Output path.
Adding the Required References
To load the object hierarchies that this sample uses, add references to the required components (including the HtmlAgilityPack assembly).
To add the required references
On the Web Site menu, click Add Reference.
On the .NET tab, select the following references, and then click OK after each selection:
System
System.Web
On the Browse tab, locate the compiled component file (HtmlAgilityPack.dll) that you built. Select HtmlAgilityPack.dll, and then click OK.
Next Steps
Step 2: Add the Code for the Federated Search HTML to RSS Converter
Step 3: Create the Federated Search Location and Customize the XSL