In this tutorial we are going to look at how to add a Livelink instance as a Search Provider in both Internet Explorer 7 and Firefox 2 for a Livelink 95 SP1 instance, although the code should be easily adaptable to other versions of Livelink. Firstly we need to create the base XML which contains the configuration for the Search Provider. This XML file is in the OpenSearch format, the sample configuration file we will use will contain the following elements :
| XML Attribute | XML Attribute Value |
|---|---|
| ShortName | This is the name that appears on the list of Search Providers. |
| Description | This is a longer description of the Search Provider. |
| Url | This is the URL that will be called including the provided search term. |
| Image | This is the small image that will appear in the Search Providers dropdown in browsers, such as Firefox, that support them. |
| Developer | This is the name of the developer(s) who developed the configuration file. |
| Contact | This is the email address of the named developer(s) |
An example of the XML file is shown below :
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Web Search</ShortName>
<Description>Example.Com Search Engine</Description>
<Url type="text/html" template="http://example.com/?q={searchTerms}"/>
<Image width="16" height="16">http://example.com/example.png</Image>
<Developer>Example.Com Developers</Developer>
<Contact>developers@example.com</Contact>
</OpenSearchDescription>
| Livelink Parameter | Parameter Value |
|---|---|
| fullTextMode | allwords |
| func | search |
| lookfor1 | allwords |
| objAction | NewSearch |
| objType | 258 |
| scopeSelection | 2217|2000|Within%20Enterprise |
| search_type | newGUI |
| SearchBarSearch | true |
| SearchBarSearch_list | {'TRUE','TRUE'} |
| slice | 2217|2000|Within%20Enterprise |
| startAt | 1 |
| TypeOfSearch | newGUI |
| where1 | {searchTerms} |
There are a few parameters here that are worth a specific mention. Firstly the where1 parameter must be set to the value specified, {searchTerms}, as this is the placeholder that is replaced with what the user has entered into the search bar.The parameters scopeSelection and slice must be the same and they are formatted as per one of the following examples :
<slice to search>|<start node id>|Within <obj name>
<slice to search>
| Sample Value | Description |
|---|---|
| 2217|2000|Within%20Enterprise | From Here search of the Enterprise Slice (dataid 2217) at the Enterprise Workspace (dataid 2000). |
| 2217|7912|Within New Compound Document | From Here search of the Enterprise Slice (dataid 2217) within a Livelink Compound Document called New Compound Document (dataid 7912). |
| 2217 | Search of the Enterprise Slice (dataid 2217) only from anywhere in the system. |
Putting this all together we get a simple XML file similar to the one shown below :
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>My Local 95</ShortName>
<Description>Search my Local Livelink 95 instance</Description>
<Url type="text/html" template="http://localhost/Livelink95/livelink.exe?fullTextMode=allwords&func=search&lookfor1=allwords
&objAction=NewSearch&objType=258&scopeSelection=2217|2000|Within%20Enterprise&SearchBarSearch=true
&SearchBarSearch_list={'TRUE','TRUE'}&search_type=newGUI&slice=2217|2000|Within%20Enterprise&TypeOfSearch=newGUI
&where1={searchTerms}&startAt=1"/>
<Image width="16" height="16">http://localhost/Livelink95/local95.png</Image>
<Developer>Greg Griffiths</Developer>
<Contact>livelink@greggriffiths.org</Contact>
</OpenSearchDescription>
<html>
<head>
<title>Add Search Engine</title>
</head>
<body>
<a href="#" onclick="javascript:window.external.AddSearchProvider('http://localhost/addengine/local95.xml');">add the engine</a>
</body>
</html>
Using the above we can now perform searches of any specified Livelink server, including those such as Knowledge Centre, for which David Templeton, the OpenText search guru has provided the this link to add the KC as a Search Provider.
This article contains information from the IE 7 Blog as well as input from the OpenText search guru, David Templeton.