OpenSearch plug-in for Enlighten

We have created an OpenSearch plug-in for Enlighten for a simple search (ordered by title). This can be added to the search box of Internet Explorer 7.x and Firefox 2.x and above using the “Add Enlighten Search” button on the home page or from the browser search box from any page in the repository.

Enlighten in the Firefox Search Bar

Enlighten in the Firefox Search Bar

Search plug-in code

The plug-in code can be easily modified for any EPrints repository:

<OpenSearchDescription>
<ShortName>Enlighten</ShortName>
<Description>
Search Enlighten for research publications by members of the University of Glasgow
</Description>
<Image height="16" width="16" type="image/x-icon">http://www.gla.ac.uk/favicon.ico</Image&gt;
<InputEncoding>UTF-8</InputEncoding>
<OutputEncoding>UTF-8</OutputEncoding>
<Url type="text/html" template="http://eprints.gla.ac.uk/cgi/search/simple/?q={searchTerms}&order=title/creators_name/-date"/>
<Developer>William J Nixon</Developer>
<Attribution>University of Glasgow Library</Attribution>
<Contact>w.j.nixon@lib.gla.ac.uk</Contact>
</OpenSearchDescription>

This code was saved as glasgow-enlighten-service.xml and saved to our webservices/plugins/ directory on our Library website where we have other plug-ins for our Library catalogue and our Theses service. There’s no reason for it not to be saved into a directory in ePrints itself.

Discovery

Discovery code has been added to the <HEAD> tags of the template default.xml file in the cfg.d directory:

<link href="http://www.lib.gla.ac.uk/webservices/plugins/glasgow-enlighten-service.xml" rel="search" type="application/opensearchdescription+xml" title="Enlighten" />

This points to the location of the XML file and provides the title description which will be used by the browser.

With this code applied, users will see a glow around the search bar which indicates a plug-in is available and provides the option to add it.

Firefox Search bar with glow indicating a search plug-in is available

Firefox Search bar with glow indicating a search plug-in is available

We have also added an “Add Enlighten Search” button to Enlighten’s home page using the default ep_form_action_button class with the code:

<input class="ep_form_action_button" value="Add Enlighten Search" type="submit" name="_add_search" onclick="window.external.AddSearchProvider('http://www.lib.gla.ac.uk/webservices/plugins/glasgow-enlighten-service.xml');">

Add Enlighten Search

Add Enlighten Search Button

This simple plug-in provides us with the opportunity to enable users to search for content without having to come to Enlighten first, or to re-use a search they have already done in the browser search bar for Enlighten.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s