Class: EML211EditorView

EML211EditorView()

A view of a form for creating and editing EML 2.1.1 documents

Constructor

new EML211EditorView()

Source:

Extends

Members

accessPolicyControlContainer :string

The selector for the HTML element that will contain a button/link/control for opening the AccessPolicyView modal window. If this element doesn't exist on the page, then the AccessPolicyView will be inserted into the `accessPolicyViewContainer` directly, rather than a modal window.
Type:
  • string
Inherited From:
Source:

accessPolicyModalID :string

The text to use in the editor submit button
Type:
  • string
Inherited From:
Source:

accessPolicyViewContainer :string

The selector for the HTML element that will contain the AccessPolicyView. If this element doesn't exist on the page, then the AccessPolicyView will not be inserted into the page. If a `accessPolicyControlContainer` element is on the page, then this element will contain the modal window element.
Type:
  • string
Inherited From:
Source:

dataPackageView :DataPackageView

The data package view
Type:
Source:

editorSubmitMessageTemplate

References to templates for this view. HTML files are converted to Underscore.js templates
Overrides:
Source:

el :string|DOMElement

The element this view is contained in. A jQuery selector or the element itself.
Type:
  • string | DOMElement
Inherited From:
Source:

events :Object

The events this view will listen to and the associated function to call. This view will inherit events from the parent class, EditorView.
Type:
  • Object
Overrides:
Source:

pid :string

The identifier of the root package EML being rendered
Type:
  • string
Source:

submitButtonText :string

The text to use in the editor submit button
Type:
  • string
Overrides:
Source:

subviews :Array.<Backbone.Views>

A list of the subviews of the editor
Type:
  • Array.<Backbone.Views>
Source:

Methods

cancel()

Cancel all edits in the editor by simply re-rendering the view
Inherited From:
Source:

canClose() → {boolean}

Checks if there are unsaved changes in this Editor that should prevent closing of this view. This function is also executed by the AppView, which controls the top-level navigation.
Inherited From:
Source:
Returns:
Returns true if this view should be closed. False if it should remain opened and active.
Type
boolean

checkValidity()

Check the validity of this view's model
Inherited From:
Source:

clearOldDrafts()

Clear older drafts by iterating over the sorted list of drafts stored by LocalForage and removing any beyond a hardcoded limit.
Source:

getConfirmCloseMessage() → {string}

This function is called whenever the user is about to leave this view.
Inherited From:
Source:
Returns:
The message that asks the user if they are sure they want to close this view
Type
string

handleSaveCancel()

Trigger a save error with a message that the save was cancelled
Inherited From:
Source:

hasUnsavedChanges() → {boolean}

Returns true if there are unsaved changes in this Editor This function should be exended by each subclass of EditorView to check for unsaved changes for that model type
Overrides:
Source:
Returns:
Type
boolean

hideControls()

Hide the editor footer controls (Save bar)
Inherited From:
Source:

hideLoading(container)

Remove the styles set in showLoading()
Parameters:
Name Type Description
container string | DOMElement The element the loading message is conttained in. Either a jQuery selector or the element itself.
Inherited From:
Source:

hideSaving()

Remove the styles set in showSaving()
Inherited From:
Source:

initialize()

Initialize a new EML211EditorView - called post constructor
Source:

onClose()

Perform clean-up functions when this view is about to be removed from the page or navigated away from.
Overrides:
Source:

removeValidation()

Removes all the validation error styling and messaging from this view
Inherited From:
Source:

render()

Renders this view
Overrides:
Source:

renderAccessPolicy(e)

Renders the AccessPolicyView
Parameters:
Name Type Description
e Event The event that triggered this function as a callback
Inherited From:
Source:

renderAccessPolicyControl()

Adds a Share button for editing the access policy
Inherited From:
Source:

renderEditorControls()

Adds top-level control elements to this editor.
Inherited From:
Source:

renderRequiredIcons(requiredFields)

Shows the required icons for the sections and fields that must be completed in this editor.
Parameters:
Name Type Description
requiredFields object A literal object that specified which fields should be required. The keys on the object map to model attributes, and the value is true if required, false if optional.
Inherited From:
Source:

save()

Saves all edits in the collection
Overrides:
Source:

saveDraft()

Save a draft of the parent EML model
Source:

saveError(errorMsg)

When the object fails to save, tell the user
Parameters:
Name Type Description
errorMsg string The error message resulting from a failed attempt to save
Overrides:
Source:

saveSuccess(savedObject)

When the object is saved successfully, tell the user
Parameters:
Name Type Description
savedObject object the object that was successfully saved
Overrides:
Source:

setListeners()

Set listeners on the view's model. This function centralizes all the listeners so that when/if the view's model is replaced, the listeners can be reset.
Overrides:
Source:

showAccessPolicyModal(e)

Shows the AccessPolicyView for the object being edited.
Parameters:
Name Type Description
e Event The event that triggered this function as a callback
Inherited From:
Source:

showControls()

Show the editor footer controls (Save bar)
Inherited From:
Source:

showLoading(container, message)

Style the view to show that it is loading
Parameters:
Name Type Description
container string | DOMElement The element to put the loading styling in. Either a jQuery selector or the element itself.
message string | DOMElement The message to display next to the loading icon. Either a jQuery selector or the element itself.
Inherited From:
Source:

showNotFound()

Called when there is no object found with this ID
Inherited From:
Source:

showSaving()

Change the styling of this view to show that the object is in the process of saving
Inherited From:
Source:

showSignIn()

Show Sign In buttons
Inherited From:
Source:

showValidation()

Show validation errors, if there are any
Overrides:
Source: