Class: LookupModel

LookupModel()

A utility model that contains functions for looking up values from various services

Constructor

new LookupModel()

Source:

Extends

  • Backbone.Model

Methods

findGrants(term, offsetopt) → {Promise}

Search the NSF Award Search API for grants that match the given term.
Parameters:
Name Type Attributes Default Description
term string The term to search for
offset number <optional>
1 The offset to use in the search. Defaults to 1.
Since:
  • 2.28.0
Source:
Returns:
A promise that resolves to an array of awards in the format {id: string, title: string}
Type
Promise

formatFundingForAutocomplete(awards) → {Array}

Format awards from the NSF Award Search API for use in the jQuery UI autocomplete widget.
Parameters:
Name Type Description
awards Array An array of awards in the format {id: string, title: string}
Since:
  • 2.28.0
Source:
Returns:
An array of awards in the format {value: string, label: string}
Type
Array

getGrantAutocomplete(request, response)

Using the NSF Award Search API, get a list of grants that match the given term, as long as the term is at least 3 characters long and doesn't consist of only digits. Used to populate the autocomplete list for the Funding fields in the metadata editor. For this method to work, there must be a grantsUrl set in the MetacatUI.appModel.
Parameters:
Name Type Description
request jQuery The jQuery UI autocomplete request object
response function The jQuery UI autocomplete response function
Source:
See:

getSizeOfIndexQueue(onSuccessopt, onErroropt)

Calls the monitor/status DataONE MN API and gets the size of the index queue.
Parameters:
Name Type Attributes Description
onSuccess function <optional>
onError function <optional>
Source: