Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagexml
themeEclipse
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.js"></script>
<script type="text/javascript" src="//vocabs.andsardc.orgedu.au/apps/assets/vocab_widget/js/vocab_widget_v2.js"></script>
<link rel="stylesheet" type="text/css" href="//vocabs.andsardc.orgedu.au/apps/assets/vocab_widget/css/vocab_widget_v2.css" />

...

Code Block
languagexml
themeEclipse
<script type="text/javascript" src="//vocabs.andsardc.orgedu.au/assets/core/lib/qtip2/jquery.qtip.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/qtip2/2.2.1/basic/jquery.qtip.min.css" media="screen" />
Note

The code generated for tree mode by the Widget Explorer requires qTip2. When incorporating the results of the Widget Explorer, make sure to include the content from both of the code blocks given above.

...

Add widget input and initialisation code into your HTML document’s <body>...</body> section. The input/initialisation code selects the vocabulary, input mode, and other parameters. Write the code yourself, based on the instructions in the following sections, or use the Widget Explorer to generate it for you.

Note

You can combine the two approaches: use the Widget Explorer to generate boilerplate input/initialisation code, then customise it to suit your needs.

...

PropertyDefaultsDescription
api_key"public"

The API key you have previously been issued.

Please request an API key by emailing services@andsservices@ardc.orgedu.au.

mode""

Status
colourYellow
titleREQUIRED
Vocab widget mode:

  • "tree": provides a hierarchical display based on broader/narrower relations
  • "search": provides an autocomplete widget on an HTML input element
  • "narrow": populates an HTML select element with appropriate data based on narrower relations.
  • "collection": populates an HTML select element with data from a collection.
  • "advanced" or "core": exposes the core widget with no UI helpers.
repository""

Status
colourYellow
titleREQUIRED
The SISSVoc repository to query. This can be specified either as:

  • a base repository name, e.g., "anzsrc-for""rifcs"
  • a URL that is the prefix of the SISSVoc endpoints for the vocabulary, e.g., "http://vocabs.andsardc.orgedu.au/repository/api/lda/↵
    aodn/aodn-discovery-parameter-vocabulary/version-1-2"
max_results100At most, how many results should be returned? Note: the vocabulary's SISSVoc configuration may override this option by applying a lower (but not a higher) maximum limit. At present, the SISSVoc configuration of most vocabularies specifies a maximum limit of 200 results.
cachetrueCache SISSVoc responses?
error_msg"ANDS Vocabulary Widget ↵
service error."
Message title to display (via a JavaScript alert() call) when an error is encountered. Set to false to suppress such messages
endpoint"https://vocabs.andsardc.orgedu.au/
api/v1.0/vocab.jsonp/"
Location (absolute URL) of the "back end" of the widget (an interface to SISSVoc that generates responses in JSONP).

...

  • status: OK if all good, something else (most likely ERROR) if not
  • message: description of the underlying system call by default, or information on status when something went wrong
  • limit: the maximum number of records requested
  • items: an array of SISSVoc vocabulary items:
    • definition: item description
    • label: item label
    • about: item definition / URL
    • broader: parent term (if it exists)
    • narrower: child terms (if they exist, otherwise boolean false)
    • count: frequency of use among ARDC registry objects (experimental; requires endpoint to be set to "http://researchdata.ands.orgedu.au/apps/vocab_widget/proxy/"; works best on ANZSRC-FOR, not so well on RIF-CS)
  • count: the number of items returned