Members
appConfigPath :string
The path to your configuration file for MetacatUI. This can be any web-accessible location.
This variable must be defined in index.html.
Type:
- Since:
- Source:
model
- Source:
taxonomicClassification :Object
Type:
Properties:
Name |
Type |
Description |
taxonRankName |
string
|
The name of the taxonomic rank, for
example, Domain, Kingdom, etc. |
taxonRankValue |
string
|
The value for the given taxonomic rank,
for example, Animalia, Chordata, etc. |
commonName |
Array.<string>
|
Common name(s) for the taxon, for example
["Animal"] |
taxonId |
Array.<Object>
|
A taxon identifier from a controlled
vocabulary, for example, ITIS, NCBI, etc.
Properties
Name |
Type |
Description |
provider |
string
|
The provider of the taxon identifier,
given as a URI, for example http://www.itis.gov |
value |
string
|
The identifier from the provider, for
example, 180092 |
|
taxonomicClassification |
Array.<Object>
|
A nested taxonomic
classification, since taxonomy is represented as a hierarchy in EML. |
- Source:
Methods
addClassesFromResponse(response, ontologyopt) → {Promise.<void>}
Add classes from a response to the collection. This method is async and
will return a promise that resolves when the collection has been updated.
Parameters:
Name |
Type |
Attributes |
Description |
response |
object
|
|
The response from the BioPortal API |
ontology |
string
|
object
|
<optional>
|
Provide to include the ontology acronym
to store as an attribute on the class models |
- Source:
Returns:
A promise that resolves when the collection has
been updated
-
Type
-
Promise.<void>
addFields(fieldsJSON) → {Array.<object>}
Adds fields to the fieldsJSON array that are specified in the addFields
property of this model
Parameters:
Name |
Type |
Description |
fieldsJSON |
Array.<object>
|
JSON returned from QueryFields.toJSON() |
- Source:
Returns:
The fieldsJSON array with additional fields added
-
Type
-
Array.<object>
addSelected(value, options)
Add a selected value and ensures it's not already in the list. If this is
not a multi-select dropdown, the selected value will replace any existing
value.
Parameters:
Name |
Type |
Description |
value |
string
|
The value to add to the selected list. |
options |
object
|
Additional options to be passed to the set
method. |
- Source:
buildChildrenUrl(ontology, subTree) → {string}
Build the URL component for a "children" query
Parameters:
Name |
Type |
Description |
ontology |
string
|
The ontology to query, encoded |
subTree |
string
|
The subTree to query, encoded |
- Source:
Returns:
The URL component for the query
-
Type
-
string
buildSearchUrl(searchTerm, ontology, subTree) → {string}
Build the URL component for a "search" query
Parameters:
Name |
Type |
Description |
searchTerm |
string
|
The search term, encoded |
ontology |
string
|
The ontology to query, encoded |
subTree |
string
|
The subTree to query, encoded |
- Source:
Returns:
The URL component
-
Type
-
string
canChangeSeparator() → {boolean}
Checks if it's possible to update the separator that is used between
selected values. For this to be possible, there must be more than one
separator option available.
- Source:
Returns:
- Returns true if the separator can be changed, false
otherwise.
-
Type
-
boolean
Set a listener to change the current submenu style to "list" when a
search term is present, and revert to the original style when the search
term is removed. This is to ensure that the dropdown displays the list
style with only the search results when a user is searching. This is only
necessary if the submenu style is not already set to "list".
- Source:
couldBeLatLong(value) → {boolean}
Determine whether the user could be typing a lat, long pair.
Parameters:
Name |
Type |
Description |
value |
string
|
is the currently entered query string. |
- Source:
Returns:
Whether the current value could be a lat,long pair
due to the string NOT containing characters (e.g. a-z) that could not
be in a lat,long pair.
-
Type
-
boolean
createBatchPayload(classes, ontology) → {string}
Create a payload for a batch request to the BioPortal API.
Parameters:
Name |
Type |
Description |
classes |
Array.<string>
|
The classes to fetch |
ontology |
string
|
object
|
The ontology acronym or object with
acronym stored in the "ontology" property |
- Source:
Returns:
The JSON stringified payload
-
Type
-
string
Create the headers for a request to the BioPortal API.
Properties:
Name |
Type |
Description |
Content-Type |
string
|
The content type of the request |
Authorization |
string
|
The authorization header with the API
key |
- Source:
Returns:
The headers object
-
Type
-
object
defaults() → {object}
The default attributes for this model. All attributes not documented here
are detailed on the BioPortal API docs:
https://data.bioontology.org/documentation.
Properties:
Name |
Type |
Description |
queryType |
"children"
|
"search"
|
"ontology"
|
The type of query
to perform. Only "children", "search", and "ontology" are supported. |
searchTerm |
string
|
The term to search for. Only used when
queryType is "search". |
collection |
BioontologyResults
|
The collection classes
returned from the query. |
subTree |
string
|
The class ID to get the children of. Only
used when queryType is "children". e.g.
http://ecoinformatics.org/oboe/oboe.1.2/oboe-core.owl#MeasurementType |
ontology |
string
|
The ontology acronym to query. e.g. "ECSO" |
- Source:
Returns:
The default attributes for this model
-
Type
-
object
defaults() → {object}
The default attributes for this model. All attributes not documented here
are detailed on the BioPortal API docs:
https://data.bioontology.org/documentation.
Properties:
Name |
Type |
Description |
collection |
Backbone.Collection
|
The collection of classes
fetched from BioPortal |
apiKey |
string
|
The API key to use for requests to BioPortal.
If not set, the appModel's API key will be used. |
apiBaseURL |
string
|
The base URL for the BioPortal API. |
ontologyPrefix |
string
|
A string to prepend to ontology
acronyms to form the full ontology ID for batch requests. Note that this
is not the same as the ontology URL, as the ID starts with http not
https. |
ontologies |
Array.<string>
|
The ontologies to search for classes
in, in order of priority. Only the acronyms are needed. |
include |
Array.<string>
|
The fields to include in the response. |
classesToFetch |
Array.<string>
|
The classes (classIds) to fetch
from BioPortal. |
- Source:
Returns:
The default attributes for this model
-
Type
-
object
defaults() → {object}
The default attributes for the OntologyClassModel. See also:
https://data.bioontology.org/documentation.
Properties:
Name |
Type |
Description |
id |
string
|
The unique identifier for the ontology class. |
prefLabel |
string
|
The preferred label for the ontology class. |
definition |
Array.<string>
|
Definitions of the ontology class. |
synonym |
Array.<string>
|
Synonyms of the ontology class. |
obsolete |
boolean
|
Indicates if the class is obsolete. |
subClassOf |
Array.<string>
|
An array of identifiers for parent classes in the ontology. |
parents |
Array.<object>
|
Detailed parent class information including identifiers and links. |
cui |
Array.<string>
|
Concept Unique Identifiers associated with the class. |
semanticType |
Array.<stringp>
|
Semantic types associated with the class. |
label |
string
|
Label of the class (may be empty). |
prefixIRI |
string
|
Prefix IRI if available. |
notation |
string
|
Notation number associated with the class. |
xref |
string
|
External reference identifiers. |
created |
string
|
Creation date of the class entry. |
modified |
string
|
Last modification date of the class entry. |
properties |
object
|
Additional properties specific to the ontology class. |
'@id' |
string
|
The unique identifier for the ontology class. |
'@type' |
string
|
The type of the entity in RDF/OWL. |
links |
object
|
A collection of links related to the ontology class for API interaction. |
'@context' |
object
|
Context for understanding the property values and relations. |
ancestors |
Array
|
An array of ancestor classes of the ontology class. |
children |
Array
|
An array of child classes of the ontology class. |
notes |
Array
|
Additional notes associated with the ontology class. |
childrenCount |
number
|
The number of children of the ontology class. |
hasChildren |
boolean
|
Boolean indicating whether the ontology class has children. |
- Source:
Returns:
The default attributes for this model
-
Type
-
object
defaults() → {object}
The default attributes for the BioOntology model. For definitions,
see https://data.bioontology.org/documentation
- Source:
Returns:
The default attributes
-
Type
-
object
defaults()
- Source:
defaults() → {object}
Properties:
Name |
Type |
Description |
addFields |
Array.<AdditionalField>
|
A list of additional fields
which are not retrieved from the query service index, but which should be
added to the list of options. This can be used to add abstracted fields
which are a combination of multiple query fields, or to add a duplicate
field that has a different label. |
commonFields |
Array.<string>
|
A list of query fields names to
display at the top of the menu, above all other category headers |
categoriesToAlphabetize |
Array.<string>
|
The names of categories
that should have items sorted alphabetically. Names must exactly match
those in the Query Field model |
excludeNonSearchable |
boolean
|
Whether or not to exclude
fields which are not searchable. Set to false to keep query fields that
are not searchable in the returned list |
submenuStyle |
string
|
The submenu style is set to "accordion"
by default for this submodel |
excludeFields |
Array.<string>
|
A list of query field names to
exclude from the list of options. |
- Source:
Returns:
The default attributes for this model
-
Type
-
object
defaults() → {object}
Properties:
Name |
Type |
Description |
allowMulti |
boolean
|
Whether to allow users to select more
than one value. |
allowAdditions |
boolean
|
Allows users to add their own
options not listed in options. |
clearable |
boolean
|
Whether the dropdown can be cleared by
the user after selection. |
submenuStyle |
string
|
Determines the display style of items
in categories ("list", "popout", "accordion"). |
hideEmptyCategoriesOnSearch |
boolean
|
Displays category
headers in the dropdown even with no results. |
options |
SearchSelectOptions
|
Collection of
SearchSelectOption models that represent choices a user can select from. |
selected |
Array.<string>
|
Currently selected values in the
dropdown. |
separatorOptions |
Array.<string>
|
boolean
|
For select inputs where
multiple values are allowed (allowMulti is true), a list of options that
can be used as separators between values. To turn off this feature, set
to false or an empty array. |
separator |
string
|
The current separator to use between
selected values, must be one of the separatorOptions. |
searchTerm |
string
|
The current search term being used to
filter options, if any. This will be updated by the view. |
originalSubmenuStyle |
string
|
A reference to the original
submenu style since the submenu style can change during search. This will
be set automatically by the model during initialization. |
apiSettings |
object
|
boolean
|
Settings for retrieving data via
API, false if not using remote content. |
placeholderText |
string
|
Text to show in the input field before
any value has been entered. |
inputLabel |
string
|
Label for the input element. |
buttonStyle |
boolean
|
Set this to true to render the dropdown
as more of a button-like interface. This works best for single-select
dropdowns. |
icon |
string
|
boolean
|
Set this to a FontAwesome icon to use
instead of the default dropdown (down arrow) icon. Works will with the
buttonStyle option. |
fluid |
boolean
|
Set this to true to make the dropdown take up
the full width of its container. |
compact |
boolean
|
Set this to true to make the dropdown more
compact, e.g. for the filter bar in the catalog search. |
- Source:
- See:
-
Returns:
Default attributes for a SearchSelect model.
-
Type
-
object
defaults() → {object}
Properties:
Name |
Type |
Description |
icon |
string
|
The name of a Font Awesome 3.2.1 icon to display to
the left of the label (e.g. "lemon", "heart") |
image |
string
|
The complete path to an image to use instead of an
icon. If both icon and image are provided, the icon will be used. |
label |
string
|
The label to show for the option |
description |
string
|
A description of the option, displayed as a
tooltip when the user hovers over the label |
value |
string
|
If the value differs from the label, the value to
return when this option is selected (otherwise label is returned) |
category |
string
|
If the option is part of a category, the name of
the category to display in the dropdown |
- Source:
Returns:
The default properties for a SearchSelectOption
-
Type
-
object
defaults()
- Source:
encodeIfPresent(value) → {string}
Encode a value if it is exists
Parameters:
Name |
Type |
Description |
value |
string
|
The value to encode |
- Source:
Returns:
The encoded value or null if the value is falsy
-
Type
-
string
excludeFields(fieldsJSON) → {Array.<object>}
Filters out any objects in the fieldsJSON array that have a ".name"
property that matches one of the strings in the fieldsToExclude array
Parameters:
Name |
Type |
Description |
fieldsJSON |
Array.<object>
|
JSON returned from QueryFields.toJSON() |
- Source:
Returns:
The filtered fieldsJSON array
-
Type
-
Array.<object>
fetchClasses(classes) → {Promise.<Array.<Backbone.Model>>}
Fetch classes from the BioPortal API. This method is async and will
return a promise that resolves when the classes have been fetched.
Parameters:
Name |
Type |
Description |
classes |
Array.<string>
|
The classes to fetch |
- Source:
Returns:
A promise that resolves to an array
of Backbone models
-
Type
-
Promise.<Array.<Backbone.Model>>
fetchClassesFromOntology(classes, ontology) → {Promise.<object>}
Make a batch request for a given set of classes and a single ontology.
Parameters:
Name |
Type |
Description |
classes |
Array.<string>
|
The classes to fetch |
ontology |
string
|
The ontology to search in |
- Source:
Returns:
A promise that resolves to the response from
the BioPortal API
-
Type
-
Promise.<object>
fetchFromOntologies() → {Promise.<Array.<object>>}
Fetch classes from the BioPortal API. This method is async and will
return a promise that resolves when the classes have been fetched.
- Source:
Returns:
A promise that resolves to an array of
objects containing the classes fetched from BioPortal
-
Type
-
Promise.<Array.<object>>
fetchQueryFields() → {Promise}
Fetches the query fields from the query service
- Source:
Returns:
A promise that resolves with the query fields
collection
-
Type
-
Promise
fieldToOption(field) → {object}
Converts an object that represents a QueryField model to the format
specified by the SearchSelectView.options
Parameters:
Name |
Type |
Description |
field |
object
|
An object with properties corresponding to a
QueryField model |
- Source:
Returns:
An object with properties that match the format
specified by the SearchSelectView.options
-
Type
-
object
filterClassesToFetch()
If some of the classes to fetch are already in the collection, remove
them from the list of classes to fetch.
- Source:
finalizeFetch()
Finalize the fetch process. This will set the status to "fetched" and
trigger the "fetchComplete" event.
- Source:
Formats a single result from the account lookup service
Parameters:
Name |
Type |
Description |
rawResult |
object
|
The result from the account lookup service |
forTemplate |
boolean
|
See formatResults |
- Source:
Returns:
- The formatted result
-
Type
-
object
Formats the results from the account lookup service for the dropdown
Parameters:
Name |
Type |
Description |
results |
Array.<object>
|
The results from the account lookup service |
forTemplate |
boolean
|
Whether to format the results for the
template in the SearchSelect view or directly for Formantic-UI |
- Source:
Returns:
- The formatted results
-
Type
-
Array.<object>
getAccountDetails(searchTerm) → {Promise.<Array.<object>>}
Promisify the getAccountsAutocomplete function from the LookupModel
Parameters:
Name |
Type |
Description |
searchTerm |
string
|
The account ID, name, or partial name to search for |
- Source:
Returns:
- A promise that resolves with the results
-
Type
-
Promise.<Array.<object>>
getCachedClasses(classes) → {Array.<Backbone.Model>}
Get the models for classes that have already been fetched from BioPortal.
Parameters:
Name |
Type |
Description |
classes |
Array.<string>
|
The class IDs to get models for |
- Source:
Returns:
The models for the classes that have already
been fetched
-
Type
-
Array.<Backbone.Model>
getCategoryNames() → {Array.<string>}
- Source:
Returns:
An array of unique category names.
-
Type
-
Array.<string>
getChildren(classId)
Get the children of a given class ID and add them to the collection
Parameters:
Name |
Type |
Description |
classId |
string
|
The class ID to get the children of |
- Source:
getClasses(classes) → {Promise.<Array.<Backbone.Model>>}
Gets the models for given classes. For classes that exist already, the
model will be fetched from the collection. For classes that do not exist
yet, the bioportal API will be queried. The promise will resolve when all
models have been fetched.
Parameters:
Name |
Type |
Description |
classes |
Array.<string>
|
The classes to fetch |
- Source:
Returns:
A promise that resolves to an array
of Backbone models
-
Type
-
Promise.<Array.<Backbone.Model>>
getIncludeParam(queryType) → {string}
Construct the include url parameter for the BioPortal API
Parameters:
Name |
Type |
Description |
queryType |
string
|
The type of query to perform |
- Source:
Returns:
The include parameter for the BioPortal API
-
Type
-
string
getNextPage()
Fetch the next page of results from the BioPortal API and add them to the
collection
- Source:
getNextSeparator() → {string|null}
Get the next separator in the list of separator options.
- Source:
Returns:
- The next separator in the list of separator
options, or null if none.
-
Type
-
string
|
null
getOptionByLabelOrValue(value) → {SearchSelectOption}
Get an option by its label or value.
Parameters:
Name |
Type |
Description |
value |
string
|
The value or label of the option to get. |
- Source:
Returns:
The first option that has a matching value
or label.
-
Type
-
SearchSelectOption
getOptionsByCategory(category) → {Array.<SearchSelectOption>}
Get the select options that belong to a given category.
Parameters:
Name |
Type |
Description |
category |
string
|
The category to get options for. |
- Source:
Returns:
An array of options in the specified
category.
-
Type
-
Array.<SearchSelectOption>
getQueryFieldOptions()
Fetches the query fields from the query service, converts them to the
format required by the SearchSelectView, and sets them as the options
for this model
- Source:
getSelectedModels() → {Array.<SearchSelectOption>}
Get the selected models from the options collection.
- Source:
Returns:
- The selected models from the options
collection.
-
Type
-
Array.<SearchSelectOption>
hasInvalidSelections() → {boolean|Array.<string>}
Check if there are any invalid selections in the selected values.
- Source:
Returns:
- Returns false if there are no invalid
selections, or an array of invalid selection strings if there are any.
-
Type
-
boolean
|
Array.<string>
initialize(_models, _options)
Initializes with option models, objects, or categorized options.
Parameters:
Name |
Type |
Description |
_models |
Array.<SearchSelectOption>
|
Array.<object>
|
object
|
The options to
add to the collection. This can be an array of SearchSelectOption models,
an array of attributes for options models, or an object where each key is
a category and each value is an array of options. All will be
automatically converted to SearchSelectOption models for the collection. |
_options |
object
|
The options for the collection.
Properties
Name |
Type |
Description |
parse |
boolean
|
Whether to parse the incoming data into
the expected format. |
|
- Source:
Examples
// Initialize with an array of attributes
const options = new SearchSelectOptions([
{ label: "Option 1" },
{ label: "Option 2" }
]);
// Initialize with an object of categorized options
const options = new SearchSelectOptions({
"Category A": [
{ label: "Option 1" },
{ label: "Option 2" }
"Category B": [
{ label: "Option 3" },
{ label: "Option 4" }
});
initialize(attributes, _options)
Initialize the Bioontology mode
Parameters:
Name |
Type |
Description |
attributes |
object
|
The model attributes
Properties
Name |
Type |
Description |
apiKey |
string
|
An alternative API key to use. If not
set, the appModel's API key will be used. |
|
_options |
object
|
The options object |
- Source:
initialize(attributes, _options)
Initialize the Bioontology mode
Parameters:
Name |
Type |
Description |
attributes |
object
|
The model attributes
Properties
Name |
Type |
Description |
apiKey |
string
|
An alternative API key to use. If not
set, the appModel's API key will be used. |
|
_options |
object
|
The options object |
- Source:
initialize()
- Source:
initialize(attributes, options)
Initializes the QueryFieldSearchSelect model
Parameters:
Name |
Type |
Description |
attributes |
object
|
A literal object with model attributes |
options |
object
|
A literal object with options
Properties
Name |
Type |
Description |
collectionQuery |
boolean
|
Set this to true to
automatically set the excludeFields and addFields to the collection query
defaults set in the appModel. See
AppModel#collectionQueryExcludeFields and
AppModel#collectionQuerySpecialFields. |
|
- Source:
initialize()
- Source:
initialize()
- Source:
initializeFetch(classes)
Initialize the fetch process. This will set the status to "fetching" and
set the list of classes to fetch to the provided classes.
Parameters:
Name |
Type |
Description |
classes |
Array.<string>
|
The classes to fetch |
- Source:
isValidValue(value) → {boolean}
Checks if a given matches either a label or value in the collection of
options.
Parameters:
Name |
Type |
Description |
value |
string
|
The value or label to check for. |
- Source:
Returns:
- Returns true if the value is found in the
collection, false otherwise.
-
Type
-
boolean
isValidValue(value) → {boolean}
Extends the isValidValue method of the SearchSelect model to allow for
the addition of fields that are excluded by default, if they are selected
Parameters:
Name |
Type |
Description |
value |
string
|
The value to check |
- Source:
Returns:
- Returns true if the value is valid, false otherwise
-
Type
-
boolean
isValidValue(value) → {boolean}
Checks if a value is one of the values in the options.
Parameters:
Name |
Type |
Description |
value |
string
|
The value to check for. |
- Source:
Returns:
- Returns true if the value is found in the
collection, false otherwise.
-
Type
-
boolean
moveClassesToNotFound()
Move the classes that were not found to the list of classes not found. This
should be called after all classes have been fetched.
- Source:
optionsAsJSON(categorized) → {object|Array.<object>}
Returns the options as a JSON object.
Parameters:
Name |
Type |
Description |
categorized |
boolean
|
Whether to return the options as
categorized. See @link{SearchSelectOptions#toJSON} for more information. |
- Source:
Returns:
- The options as a JSON object.
-
Type
-
object
|
Array.<object>
parse(data) → {Array}
Parses the incoming options data. This can handle both an array of
options (uncategorized) or an object with categories (categorized).
Parameters:
Name |
Type |
Description |
data |
Array.<object>
|
object
|
Either an array of option objects or an
object with categories. |
- Source:
Returns:
An array of option objects suitable for the collection.
-
Type
-
Array
parse(response, options) → {object}
Parse the response from the BioPortal API
Parameters:
Name |
Type |
Description |
response |
object
|
The response from the BioPortal API |
options |
object
|
The options object
Properties
Name |
Type |
Description |
replaceCollection |
boolean
|
Whether to replace the
collection or add to it. Adds to it by default. |
|
- Source:
Returns:
The parsed response
-
Type
-
object
parse()
- Source:
parse()
- Source:
recordError(error)
Record an error that occurred during the fetch process.
Parameters:
Name |
Type |
Description |
error |
Error
|
The error that occurred |
- Source:
removeSelected(value, options)
Remove a value from the selected list.
Parameters:
Name |
Type |
Description |
value |
string
|
The value to remove from the selected list. |
options |
object
|
Additional options to be passed to the set
method. |
- Source:
renameCategory(oldCategory, newCategory)
Change the name of a category for all options in the collection.
Parameters:
Name |
Type |
Description |
oldCategory |
string
|
The category to rename. |
newCategory |
string
|
The new name for the category. |
- Source:
resetPageInfo()
Clears the pagination info that has been fetched from the BioPortal API
- Source:
responseAsync(settings, callback)
Handles the async response for the Accounts lookup
Parameters:
Name |
Type |
Description |
settings |
object
|
The settings object passed by Formantic-UI |
callback |
function
|
The callback function passed by Formantic-UI |
- Source:
separatorRequired(value) → {boolean}
Determines if a separator is needed for the newly created, yet to be attached label.
Parameters:
Name |
Type |
Description |
value |
string
|
The value of the label. |
- Source:
Returns:
- Returns true if a separator should be created, otherwise false.
-
Type
-
boolean
setAddedFieldDetails(option)
For options that are added fields, not real query fields from the query
service, this method sets fields and types attributes on the option model
that are the real query fields that the added field represents.
Parameters:
Name |
Type |
Description |
option |
SearchSelectOption
|
The option model to update |
- Source:
setNextSeparator()
Set the next separator in the list of separator options.
- Source:
setOptionsForPreselected()
Use the account lookup service to match the pre-selected values to the
account holder's name to use as a label.
- Source:
setOptionsForPreselected()
This method is set for extended models that fetch options asynchronously
on search. This method should be overridden to fetch options from the API
for the values that are currently selected in the dropdown. This allows
those values to be populated with the correct label and icon.
- Source:
setSelected(values, options)
Change the values that are selected in the dropdown.
Parameters:
Name |
Type |
Description |
values |
string
|
Array.<string>
|
The value(s) to select. |
options |
object
|
Additional options to be passed to the set
method. |
- Source:
sortByProp(prop)
Sort the options by a given property.
Parameters:
Name |
Type |
Description |
prop |
string
|
The property to sort by. |
- Source:
sortFields(unsortedOptions) → {Array.<object>}
Sorts the fieldsJSON array by categoryOrder and then alphabetically
within each category if the category is specified in the
categoriesToAlphabetize property of this model.
Parameters:
Name |
Type |
Description |
unsortedOptions |
Array.<object>
|
An array of objects that represent
attributes for SearchSelectOptions. |
- Source:
Returns:
The sorted options
-
Type
-
Array.<object>
toAccordionItem() → {object}
Reformat for an accordion item
- Source:
Returns:
Attributes for an accordion item model
-
Type
-
object
toJSON(categorizedopt) → {object|Array.<object>}
Return JSON representation of the collection.
Parameters:
Name |
Type |
Attributes |
Description |
categorized |
boolean
|
<optional>
|
Whether to return the options as an object
with categories as keys (true) or as an array with categories as a
property on each option (false). If set to categorized, and the options
have no category, they will be placed in a default category with an empty
string key. |
- Source:
Returns:
JSON representation of the collection.
-
Type
-
object
|
Array.<object>
toSearchSelectOption() → {object}
Reformat for a searchSelect option
- Source:
Returns:
Attributes for a searchSelect option model
-
Type
-
object
toSearchSelectOption() → {object}
- Source:
Returns:
Attributes for a searchSelect option model
-
Type
-
object
updateOptions(options)
Update the options for the dropdown.
Parameters:
Name |
Type |
Description |
options |
object
|
Array.<object>
|
The new options to set for the dropdown |
- Source:
url()
- Source:
url()
- Source:
url()
- Source:
url()
- Source:
waitForFetchComplete() → {Promise.<boolean>}
Wait for the fetch process to complete. This will return a promise that
resolves when the fetch process is complete.
- Source:
Returns:
A promise that resolves to true if the fetch
process is complete, and false if it is not complete
-
Type
-
Promise.<boolean>
Type Definitions
AdditionalField
An additional field object contains the properties an additional query
field to add that are required to render it correctly. An additional
query field is one that does not actually exist in the query service
index.
Type:
Properties:
Name |
Type |
Description |
name |
string
|
A unique ID to represent this field. It must
not match the name of any other query fields. |
fields |
Array.<string>
|
The list of real query fields that this
abstracted field will represent. It must exactly match the names of the
query fields that actually exist. |
label |
string
|
A user-facing label to display. |
description |
string
|
A description for this field. |
category |
string
|
The name of the category under which to
place this field. It must match one of the category names for an existing
query field. |
- Since:
- Source:
AdditionalField
An additional field object contains the properties for an additional query
field to add to the QueryFieldSelectView that are required to render it
correctly. An additional query field is one that does not actually exist in the
query service index.
Type:
Properties:
Name |
Type |
Description |
name |
string
|
A unique ID to represent this field. It must not
match the name of any other query fields. |
fields |
Array.<string>
|
The list of real query fields that this
abstracted field will represent. It must exactly match the names of the query
fields that actually exist. |
label |
string
|
A user-facing label to display. |
description |
string
|
A description for this field. |
category |
string
|
The name of the category under which to place
this field. It must match one of the category names for an existing query
field. |
- Source:
CategoryMap
An object that defines a single category for each field.
In addition to a label and icon property, each CategoryMap should have a queryTypes
property OR a a queryFields property, not both.
Type:
Properties:
Name |
Type |
Description |
label |
string
|
A human readable label to use as a general category for groups of query fields |
icon |
string
|
The name of a Font Awesome 3.2.1 icon to represent the field type |
queryTypes |
Array.<string>
|
An array of the possible query field types, as named in the type attribute, that belong in the given category. If a queryType array is provided, the queryFields array will be ignored. |
queryFields |
Array.<string>
|
As an alternative to grouping fields by type, they may also be grouped by field name. Use this property instead of queryTypes to list fields by their name attribute. |
default |
boolean
|
Set to true for one category. Any fields that don't match another category will be placed here. |
- Source:
ContentTemplate
A ContentTemplate object specifies a single template designed to render
information about the Feature.
Type:
Properties:
Name |
Type |
Attributes |
Description |
name |
string
|
<optional>
|
An identifier for this template. |
options |
Array.<string>
|
<optional>
|
The list of keys (option names) that are
allowed for the given template. Only options with these keys will be passed to
the underscore.js template, regardless of what is configured in the
MapConfig#FeatureTemplate. When no options are specified, then the
entire Feature model will be passed to the template as JSON. |
template |
string
|
|
The path to the HTML template. This will be used
with require() to load the template as needed. |
- Since:
- Source:
ContextDefinition
Defines how to render a citation style for only it's in-text or full
citation format.
Type:
Properties:
Name |
Type |
Description |
template |
Underscore.Template
|
The Underscore.js template
to use. HTML files are converted to Underscore.js templates. |
archivedTemplate |
Underscore.Template
|
The Underscore.js
template to use when the object is archived. |
render |
string
|
The name of the method in this view to use
to render the citation. This method will be passed the template (or
archived template if the object is archived), as well as the template
options. |
- Since:
- Source:
Example
{
inText: {
template: _.template(InTextAPATemplate),
archivedTemplate: _.template(InTextAPAArchivedTemplate),
render: "renderAPAInText",
}
CustomEMLMethod
In the editor, sometimes it is useful to have guided questions for the Methods section
in addition to the generic numbered method steps. These custom methods are defined here
as an array of literal objects that define each custom Methods question. Custom methods
are serialized to the EML as regular method steps, but with an unchangeable title, defined here,
in order to identify them.
Type:
Properties:
Name |
Type |
Description |
titleOptions |
Array.<string>
|
One or more titles that may exist in an EML Method Step that identify that Method Step as a custom method type. THe first title in the array is serialized to the EML XML. |
id |
string
|
A unique identifier for this custom method type. |
required |
boolean
|
If true, this custom method will be a required field for submission in the EML editor. |
- Since:
- Source:
Example
[{
"titleOptions": ["Ethical Research Procedures"],
"id": "ethical-research-procedures",
"required": false
}]
DetailSectionOption
Configuration for a Layer Detail section to show within this Layer Details
view.
Type:
Properties:
Name |
Type |
Description |
label |
string
|
The name to display for this section |
view |
Backbone.View
|
Any view that will render content for the Layer
Detail section. This view will be passed the MapAsset model. The view should
display information about the MapAsset and/or allow some aspect of the
MapAsset's appearance to be edited - e.g. a LayerInfoView or a
LayerOpacityView. |
collapsible |
boolean
|
Whether or not this section should be
expandable and collapsible. |
showTitle |
boolean
|
Whether or not to show the title/label for this
section. |
hideIfError |
boolean
|
Set to true to hide this section when there is
an error loading the layer. Example: we should hide the opacity slider for
layers that are not visible on the map |
- Source:
Type:
Properties:
Name |
Type |
Attributes |
Description |
name |
string
|
|
The name of the button. This should be the
same as the mode that the button will activate (if the button is
supposed to activate a mode). |
label |
string
|
|
The label to display on the button. |
icon |
string
|
|
The name of the icon to display on the
button. |
method |
string
|
<optional>
|
The name of the method to call when the
button is clicked. If this is not provided, the button will toggle the
mode of the draw tool. |
- Source:
ExpansionPanelViewOptions
Type:
Properties:
Name |
Type |
Attributes |
Description |
title |
string
|
|
The displayed label for this panel. |
icon |
string
|
|
The icon displayed in the panel's clickable
label. |
contentViewInstance |
Backbone.View
|
|
The Backbone.View that
will be displayed when the content of the panel is toggled to be
visible. |
panelsModel |
ExpansionPanelsModel
|
<optional>
|
Optional model for
coordinating the expanded/collapsed state among many panels. |
startOpen |
boolean
|
|
Whether the panel should be expanded by
default. |
- Source:
GeocodedLocationOptions
Type:
Properties:
Name |
Type |
Description |
box |
Object
|
An object representing a boundary around a
location on a map. |
displayName |
string
|
A display name for the location. |
- Source:
LayersPanelViewOptions
Type:
Properties:
Name |
Type |
Description |
The |
Map
|
Map model that contains layers information. |
- Source:
MapIconString
A string that represents an icon. Can be either the name of the Font Awesome
3.2 icon OR an SVG string for an icon with all the following properties: 1)
Uses viewBox attribute and not width/height; 2) Sets fill or stroke to
"currentColor" in the svg element, no styles included elsewhere, 3) Has the
required xmlns attribute
Type:
- Source:
- See:
-
Examples
'<svg viewBox="0 0 400 110" fill="currentColor"><path d="M0 0h300v100H0z"/></svg>'
'map-marker'
MetricOption
A metric option is an object with properties that define how to display
a metric in the modal.
Type:
Properties:
Name |
Type |
Description |
name |
string
|
The name of the metric, as it will be
displayed in the modal. |
icon |
string
|
The font awesome icon class for the metric |
metricValue |
string
|
The name of the property in the
metrics model that contains the value for this metric. This will be
displayed in the title of the modal. |
render |
string
|
The name of the method within this view
that will render the metric. This method will be called after the
basic modal template has been rendered. |
- Source:
OperatorOption
An operator option is an object that lists the properties of one of the
operators that will be displayed to the user in the Query Rule "operator"
dropdown list. The operator properties are used to pre-select the correct
operator based on attributes in the associated
Filter model, as well as to update the Filter model
when a user selects a new operator. Operators can set the exclude and
matchSubstring properties of the model, and sometimes the values as well.
Either the types property OR the fields property must be set, not both.
Type:
Properties:
Name |
Type |
Attributes |
Description |
label |
string
|
|
The label to display to the user |
icon |
string
|
|
An icon that represents the operator |
matchSubstring |
boolean
|
|
Whether the matchSubstring attribute is
true or false in the filter model that matches this operator |
exclude |
boolean
|
|
Whether the exclude attribute is true or false in
the filter model that matches this operator |
hasMax |
boolean
|
|
Whether the filter model that matches this
operator must have a max attribute |
hasMin |
boolean
|
|
Whether the filter model that matches this
operator must have a min attribute |
values |
Array.<string>
|
|
For this operator to work as desired, the values
that should be set in the filter (e.g. ["true"] for the operator "is true") |
types |
Array.<string>
|
<optional>
|
The node names of the filters that this operator
is used for (e.g. "filter", "booleanFilter") |
fields |
Array.<string>
|
<optional>
|
The query field names of the filters that this
operator is used for. If this is used for a
special field, then list the special field
name (id), and not the real query field names. If this fields property is set,
then the types property will be ignored. (i.e. fields is more specific than
types.) |
- Source:
PredictionOptions
Type:
Properties:
Name |
Type |
Description |
description |
string
|
A string describing the location
represented by the Prediction. |
googleMapsPlaceId |
string
|
The place ID that is used to
uniquely identify a place in Google Maps API. |
- Source:
PredictionViewOptions
Type:
Properties:
Name |
Type |
Description |
The |
Prediction
|
Prediction model associated with this
autocompletion prediction. |
The |
ViewfinderModel
|
model associated with the parent view. |
The |
number
|
position of this prediction within the parent's
full list of predictions. |
- Source:
Type:
Properties:
Name |
Type |
Description |
search |
function
|
A function that takes in a text input and returns
a boolean for whether there is a match. |
keydownCallback |
function
|
A function that receives a key event
on keydown. |
keyupCallback |
function
|
A function that receives a key event
on keyup stroke. |
blurCallback |
function
|
A function that receives an event on
blur of the input. |
focusCallback |
function
|
A function that receives an event on
focus of the input. |
noMatchCallback |
function
|
A callback function to handle a no match
situation. |
placeholder |
String
|
The placeholder text for the input box. |
- Source:
SearchSortOptions
A list of sort order options to display in this view.
Type:
Properties:
Name |
Type |
Description |
value |
string
|
The sort value that will be sent directly to
the search index in the query string. |
label |
string
|
The name of the sort option that will be shown
to the user. |
- Since:
- Source:
SearchViewOptions
Type:
Properties:
Name |
Type |
Description |
viewfinderModel |
ViewfinderModel
|
The model associated
with this view allowing control of panning to different locations on
the map, and displaying location related search features. |
- Source:
SectionContentReturnType
Type:
Properties:
Name |
Type |
Description |
contentContainer |
HTMLElement
|
The content container HTML
element. |
sectionContent |
Backbone.View
|
The Backbone.View instance |
- Source:
SectionElement
A reference to all of the elements required to make up a toolbar section: the
section content and the section link (i.e. tab); as well as the status of the
section: active or in active.
Type:
Properties:
Name |
Type |
Description |
contentEl |
HTMLElement
|
The element that contains the toolbar
section's content (the content rendered by the associated view) |
linkEl |
HTMLElement
|
The element that acts as a link to show the
section's content, and open/close the toolbar. |
isActive |
Boolean
|
True if this is the active section, false
otherwise. |
sectionView |
Backbone.View
|
The associated Backbone.View instance. |
- Source:
SectionOption
Options/settings that are used to create a toolbar section and its associated
link/tab.
Type:
Properties:
Name |
Type |
Attributes |
Description |
label |
string
|
|
The name of this section to show to the user. |
icon |
MapIconString
|
|
The icon to show in the link (tab) for this
section |
view |
Backbone.View
|
<optional>
|
The view that renders the content of the
toolbar section. |
viewOptions |
object
|
<optional>
|
Any additional options to pass to the content
view. By default, the label, icon, and Map model will be passed to the view as
'label', 'icon', and 'model', respectively. To pass a specific attribute from
the Map model, use a string with the syntax 'model.desiredAttribute'. For
example, 'model.layers' will be converted to view.model.get('layers') |
action |
function
|
<optional>
|
A function to call when the link/tab is clicked.
This can be provided instead of a view and viewOptions, in which case no
toolbar section will be created. The function will be passed the view and the
Map model as arguments. |
isVisible |
function
|
<optional>
|
A function that determines whether this
section should be visible in the toolbar. |
- Source:
ShareUrlViewOptions
Type:
Properties:
Name |
Type |
Description |
left |
number
|
position for absolute positioning this element. |
top |
number
|
position for absolute positioning this element. |
onRemove |
function
|
callback function to be executed before
this View removes itself. |
- Source:
SpecialField
A special field is one that does not exist in the query service index (i.e.
Solr). It can be a combination of fields that are presented to the user as a
single field, but which are added to the model as multiple fields. It can also be
a duplicate of a field that does exist, but presented with a different label (and
even with different operator options or
value input if needed).
Type:
Properties:
Name |
Type |
Attributes |
Description |
name |
string
|
|
A unique ID to represent this field. It must not match
the name of any other query fields. |
fields |
Array.<string>
|
|
The list of real query fields that this abstracted
field should represent. The query fields listed must exactly match the names of
the query fields that are retrieved from the query service. |
label |
string
|
|
A user-facing label to display. |
description |
string
|
|
A description for this field. |
category |
string
|
|
The name of the category under which to place this
field. It must match one of the category names for an existing query field set in
QueryField#categoriesMap. |
values |
Array.<string>
|
<optional>
|
An optional list of filter values. If set, this
is used to determine whether a pre-existing Query Rule should be displayed as one
of these special fields, or as a field from the query API. Setting values means
that the values set on the Query Rule model must exactly match the values set. |
- Since:
- Source:
StyleDefinition
Defines how to render a citation style for both it's in-text and full
contexts.
Type:
Properties:
Name |
Type |
Description |
full |
CitationView#ContextDefinition
|
The full citation
format. |
inText |
CitationView#ContextDefinition
|
The in-text
citation format. |
- Since:
- Source:
UIBuilderOption
A single type of custom search filter that a user can select. An option
represents a specific Filter model type and uses that associated Filter View.
Type:
Properties:
Name |
Type |
Description |
label |
string
|
The user-facing label to show for this option |
modelType |
string
|
The name of the filter model type that that this
UI builder should create. Only one is allowed. The model must be one of the six
filters that are allowed in a Portal "UIFilterGroupType". See
https://github.com/DataONEorg/collections-portals-schemas/blob/master/schemas/portals.xsd. |
iconFileName |
string
|
The file name, including extension, of the SVG
icon used to represent this option |
description |
string
|
A very brief, user-facing description of how
this filter works |
filterTypes |
Array.<string>
|
An array of one or more filter types that are
allowed for this interface. If none are provided then any filter type is
allowed. Filter types are one of the four keys defined in |
blockedFields |
Array.<string>
|
An array of one or more search
fields for which this interface should be blocked
QueryField#filterTypesMap, and correspond to one of the four filter
types that are allowed in a Collection definition. See
https://github.com/DataONEorg/collections-portals-schemas/blob/master/schemas/collections.xsd.
This property is used to help users match custom search filter UIs to
appropriate query fields. |
modelFunction |
function
|
A function that takes an optional object
with model properties and returns an instance of a model to use for this UI
builder |
uiFunction |
function
|
A function that takes the model as an argument
and returns the filter UI builder view for this option |
- Source:
The third input in each Query Rule is where the user enters a value, minimum,
or maximum for the filter model. Different types of values are appropriate for
different solr query fields, and so we display different interfaces depending
on the type and category of the selected query fields. A Value Input Option
object defines a of interface to show for a given type and category.
Type:
Properties:
Name |
Type |
Description |
filterTypes |
Array.<string>
|
An array of one or more filter types that
are allowed for this interface. If none are provided then any filter type is
allowed. Filter types are one of the four keys defined in
QueryField#filterTypesMap. |
categories |
Array.<string>
|
An array of one or more categories that are
allowed for this interface. These strings must exactly match the categories
provided in QueryField.categoriesMap(). If none are provided then any category
is allowed. |
queryFields |
Array.<string>
|
Specific names of fields that are allowed in
this interface. If none are provided, then any query fields are allowed that
match the other properties. If this value select should be used for a
special field, then use the name (id) of
the special field, not the actual query fields that it represents. |
label |
string
|
If the interface does not include a label (e.g.
number filter), include a string to display here. |
uiFunction |
function
|
A function that returns the UI view to use
with all appropriate options set. The function will be called with this view as
the context. |
- Source:
ViewfinderViewOptions
Type:
Properties:
Name |
Type |
Description |
model |
Map
|
The map model that contains the configs for this map view. |
isPortalMap |
boolean
|
Indicates whether the map view is a part of a
portal, which is styled differently. |
- Source:
ViewfinderViewOptions
Type:
Properties:
Name |
Type |
Description |
The |
ViewfinderModel
|
model associated with the parent view. |
- Source:
ViewfinderViewOptions
Type:
Properties:
Name |
Type |
Description |
The |
Map
|
Map model associated with this view allowing control
of panning to different locations on the map. |
- Source:
ZoomPresetModelOptions
Type:
Properties:
Name |
Type |
Description |
title |
string
|
The displayed title for the preset. |
geoPoint |
GeoPoint
|
The location representing this preset,
including height information. |
description |
string
|
A brief description of the layers and
location. |
enabledLayerIds |
Array.<string>
|
A list of layer IDs which are to
be enabled for this preset. |
enabledLayerLabels |
Array.<string>
|
A list of layer labels which
are enabled for this preset. |
- Source:
ZoomPresetViewOptions
Type:
Properties:
Name |
Type |
Description |
The |
ZoomPresetModel
|
metadata associated with this zoom
preset. |
selectCallback |
function
|
to be called when this preset is
selected. |
- Source:
ZoomPresetsListViewOptions
Type:
Properties:
Name |
Type |
Description |
zoomPresets |
Array.<ZoomPreset>
|
The zoom presets to render. |
selectZoomPreset |
function
|
The callback function for
selecting a zoom preset. |
- Source:
ZoomPresetsParseOptions
Type:
Properties:
Name |
Type |
Description |
zoomPresets |
object
|
The raw list of objects that represent
the zoom presets, to be converted into ZoomPresetModels. |
allLayers |
Array.<MapAsset>
|
All of the layers available for display
in the map. |
- Source: