Access Keys:
Skip to content (Access Key - 0)
My Area (Access Key - 2)


Toggle Sidebar
Your Rating: Results: PatheticBadOKGoodOutstanding! 1 rates
Labels:
intermediate intermediate Delete
metalib metalib Delete
browser browser Delete
search search Delete
providers providers Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Search provider browser plugins for MetaLib quicksets

Tags: , , , ,
Last Updated: Oct 30, 2009 01:12


  • Description

    Recent versions of Firefox and Internet Explorer have the facility for users to add "search providers" to the browser's search box.  This development allows users to add MetaLib quicksets as browser search providers, including "My Sets" they have assembled themselves using the features of MetaLib's My Space.


  • Author: Matthew Phillips
  • Additional author(s):
  • Institution:
    University of Dundee
  • Year: 2008


  • Skill required for using this code:
    Intermediate. 

State

Stable

Programming language

Perl and Javascript

Software requirements

This has been tested on MetaLib version 4.  The Perl DBI and DBD::Oracle modules must be installed: you will probably find they are already present.

Screen captures

Author(s) homepage

http://www.dundee.ac.uk/library/

Download

MetaLib:dun-search-providers.zip

This contains the two Perl CGI scripts to be installed, and the Javascript required to be added to the public MetaLib interface.

Working example

http://cross-search.dundee.ac.uk/

See the link to "Install search providers" at the bottom of the QuickSearch screen.

Using the following Ex Libris open interfaces

None: uses Perl DBI access to underlying Oracle tables.

Installation instructions

Transfer the attached files to your MetaLib server and place in the following locations:

  • search-plugin and sets-plugin should go in $http_root/cgi-bin
  • dun-quick-1-help and quick-1-tail are examples to be used later.  See below.

Make sure that search-plugin and sets-plugin are world readable and world executable:

chmod a+rx sets-plugin search-plugin

You may need to edit the first line of each script to point to your Perl interpreter. Do "which perl" to find location if required.

Customise the two scripts to suit your institution.

The sets-plugin script will want altering to change references to "CrossSearch" in the script (that's what we have renamed MetaLib to):

You will probably need to alter the code which looks up the list of QuickSets.  This depends on knowing the z122_bor_id, which in our case was PATRON3.  Find the following line and adjust as necessary:

Note that the patron ID must be padded out with spaces to exactly 12 characters long. To find the correct patron ID, use the following SQL:

s+ vir00
select Z312_REC_KEY from z312 where Z312_NAME='DUNDEE-ENG';
quit

(replace DUNDEE-ENG with the username used for your quickset configuration.).  Alternatively go to the list of users in the /M interface and find the quicksets user.  Click on Update and you will find the patron ID as the user_id parameter in the URL of the resulting page. 

The search-plugin script will need editing in the following section:

You will need to modify the URLs to point to your own MetaLib server (the template attribute of the Url tag) and to point to your own 16 x 16 pixel graphic to be displayed in the browser (the contents of the Image tag). You can now test the scripts by going to the following URL (modify this to reflect the address of your MetaLib server).

http://cross-search.dundee.ac.uk/cgi-bin/sets-plugin?server=http://cross-search.dundee.ac.uk/

You should see the list of your QuickSets. If not check the patron ID etc.

Next you need to decide where to provide the link to this screen in MetaLib.  We have placed it in the quick-1-tail section of the QuickSearch screen, along with some user help.  The screen is opened using Javascript.  This is unfortunately necessary because we need to capture the user's session ID so that we can look up their session and find their "My Sets".  The difficulty is capturing the session ID, so the code relies on the server plus session appearing in the simplifiedTop element of the page.

The code we use is supplied in the file dun-quick-1-help.  As you see, we have included that whole file in quick-1-tail, but you could write it into that file direct if you prefer.

The following is what a cut-down bare minimum version would look like.  Note that you will need to edit the URL to the CGI script.  I guess this could be generalised by obtaining the server host and port from the href attribute also.  Never mind... 

That's all.

Known issues

Does not support users with no Javascript.


Comments


Page Attachments

File NameCommentSizeNumber of Downloads
dun-search-providers.zip5 kB86

Added by Matthew Phillips on Oct 17, 2008 15:33, last edited by Conf Admin on Oct 30, 2009 01:12

Adaptavist Theme Builder Powered by Atlassian Confluence