Class: MetadataView

MetadataView()

A human-readable view of a science metadata file

Constructor

new MetadataView()

Source:

Extends

  • Backbone.View

Methods

createWholeTaleButton()

Creates a button which the user can click to launch the package in Whole Tale
Source:

findEntityDetailsContainer(model, elopt) → {Element}

Finds the element in the rendered metadata that describes the given data entity.
Parameters:
Name Type Attributes Description
model DataONEObject | SolrResult | string Either a model that represents the data object or the identifier of the data object
el Element <optional>
The DOM element to exclusivly search inside.
Source:
Returns:
- The DOM element that describbbes the given data entity.
Type
Element

generateGeoJSONPoint(north, east)

Generate a GeoJSON Point object
Parameters:
Name Type Description
north number North bounding coordinate
east number East bounding coordinate Example: { "type": "Point", "coordinates": [ -105.01621, 39.57422 ]}
Source:

generateGeoJSONPolygon(north, east, south, west)

Generate a GeoJSON Polygon object from
Parameters:
Name Type Description
north number North bounding coordinate
east number East bounding coordinate
south number South bounding coordinate
west number West bounding coordinate Example: { "type": "Polygon", "coordinates": [[ [ 100, 0 ], [ 101, 0 ], [ 101, 1 ], [ 100, 1 ], [ 100, 0 ] ]}
Source:

generateGeoJSONString(north, east, south, west)

Creates a (hopefully) valid geoJSON string from the a set of bounding coordinates from the Solr index (north, east, south, west). This function produces either a GeoJSON Point or Polygon depending on whether the north and south bounding coordinates are the same. Part of the reason for factoring this out, in addition to code organization issues, is that the GeoJSON spec requires us to modify the raw result from Solr when the coverage crosses -180W which is common for datasets that cross the Pacific Ocean. In this case, We need to convert the east bounding coordinate from degrees west to degrees east. e.g., if the east bounding coordinate is 120 W and west bounding coordinate is 140 E, geoJSON requires we specify 140 E as 220
Parameters:
Name Type Description
north number North bounding coordinate
east number East bounding coordinate
south number South bounding coordinate
west number West bounding coordinate
Source:

generateJSONLD()

Generate Schema.org-compliant JSONLD for the model bound to the view into the head tag of the page by `insertJSONLD`. Note: `insertJSONLD` should be called to do the actual inserting into the DOM.
Source:

generateSchemaOrgGeo()

Generate a Schema.org/Place/geo from bounding coordinates Either generates a GeoCoordinates (when the north and east coords are the same) or a GeoShape otherwise.
Source:

getAuthorText()

Generate a string appropriate to go into the author/creator portion of a dataset citation from the value stored in the underlying model's origin field.
Source:

getCanonicalDOIIRI(identifier:) → {string|null}

Create a canonical IRI for a DOI given a random DataONE identifier.
Parameters:
Name Type Description
identifier: string The identifier to (possibly) create the IRI for.
Source:
Returns:
Returns null when matching the identifier to a DOI regex fails or a string when the match is successful Useful for describing resources identified by DOIs in linked open data contexts or possibly also useful for comparing two DOIs for equality. Note: Really could be generalized to more identifier schemes.
Type
string | null

getDatePublishedText()

Generate a string appropriate to be used as the publication date in a dataset citation.
Source:

getPublisherText()

Generate a string appropriate to be used in the publisher portion of a dataset citation. This method falls back to the node ID when the proper node name cannot be fetched from the app's NodeModel instance.
Source:

insertCitationMetaTags()

Insert citation information as meta tags into the head of the page Currently supports Highwire Press style tags (citation_) which is supposedly what Google (Scholar), Mendeley, and Zotero support.
Source:

insertJSONLD(json)

Insert Schema.org-compliant JSONLD for the model bound to the view into the head tag of the page (at the end).
Parameters:
Name Type Description
json object JSON-LD to insert into the page Some notes: - Checks if the JSONLD already exists from the previous data view - If not create a new script tag and append otherwise replace the text for the script
Source:

previewData()

When the "Metadata" button in the table is clicked while we are on the Metadata view, we want to scroll to the anchor tag of this data object within the page instead of navigating to the metadata page again, which refreshes the page and re-renders (more loading time)
Source:

scrollToFragment()

Try to scroll to the section on a page describing the identifier in the fragment/hash portion of the current page. This function depends on there being an `id` dataset attribute on an element on the page set to an XML-safe version of the value in the fragment/hash. Used to provide direct links to sub-resources on a page.
Source:

setUpAnnotator()

If the annotator feature is enabled, this function renders an AnnotatorView. The Annotator feature is experiemental and unsupported, so this should only be enabled by advanced users
Deprecated:
  • Yes
Source: