To create and configure search-result actions for a given search-tab context:

1. Go to the Search Tabs page for the site and site level at which your search-result action will apply. See “Search-Tab Configuration and Inheritance” for details.

2. Click on the search tab to which you want to add the search-result action and select Configure Search Tab from its action menu. This opens the Search Tab Configuration page.

3. Under the Other Settings heading, select the Search Result Actions link. This brings you to the Search Result Actions page.

The Search Result Actions page lists the actions that apply to your selected search tab and site level; the list indicates which of these are inherited and/or customized. Use the controls here to configure which actions will be available at the current level and below and to configure each available action.
• Click on the Add Action button in the toolbar to create a new action.
• To configure an existing action defined at the current site level, click on one of the listed actions to open its action menu and select Edit Action.
• To customize an action inherited from a parent level (and break the inheritance so that settings at the parent level no longer affect the current level), click on one of the listed actions to open its action menu and select Overwrite Action.
• To delete an existing action created at the current site level, click on one of the listed actions to open its action menu and select Delete.
When you are editing, copying customizing or creating an action, you will be working on the Edit Search Result Action, Copy Search Result Action, Overwrite Search Result Action or Add Search Result Action page (respectively), each of which includes the same collection of settings.

Figure: Search-result action configuration settings

The following settings are available on the Add/Edit Search Results Actions page.

• Name and Description: enter an ID, name, and description of the action. This is how the users will identify the action in the result-action menu and also how they are identified on the Search Result Actions page.

• Action Group: Select the action group to which your action should belong. To add a new group, click on the New Group link.

• Action Icon: if you would like to include a small icon in the action menu, then enter a URL to a graphic file here. This is optional.

• Action URL: this is the most important setting—it controls what happens when a user selects the action. You can either enter a URL for a page that should process the action or call one of the javascript functions imported by the SharePoint Search Result Web Part. Either way, you will usually include one or more parameters as input to the target page or javascript function; to add a managed parameter value to the URL, select a property name from the Managed Properties drop-down list and click the Add parameter link. The property is then added to the Action URL field, where it is represented as a property name surrounded by curly brackets (e.g., “Author”). You can also type property names manually into the Action URL field using this same convention. See the table below for a list of javascript functions that are available for this setting.

• Required Conditions: Use this field to establish the conditions necessary for the current action to be shown. Use the Ontolica search syntax to build the query; each result that matches the resulting query will display the current action in its action menu. Often, your query will test to make sure each of managed properties required for the Action URL has a value for the current result. For example, “ItemGUID=*” will check to make sure that the managed property “ItemGUID” exists (this is a very typical condition).

• Target Audiences: Use this setting to limit the types of users that will see the current result action. Enter one or more audience names (separated by semicolons) to limit the audiences to which the current action will be shown. Leave this setting blank to show the action to all users. See also “Target Audiences in Ontolica” for details about this setting and its helper controls.

Table: Javascript functions imported by the SharePoint Search Result Web Part and available for use in the Action URL setting for result actions

Javascript function Description
OSR_ViewProperties() Navigates to the document library where the document lives. This method may therefore not be invoked on documents that are not living in a SharePoint document library.
OSR_EditInApplication() Opens the document for editing in the associated application. This javascript method essentially calls the same javascript as SharePoint does when documents are opened for editing in a document library. The method will therefore only work for file extensions with a registered application. Only Microsoft office formats are supported out-of-the-box. Custom applications can be registered in the DOCICON.XML file. Full path is: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\XML\DOCICON.XML
OSR_AddAlert() Creates a new alert for change to the selected search result item.
OSR_AddToMyLinks() Adds a single search result item to the user’s personal link collection on my site.
OSR_ViewDetails(filename) Navigates to the Ontolica details page that will show more details for a single result item. The relative URL of the details web part page must be specified as a parameter.
For example: OSR_ViewDetails(‘DefaultDetails.aspx’)

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment