Page tree

RDA Registry Widget is a jQuery plugin that provides the ability to lookup, search and display records from the RDA Registry API

Some use cases for the Registry Object Search Widget include:

  • Showcase recent collections contributed to Research Data Australia by institution or researcher name
  • Implement a lookup function in data captures forms/processes to search for keys or global identifiers
  • Supplement your site’s search results with search results from Research Data Australia
  • Provide your users with a listing of data collections related to a specific subject

Usage

To install the widget use bower to install ands-registry-widget

bower install ands-registry-widget

Alternatively, download the directory from GitHub

Include jQuery dependency

<script src="node_modules/jquery/dist/jquery.min.js"></script>

 

Include the provided distribution file

<script src="dist/jquery.ands.registry-widget.min.js"></script>

Instantiate the plugin with

$("#registry_widget").registryWidget({
    // options
});

ANDS Registry Widget comes with out of the box support for Twitter Bootstrap styling and Mustache templating engine. Include them to get the same functionality as the available demo page

<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap-theme.min.css">
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="bower_components/mustache.js/mustache.min.js"></script>

 

Configuration

Available parameters

  • apiKey : The API Key that this widget will use to access the ANDS Registry API
  • mode : lookup-activity|search-activity|display-activity Available modes are currently restricted to these
  • searchOptions: Search Options, for configuring how the Search functionality display and functions
    • autoSearchtrue|false
    • autoLookuptrue|false
    • returnTypepurl|title|id
    • facetsinstitutions|funders|type|fundingScheme|status
    • facetSortindex|count : Determine the sorting order of the facets
    • openInbootstrap-modal : Enable custom search displayer. Default to nothing. (appear underneath)
    • params: Search parameters, overwrite the default ones. For a list of available parameters. Have a look at the Activites API
      • funder: Default funder
      • limit : Number of rows return
      • pp : Per Page
      • q: General Search
      • subject
      • fundingScheme
      • identifier
      • ...
    • searchQueryOptions : Search query options for free text search. For more information, refer to the searchQueryOptions section

searchQueryOptions

Primarily in a list of specified fields to search for. By default, it's set to

[
    { value: "q", display: "All" },
    { value: "title", display: "Title" },
    { value: "description", display: "Description" },
    { value: "researcher", display: "Researcher" },
    { value: "principalInvestigator", display: "Principal Investigator" },
    { value: "id", display: "Identifier" },
    { value: "subject", display: "Subject" }
]

 

Search Parameters can also be embed into the target via HTML data attribute. For example

<div id="display-activity" data-purl="http://purl.org/au-research/activitys/arc/DP140100435"></div>
$('#display-activity').registryWidget({
    api_key: "public",
    mode: "display-activity"
});

 

Development

Install the dependencies

npm install
bower install

Running tests

grunt karma