The service is automatically enabled for searching, and it will appear in the Search for list the next time you open the Research task pane. Learn more about the languages that Microsoft Translator supports. To turn on Parental Control, click Parental Control , select the options you want, and then click Close.
Need more help? Expand your skills. Get new features first. Was this information helpful? Yes No. Thank you! Any more feedback? The more you tell us the more we can help.
Partagez cette page:. Office of Applied Research. Personnnes Personnnes. Learn more. Brent Hecht Director of Applied Science. The first type of information tells the Web method about the client application that is calling the Web method. The information is found mainly in the OfficeContext node of the packet, and includes data such as the name, version, and language of the application in which the end user is working.
You can use the information in the OfficeContext node to determine what data to display and whether to show buttons allowing the user to copy and paste data from the Research task pane to the application. The second type of information tells the research service what criteria to use to determine what data should be returned. The Keywords node of the query packet contains an element named QueryTerm.
For simple research services, you can use that element's value to get the criteria for your data query. The Keywords node also breaks up multi-word terms so that you can search for each word separately. When the research service is called because a user typed a term into the Search For text box, the QueryTerm element is also sent as a part of the Context node.
If the research service is called by a form element, the Context node includes different children. The following XML fragment is sent when the user selects Finland from the country list:. The first part of the sample's Query Web method checks for a SelectCountry element in the query packet. If it exists, the code continues by querying the Contacts table with the value of the SelectCountry element as the criteria.
If the SelectCountry element doesn't exist, the request is either a query by name or a request for the Country list. You can refer to Listing 4 to see the response packet returned by the sample research service for a query result.
Note that the Response element's domain attribute value is the same as the ID element's value in the Service node of the Registration response. After running a query on the Contacts table, the sample code creates a Heading element for each contact the query returned.
The Heading element's children include a Text element for the contact's name and P elements for the address, city and region, and phone number. The NewQuery element appears as a hyperlink when it is rendered by the Research task pane.
The Text element's value is used for the text of the hyperlink. The value of the query attribute is sent as the QueryTerm element of the query packet.
If you want the Research task pane to display a form for the user, you add a Form node to the response packet. The Listbox element's action attribute is set to requery so that when the user selects a country from the list, the Research task pane makes another call to the research service. This time, the query packet includes a SelectCountry element with a value equal to the country the user selected. Once you have written the Registration and Query Web methods for your research service, you can install it in Office Click the Research Options hyperlink at the bottom of the task pane.
From the Research Options dialog box, click the Add Services command button. You can see the Add Services dialog box shown in Figure 9. When you click the Add button, the Registration method is called. If it returns a valid response packet, the research service is installed. When you return to the Research task pane, your research service is listed in the resource drop-down list. If your user community needs to do quick searches of corporate data without adding yet another full-fledged application to each desktop, the Research Library is just the tool you need.
The sample in this article demonstrates a simple but powerful research service. To see other examples of research services, check out the Research SDK on msdn.
My Subscriber Account Advertise Write. Training Home State of. Staffing Home Looking for Staff? Looking for Work? Contact Us. Dark Kimbie. Published in:. Filed under: Microsoft Office. Figure 1: The Research Library is available from the task pane.
Figure 2: The Research Library includes several built-in and online resources by default. Figure 3: Office provides a long list of choices for customizing the Research task pane's list of resources. Querying a Corporate Database: A Contacts Sample The steps you're about to walk through are needed to create a simple research service that allows the end user to search for contacts in a database.
Figure 4: The sample uses ADO. NET to open and query an Access table. Figure 5: You can search by first or last name. Figure 6: You can choose a country from a list generated by the research service.
Creating a Research Service in Visual Studio. NET Framework 1. NET Visual Studio. Figure 7: Use the ASP. NET Web service to build a research service.
The Search Namespace You can put the Registration and Query methods in the same Web service module or in two separate modules. Xml Imports System. NameTable nsmRequest. InnerText Once you know what the user is searching for, you can take appropriate actions in the rest of the code. With myXMLwriter. WriteStartElement "Providers". WriteStartElement "Provider".
WriteEndElement ' Provider. WriteEndElement ' Providers. WriteEndElement ' ProviderUpdate. Flush ioMemStream. NET A typical research service, like the Northwind Contacts sample, searches a database for the terms entered by the user.
MapPath ". If the query did return data, use the data reader's Read method to scan through it: If dr. HasRows Then While dr. Read With myXMLwriter. WriteStartElement "Heading". The Registration Web Method The Registration Web method is called when the end user chooses to install your research service. Figure 8: Visual Studio. Address Information The Registration response packet must provide information about where to find both the Query method and the Registration Web method itself so that the Research Library can periodically run the Registration Web method in case any updates have occurred.
Descriptive Information There are several values that don't strictly need to be changed for each research service, but should be changed to avoid confusing the end user. Provider node children that should be changed include: Message: The message the user sees when successfully adding the research service to the Research Library Name: The name that appears as the Provider name when you choose to update or remove services, and in the Service Properties dialog box Service node children that should be changed include: Name: The name that appears in the Research task pane's Research Library drop-down menu Description: The description that appears in the Service Properties dialog box Copyright: Copyright information shown in the Service Properties dialog box Most Registration Web methods require no more than those few changes to properly register your research service.
The Query Web Method The Query Web method is called whenever the end user chooses to search using your research service. The content you can provide in the result includes: Headings that can be expanded to show more information Simple text, optionally with bold, italic, or other font attributes Images Buttons to copy specified text to the clipboard or insert text to the Office document Hyperlinks to open the browser to a particular address Hyperlinks to send a new query with the query term specified by the hyperlink itself to the research service Form elements such as list boxes, check boxes, and radio groups to provide a richer interface specific to the research service The sample research service provides two types of responses.
Returning a Response Packet You can refer to Listing 4 to see the response packet returned by the sample research service for a query result. Installing Your Research Service Once you have written the Registration and Query Web methods for your research service, you can install it in Office Figure 9: Add research services with the Add Services dialog box.
Summary If your user community needs to do quick searches of corporate data without adding yet another full-fledged application to each desktop, the Research Library is just the tool you need. Services ' automatically added Imports System.
0コメント