Page tree
Contents

The RDA Registry Search Widget provides a quick and easy way of embedding a live Research Data Australia (RDA) search or record display within your new or existing web pages.

The flexibility of the widget allows you to configure a predefined search, or provide your end users with a text field to specify their own search.

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 capture 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

How to use this widget

Before you start!

While optional, ARDC recommends that you register for a free API key to be used with this widget. Registering will allow us to keep you informed of changes and planned outages to our services, as well as monitor the system for quality purposes.

Note that if you have previously registered for an API key you do not need to register again. Your ANDS API key is reusable with any of our widgets and services.


The widget requires jQuery; load this, and the plugin itself (and associated CSS styles) in your document’s <head></head> segment:

<script src='//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.js'></script>
<script type="text/javascript" src="//researchdata.ands.org.au/apps/assets/registry_widget/js/registry_widget_v2.js"></script>
<link rel="stylesheet" type="text/css" href="//researchdata.ands.org.au/apps/assets/registry_widget/css/registry_widget_v2.css" />

See Configuration section below for details on how to configure the widget on your web page.

Demo

Search Result Display Example

Embed the results of a simple search into your website, such as a panel on your institution’s own search page to supplement it with collections which are available in Research Data Australia.

In this example, the top 5 records matching the search term “fish” are listed

JSFiddle


Custom Search Result Display Example

Embed the results of a more complex search into your website, such as a panel on your institution's profile page which lists the collections recently contributed to Research Data Australia.

This result example displays the 5 most recent collections contributed by Australian Ocean Data Network

JSFiddle

 

Simple Search Example

Embed the ability to search for research data on your own web page in less than 5 lines of code!

This search example will search for records in Research Data Australia matching your search term.

JSFiddle


Advanced Search Example

Embed the ability to search and display information about research data on your own web page with a customised display.

This search example will search for records and then display them according to a template (see the JS tab).

JSFiddle


Configuration

The widget can be initialised by two methods:

  • Simple Mode: add the class="registry_widget" to a <div> or <input> element as illustrated in the examples above. You can also add a data-query and data-modeattribute to customise the behaviour in Simple Mode.
  • Custom Mode: initialise the registry_widget from javascript (jQuery) by calling$('#id_of_your_container_element').registry_widget();. You can pass any of the below properties to theregistry_widget() function to customise its behaviour.
PropertyDescriptionDefault
proxyJSONP proxy for the Registry Widget which resolves search queries against the ANDS Collections Registry APIshttp://researchdata.ands.org.au/api/v2.0/registry.jsonp/
api_keyYour pre registered api key which will uniquely identify the widget userpublic
modemode can be search,display_single, display_resultsearch
searchEnable Search Functionalitytrue
auto_searchAuto Search based on the target’s valuefalse
search_btn_textSearch text displays on the buttonSearch
search_btn_classCSS Classes apply on the search buttonrowidget_search btn btn-small btn-default
search_callbackOverwrite function for search result function(data, obj, settings)false
lookupEnable Resolve/Lookup functionality. This functionality enables the user to identify a registry object based on their id, key or slugtrue
auto_lookupEnable Auto lookup based on the target’s valuefalse
lookup_btn_textLookup text displays on the buttonResolve
lookup_btn_classCSS Classes apply on the lookup buttonrowidget_lookup btn btn-small btn-default
lookup_callbackOverwrite function for lookup result function(data, obj, settings)false
result_templateMustache/Handlebar-like template for the search result list<ul class="rowidget_results">{{#docs}}<li><a href="javascript:;" data-key="{{key}}" data-slug="{{slug}}" data-id="{{id}}">{{list_title}}</a></li>{{/docs}}</ul>
single_templateMustache/Handlebar-like template for the single display of a registry object<div class="rowidget_single"><h4><a href="{{rda_link}}" target="_blank">{{title}}</a></h4><span class="text-muted">{{group}}</span><div class="description">{{description}}</div></div>
return_typeReturn a key, slug, title or id to the target valuekey