Adding UCM as a search source in Windows Explorer
- by kyle.hatlestad
A customer recently pointed out to me that Windows 7 supports federated search within Windows Explorer. This means you can perform searches to external sources such as Google, Flickr, YouTube, etc right from within Explorer.
While we do have the Desktop Integration Suite which offers searching within Explorer, I thought it would be interesting to look into this method which would not require any client software to implement.
Basically, federated searching hooks up in Windows Explorer through the OpenSearch protocol. A Search Connector Descriptor file is run and it installs the search provider. The file is a .osdx file which is an OpenSearch Description document. It describes the search provider you are hooking up to along with the URL for the query. If those results can come back as an RSS or ATOM feed, then you're all set.
So the first step is to install the RSS Feeds component from the UCM Samples page on OTN. If you're on 11g, I've found the RSS Feeds works just fine on that version too.
Next, you want to perform a Quick Search with a particular search term and then copy the RSS link address for that search result.
Here is what an example URL might looks like:
http://server:16200/cs/idcplg?IdcService=GET_SCS_FEED&feedName=search_results&QueryText=%28+%3cqsch%3eoracle%3c%2fqsch
%3e+%29&SortField=dInDate&SortOrder=Desc&ResultCount=20&SearchQueryFormat=
Universal&SearchProviders=server&
Now you want to create a new text file and start out with this information:
<?xml version="1.0" encoding="UTF-8"?><OpenSearchDescription xmlns:ms-ose="http://schemas.microsoft.com/opensearchext/2009/">
<ShortName></ShortName>
<Description></Description>
<Url type="application/rss+xml" template=""/>
<Url type="text/html" template=""/>
</OpenSearchDescription>
Enter a ShortName and Description. The ShortName will be the value used when displaying the search provider in Explorer.
In the template attribute for the first Url element, enter the URL copied previously. You will then need to convert the ampersand symbols to '&' to make them XML compliant. Finally, you'll want to switch out the search term with '{searchTerms}'.
For the second Url element, you can do the same thing except you want to copy the UCM search results URL from the page of results. That URL will look something like:
http://server:16200/cs/idcplg?IdcService=GET_SEARCH_RESULTS&SortField=dInDate&SortOrder=Desc&ResultCount=20&QueryText=%3Cqsch%3Eoracle%3C%2Fqsch%3E&listTemplateId=
&ftx=1&SearchQueryFormat=Universal&TargetedQuickSearchSelection=
&MiniSearchText=oracle
Again, convert the ampersand symbols and replace the search term with '{searchTerms}'.
When complete, save the file with the .osdx extension. The completed file should look like:
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:ms-ose="http://schemas.microsoft.com/opensearchext/2009/">
<ShortName>Universal Content Management</ShortName>
<Description>OpenSearch for UCM via Windows 7 Search Federation.</Description>
<Url type="application/rss+xml" template="http://server:16200/cs/idcplg?IdcService=GET_SCS_FEED&feedName=search_results&QueryText=%28+%3Cqsch%3E{searchTerms}%3C%2fqsch%3E+%29&SortField=dInDate&SortOrder=Desc&ResultCount=200&SearchQueryFormat=Universal"/>
<Url type="text/html" template="http://server:16200/cs/idcplg?IdcService=GET_SEARCH_RESULTS&SortField=dInDate&SortOrder=Desc&ResultCount=20&QueryText=%3Cqsch%3E{searchTerms}%3C%2Fqsch%3E&listTemplateId=&ftx=1&SearchQueryFormat=Universal&TargetedQuickSearchSelection=&MiniSearchText={searchTerms}"/>
</OpenSearchDescription>
After you save the file, simply double-click it to create the provider. It will ask if you want to add the search connector to Windows.
Click Add and it will add it to the Searches folder in your user folder as well as your Favorites. Now just click on the search icon and in the upper right search box, enter your term. As you are typing, it begins executing searches and the results will come back in Explorer.
Now when you double-click on an item, it will try and download the web viewable for viewing.
You also have the ability to save the search, just as you would in UCM. And there is a link to Search On Website which will launch your browser and go directly to the search results page there.
And with some tweaks to the RSS component, you can make the results a bit more interesting. It supports the Media RSS standard, so you can pass along the thumbnail of the documents in the results.
To enable this, edit the rss_resources.htm file in the RSS Feeds component. In the std_rss_feed_begin resource include, add the namespace 'xmlns:media="http://search.yahoo.com/mrss/' to the rss definition:
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:media="http://search.yahoo.com/mrss/">
Next, in the rss_channel_item_with_thumb include, below the closing image element, add this element:
</images>
<media:thumbnail url="<$if strIndexOf(thumbnailUrl, "@t") > 0 or strIndexOf(thumbnailUrl, "@g") > 0 or strIndexOf(thumbnailUrl, "@p") > 0$><$rssHttpHost$><$thumbnailUrl$><$elseif dGif$><$HttpWebRoot$>images/docgifs/<$dGif$><$endif$>" />
<description>
This and lots of other tweaks can be done to the RSS component to help extend it for optimum use in Explorer. Hopefully this can get you started.
*Note: This post also applies to Universal Records Management (URM).