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:
- Inherited From:
- Source:
accessPolicyModalID :string
The text to use in the editor submit button
Type:
- 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:
- Inherited From:
- Source:
el :string|DOMElement
The element this view is contained in. A jQuery selector or the element itself.
Type:
- Inherited From:
- Source:
entityByMemberPid :Map.<string, EMLEntity>
EML entity matches for the current editor file table render.
Type:
- 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:
- Overrides:
- Source:
fileTableEditInProgress :boolean
Whether a file table edit is still staging package metadata changes.
Type:
- Source:
The file table view for package members.
Type:
- Source:
fileUploadProgressByPid :Object.<string, number>
Last known eager upload progress by package member PID.
Type:
- Source:
Whether EML entities need to be reconciled with package data members.
Type:
- Source:
packageSavePendingPids :Set.<string>|null
Package member PIDs that have not finished submitting in this save.
Type:
- Source:
packageSavePrepMessage :string|null
Current package save preparation message shown on the Save button.
Type:
- Source:
packageSaveReloadMessage :string|null
Reload message retained after an upload leaves package state unsafe to
reuse.
Type:
- Since:
- Default Value:
- Source:
Example
view.packageSaveReloadMessage = "Reload before saving again.";
packageSaveUploadCount :number|null
Number of package members being submitted by the current save.
Includes system metadata only uploads.
Type:
- Source:
packageSaveUploadTotal :number|null
Total package members submitted by the current save.
Type:
- Source:
pid :string
The identifier of the root package EML being rendered
Type:
- Source:
renderAbortController :AbortController|null
AbortController for fetch capable work owned by the active render.
Type:
- Source:
renderId :string|null
Opaque identifier for the render that currently owns async callbacks.
Type:
- Source:
replacingPids :Set.<string>|null
Member PIDs whose content is being replaced. Used to show the row as
uploading immediately, before replaceFile() resolves and the eager
upload begins emitting progress under the new PID.
Type:
- Source:
submitButtonText :string
The text to use in the editor submit button
Type:
- Overrides:
- Source:
subviews :Array.<Backbone.Views>
A list of the subviews of the editor
Type:
- Source:
type :string
The type of View this is
Type:
- Source:
Methods
abortRender() → {void}
Cancel fetch capable work owned by the active render.
- Since:
- Source:
Returns:
-
Type
-
void
addFilesFromFileTable(rowModel, files) → {Promise.<Array.<DataPackageMember>>}
Stage files, link them into the package, and update EML entities.
Parameters:
| Name |
Type |
Description |
rowModel |
Backbone.Model
|
Add target row |
files |
Array.<File>
|
Files to add |
- Since:
- Source:
Returns:
Members retained in the package
-
Type
-
Promise.<Array.<DataPackageMember>>
Attach the current metadata model to its package member.
Parameters:
| Name |
Type |
Attributes |
Description |
metadataModel |
ScienceMetadata
|
EML211
|
<optional>
|
Metadata model to attach |
- Since:
- Source:
Returns:
Updated matching metadata member
-
Type
-
DataPackageMember
|
null
buildAccessPolicyModalOptions(member, optionsopt) → {object}
Build explicit policy editor options for a package member. The shared
AccessPolicyView consumes the policy rules, display context, and apply
callback directly rather than via a facade resembling a DataONEObject.
Parameters:
| Name |
Type |
Attributes |
Description |
member |
DataPackageMember
|
|
Package member |
options |
object
|
<optional>
|
Modal options
Properties
| Name |
Type |
Attributes |
Description |
packageLevel |
boolean
|
<optional>
|
Whether apply should target the
whole package |
|
- Since:
- Source:
Returns:
AccessPolicy modal options
-
Type
-
object
buildEntityByMemberPid(membersopt, metadataModelopt) → {Map.<string, EMLEntity>}
Match data members with existing EML entities without changing either.
Each entity can match one member. Resolve strong matches before
fallbacks.
Parameters:
| Name |
Type |
Attributes |
Description |
members |
Array.<DataPackageMember>
|
<optional>
|
Members to match |
metadataModel |
EML211
|
<optional>
|
Metadata model containing entities |
- Since:
- Source:
Returns:
Entities keyed by member PID
-
Type
-
Map.<string, EMLEntity>
canClose() → {boolean}
Refuse to close while an upload is actively writing to the
repository. Closing mid save can commit the metadata document without
its resource map, leaving an orphaned EML that is hard to recover.
- Since:
- Overrides:
- Source:
Returns:
True when the editor can close
-
Type
-
boolean
cancel()
Cancel all edits in the editor by simply re-rendering the view
- Inherited From:
- Source:
checkValidity()
Check the validity of this view's model
- Inherited From:
- Source:
choosePackageFiles(optionsopt) → {Promise.<Array.<File>>}
Open a file picker for package files.
Parameters:
| Name |
Type |
Attributes |
Description |
options |
object
|
<optional>
|
Picker options
Properties
| Name |
Type |
Attributes |
Description |
multiple |
boolean
|
<optional>
|
Whether multiple files are allowed |
|
- Since:
- Source:
Returns:
Selected files
-
Type
-
Promise.<Array.<File>>
clearOldDrafts()
Clear older drafts by iterating over the sorted list of drafts stored
by LocalForage and removing any beyond a hardcoded limit.
- Source:
createDataPackage()
Creates a DataPackage collection for this EML211EditorView and sets it
on the MetacatUI global object (as `rootDataPackage`)
- Source:
createModel()
Create a new EML model for this view
- Source:
createRootDataPackage(models, attributesopt)
Creates a
DataPackage collection for this Editor view, and
saves it as the Root Data Package of the app. This centralizes the
DataPackage creation so listeners and other functionality is always
performed
Parameters:
| Name |
Type |
Attributes |
Description |
models |
Array.<ScienceMetadata>
|
Array.<EML211>
|
|
An array of metadata
models to add to the package |
attributes |
object
|
<optional>
|
A literal object of attributes to pass to
the DataPackage.initialize() function |
- Since:
- Source:
disableControls(messageopt, tooltipMessage)
Disable the Save button and display a message to explain why
Parameters:
| Name |
Type |
Attributes |
Description |
message |
string
|
<optional>
|
A short text message to display in the Save button |
tooltipMessage |
string
|
|
- A message that is the reason for buttons being disabled. This message will be displayed in a tooltip. |
- Since:
- Inherited From:
- Source:
discardFailedFileReplacements() → {Promise.<Array.<string>>}
Restore remote members after their replacement uploads fail.
- Since:
- Source:
Returns:
Labels for discarded replacements
-
Type
-
Promise.<Array.<string>>
editorSubmitMessageTemplate(attrs) → {string}
Returns the template for the message to display after the editor has
been submitted
Parameters:
| Name |
Type |
Description |
attrs |
object
|
An object containing the attributes to render
Properties
| Name |
Type |
Description |
messageText |
string
|
The message to display |
viewURL |
string
|
The URL to view the dataset |
buttonText |
string
|
The text to display on the button |
|
- Overrides:
- Source:
Returns:
The HTML template for the submit message
-
Type
-
string
enableControls()
- Since:
- Inherited From:
- Source:
enrichEditorFileTableMembers(optionsopt) → {Promise.<void>}
Fill incomplete editor rows from system metadata after the first paint.
Parameters:
| Name |
Type |
Attributes |
Description |
options |
object
|
<optional>
|
Fetch options owned by the active render |
- Since:
- Source:
Returns:
Resolves after row enrichment finishes
-
Type
-
Promise.<void>
fetchModel(optionsopt)
Fetch the metadata model.
Parameters:
| Name |
Type |
Attributes |
Description |
options |
object
|
<optional>
|
Fetch options owned by the active render
Properties
| Name |
Type |
Attributes |
Description |
renderId |
string
|
<optional>
|
Render identifier for stale guards |
signal |
AbortSignal
|
<optional>
|
Signal for fetch capable calls |
|
- Source:
finishFileReplacementPreview(rowId) → {void}
Clear the optimistic replacement state and refresh the table.
Parameters:
| Name |
Type |
Description |
rowId |
string
|
File table row identifier |
- Since:
- Source:
Returns:
-
Type
-
void
flushDraftSave()
Run a pending draft save immediately. Used only when the editor is
closing, so normal field edits stay debounced.
- Since:
- 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
getDataFileTablePosition(pid) → {number}
Return a data row's position among the table's data members.
Parameters:
| Name |
Type |
Description |
pid |
string
|
Data member PID |
- Since:
- Source:
Returns:
Zero based data row position
-
Type
-
number
getDataPackage(model, optionsopt) → {Promise.<(DataPackage|null)>}
Get the data package (resource map) associated with the EML. Save it to
MetacatUI.rootDataPackage after required baselines load. The metadata
model must already be synced. This method checks write permission on
the loaded ResourceMap and primary metadata members.
Parameters:
| Name |
Type |
Attributes |
Description |
model |
Model
|
|
The science metadata model for which to find the
associated data package |
options |
object
|
<optional>
|
Loading options owned by the active render
Properties
| Name |
Type |
Attributes |
Description |
renderId |
string
|
<optional>
|
Render identifier for stale guards |
signal |
AbortSignal
|
<optional>
|
Signal for fetch capable calls |
|
- Source:
Returns:
Loaded package, or null after a
latest version redirect
-
Type
-
Promise.<(DataPackage|null)>
getEditorFileTableRows() → {Array.<object>}
Build editor rows from the active package members.
- Since:
- Source:
Returns:
File table row definitions
-
Type
-
Array.<object>
getEditorFileTableStatus(member, type) → {object|null}
Build the editor status shown for a package member row.
Parameters:
| Name |
Type |
Description |
member |
DataPackageMember
|
Package member |
type |
string
|
Member format type |
- Since:
- Source:
Returns:
Row status or null when no status is shown
-
Type
-
object
|
null
getEditorPackageMemberLimit() → {number}
Return the configured editor member limit.
- Since:
- Source:
Returns:
Maximum package members, excluding the root ResourceMap
-
Type
-
number
getErrorListItem(error) → {string}
Creates an HTML string to display this error message on the page. Errors can be
strings, arrays of strings, arrays of literal objects with string values, or a literal object with strings as the values.
Parameters:
| Name |
Type |
Description |
error |
string
|
Array.<string>
|
object
|
A single error message in string format or a collection of error strings as an array or object |
- Since:
- Inherited From:
- Source:
Returns:
The error message HTML
-
Type
-
string
getFailedFileMessage(member) → {string}
Build the user facing label for a failed file upload.
Parameters:
- Since:
- Source:
Returns:
File label with an optional failure reason
-
Type
-
string
getFailedFileReplacements() → {Array.<DataPackageMember>}
Return failed data members that replaced an existing remote PID.
- Since:
- Source:
Returns:
Failed replacement members
-
Type
-
Array.<DataPackageMember>
getFileTablePackageMember(rowModel) → {DataPackageMember|null}
Resolve the package member represented by a file table row.
Parameters:
| Name |
Type |
Description |
rowModel |
Backbone.Model
|
File table row |
- Since:
- Source:
Returns:
Matching package member
-
Type
-
DataPackageMember
|
null
getPackageSaveMessage() → {string}
Return the current package save progress message.
- Since:
- Source:
Returns:
Save preparation or upload progress message
-
Type
-
string
getRenderOptions(optionsopt) → {Object}
Fill omitted render options from the active render.
Parameters:
| Name |
Type |
Attributes |
Description |
options |
object
|
<optional>
|
Render options
Properties
| Name |
Type |
Attributes |
Description |
renderId |
string
|
<optional>
|
Render identifier |
signal |
AbortSignal
|
<optional>
|
Cancellation signal |
|
- Since:
- Source:
Returns:
Resolved render options
-
Type
-
Object
getReplaceFileDetails(options) → {object}
Build display details for one side of the replacement comparison.
Parameters:
| Name |
Type |
Description |
options |
object
|
Detail sources
Properties
| Name |
Type |
Attributes |
Description |
pid |
string
|
|
Object PID |
member |
DataPackageMember
|
<optional>
|
Package member |
rowModel |
Backbone.Model
|
<optional>
|
File table row |
sysMeta |
SystemMetadata
|
object
|
<optional>
|
System metadata |
label |
string
|
<optional>
|
Preferred title |
|
- Since:
- Source:
Returns:
Replacement comparison details
-
Type
-
object
getRequiredFields() → {object}
- Overrides:
- Source:
Returns:
An object literal of the required fields for this EML
editor
-
Type
-
object
getUploadErrorMessage(result) → {string}
Build the editor message for a failed package upload.
Parameters:
| Name |
Type |
Description |
result |
UploadResult
|
Package upload result |
- Since:
- Source:
Returns:
User facing upload error message
-
Type
-
string
handleDataPackageLoadError(error) → {void}
Route editable package loading failures to a blocking editor message.
Parameters:
| Name |
Type |
Description |
error |
Error
|
Loading failure |
- Since:
- Source:
Returns:
-
Type
-
void
handleEagerUploadSettled(eventopt) → {void}
Clear row progress after an eager upload settles.
Parameters:
| Name |
Type |
Attributes |
Description |
event |
object
|
<optional>
|
Eager upload event payload |
- Since:
- Source:
Returns:
-
Type
-
void
handleFileLoadError(item)
Handle "fileLoadError" events by alerting the user and removing the row
from the data package table.
Parameters:
| Name |
Type |
Description |
item |
DataPackageMember
|
The member passed by fileLoadError
event |
- Source:
handleFileReadError(item)
Handle "fileReadError" events by alerting the user and removing the row
from the data package table.
Parameters:
| Name |
Type |
Description |
item |
DataPackageMember
|
The member passed by fileReadError
event |
- Source:
handleFileTableAction(rowModel, actionModel, eventopt) → {Promise.<boolean>}
Run the action selected for a file table row.
Parameters:
| Name |
Type |
Attributes |
Description |
rowModel |
Backbone.Model
|
|
File table row |
actionModel |
Backbone.Model
|
|
Selected row action |
event |
Event
|
<optional>
|
Click event |
- Since:
- Source:
Returns:
True when the action was handled
-
Type
-
Promise.<boolean>
handleFileTableFilesDrop(rowModel, files, eventopt) → {Promise.<void>}
Add files dropped on a file table row.
Parameters:
| Name |
Type |
Attributes |
Description |
rowModel |
Backbone.Model
|
|
Drop target row |
files |
FileList
|
Array.<File>
|
|
Dropped files |
event |
Event
|
<optional>
|
Drop event |
- Since:
- Source:
Returns:
Resolves after the files are handled
-
Type
-
Promise.<void>
handleFileTableRename(rowModel, proposedLabel) → {Promise.<void>}
Apply a dataset title or member filename edit from the table.
Parameters:
| Name |
Type |
Description |
rowModel |
Backbone.Model
|
Renamed row |
proposedLabel |
string
|
Proposed title or filename |
- Since:
- Source:
Returns:
Resolves after the rename attempt
-
Type
-
Promise.<void>
handleFileTableReplaceAction(rowModel) → {Promise.<boolean>}
Handle a replacement selected from a file table row.
Parameters:
| Name |
Type |
Description |
rowModel |
Backbone.Model
|
File table row |
- Since:
- Source:
Returns:
False only when no file was selected
-
Type
-
Promise.<boolean>
Example
const handled = await view.handleFileTableReplaceAction(rowModel);
handleFileTableStartAddFiles(eventopt) → {Promise.<boolean>}
Add files through the empty package prompt.
Parameters:
| Name |
Type |
Attributes |
Description |
event |
Event
|
<optional>
|
Click event |
- Since:
- Source:
Returns:
True when files were selected and handled
-
Type
-
Promise.<boolean>
If the pid for the metadata doc is not in Solr, then try fetching the
system metadata. Resolve a SID to its metadata PID, or notify the user
that an existing PID is being indexed. If the lookup fails, show a 404.
Parameters:
| Name |
Type |
Attributes |
Description |
options |
object
|
<optional>
|
Lookup options owned by the active render
Properties
| Name |
Type |
Attributes |
Description |
renderId |
string
|
<optional>
|
Render identifier for stale guards |
signal |
AbortSignal
|
<optional>
|
Signal for fetch capable calls |
|
- Since:
- Source:
handlePackageUploadPrepareProgress(progressopt) → {void}
Update the Save button during package upload preparation.
Parameters:
| Name |
Type |
Attributes |
Description |
progress |
object
|
<optional>
|
Upload preparation progress |
- Since:
- Source:
Returns:
-
Type
-
void
handlePackageUploadProgress(progressopt) → {void}
Update row and Save button progress for one upload action.
Parameters:
| Name |
Type |
Attributes |
Description |
progress |
object
|
<optional>
|
Upload action progress |
- Since:
- Source:
Returns:
-
Type
-
void
handlePackageUploadSuccess(eventopt) → {void}
Clear completed row progress after package upload actions succeed.
Parameters:
| Name |
Type |
Attributes |
Description |
event |
object
|
<optional>
|
Package upload event payload |
- Since:
- Source:
Returns:
-
Type
-
void
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 extended by each subclass of EditorView to check for unsaved changes for that model type
- Overrides:
- Source:
Returns:
Whether this editor has unsaved changes
-
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()
- Source:
isAccessPolicyEditEnabled() → {boolean}
Returns false in the base editor. Subclasses override this method to
enable access policy editing for supported model types.
- Since:
- Overrides:
- Source:
Returns:
Whether access policy editing is enabled
-
Type
-
boolean
isCurrentRender(renderId) → {boolean}
Check whether an asynchronous callback belongs to the active render.
Parameters:
| Name |
Type |
Description |
renderId |
string
|
Render identifier to check |
- Since:
- Source:
Returns:
True when the render still owns the view
-
Type
-
boolean
isDiscardableFileUploadFailure(member) → {boolean}
Return whether a failed file upload is known not to require a reload.
Parameters:
- Since:
- Source:
Returns:
Whether the failed upload can be discarded
-
Type
-
boolean
Example
view.isDiscardableFileUploadFailure(member); // true
loadError(errorMsg)
When there is an error loading the metadata, show an error message
rather than letting the spinner spin forever
Parameters:
| Name |
Type |
Description |
errorMsg |
string
|
The error message to display |
- Since:
- Source:
notAuthorized()
Shows a message if the user is not authorized to edit this package
- Source:
onClose()
Perform clean-up functions when this view is about to be removed from the page or navigated away from.
- Overrides:
- Source:
Queue metadata upload after a package relationship edit.
- Since:
- Source:
Returns:
-
Type
-
void
refreshFileTable() → {void}
Merge current package rows into the rendered file table.
- Since:
- Source:
Returns:
-
Type
-
void
removeAccessPolicyView()
Remove the current AccessPolicyView and its editor listener.
- Since:
- Inherited From:
- Source:
removeValidation()
Removes all the validation error styling and messaging from this view
- Inherited From:
- Source:
render()
Renders this view
- Overrides:
- Source:
renderAccessPolicy(modelopt, optionsopt)
Renders the AccessPolicyView
Parameters:
| Name |
Type |
Attributes |
Description |
model |
Backbone.Model
|
<optional>
|
Model to render |
options |
object
|
<optional>
|
Access policy view options
Properties
| Name |
Type |
Attributes |
Description |
policy |
Array.<object>
|
<optional>
|
System Metadata access policy |
policyContext |
object
|
<optional>
|
Policy display/editor context |
onApply |
function
|
<optional>
|
Async apply callback |
packageLevel |
boolean
|
<optional>
|
Whether this edits package
level sharing |
|
- Inherited From:
- Source:
renderAccessPolicyControl()
Adds a Share button for editing the access policy
- Inherited From:
- Source:
Render the citation header from the loaded metadata model.
Parameters:
| Name |
Type |
Description |
model |
Backbone.Model
|
Metadata model |
- Since:
- Source:
Returns:
-
Type
-
void
renderDataPackage()
Render the Data Package View and insert it into this view
- Source:
renderEditorComponents()
Render the editor components (data package view and metadata view), or,
if not authorized, render the not authorized message.
- Source:
renderEditorControls()
Adds top-level control elements to this editor.
- Inherited From:
- Source:
renderFileTableStartMessage() → {void}
Show the add files prompt for a new package with no data members.
- Since:
- Source:
Returns:
-
Type
-
void
Renders the metadata section of the EML211EditorView
Parameters:
| Name |
Type |
Description |
modelToRender |
Backbone.Model
|
The model to render |
- Source:
renderReplaceFileDetails(heading, details, classNameopt) → {jQuery}
Render one file details card for the replacement modal.
Parameters:
| Name |
Type |
Attributes |
Description |
heading |
string
|
|
Card heading |
details |
object
|
|
Replacement comparison details |
className |
string
|
<optional>
|
Additional card class |
- Since:
- Source:
Returns:
Rendered details card
-
Type
-
jQuery
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:
repairDataset(metadataPid, recoveryOptionsopt) → {Promise.<void>}
Finish an interrupted save by replaying the durable local recovery
record for a metadata document, then reload the editor. The confirmed
missing map action explicitly opts into server reconstruction (R2).
Parameters:
| Name |
Type |
Attributes |
Description |
metadataPid |
string
|
|
Orphaned metadata PID to repair |
recoveryOptions |
object
|
<optional>
|
Recovery strategy options |
- Since:
- Source:
Returns:
Resolves once repair has been attempted
-
Type
-
Promise.<void>
replaceFileFromFileTable(rowId, file, optionsopt) → {Promise.<{ok: boolean, error: (Error|undefined)}>}
Stage a file replacement and report its outcome without throwing.
Parameters:
| Name |
Type |
Attributes |
Description |
rowId |
string
|
|
Existing member PID |
file |
File
|
|
Replacement file |
options |
object
|
<optional>
|
Replacement options
Properties
| Name |
Type |
Attributes |
Description |
member |
DataPackageMember
|
<optional>
|
Member being replaced |
replacementSourcePid |
string
|
<optional>
|
Newest remote PID |
showFailureAlert |
boolean
|
<optional>
|
Whether to show an alert |
|
- Since:
- Source:
Returns:
Replacement
outcome
-
Type
-
Promise.<{ok: boolean, error: (Error|undefined)}>
save(e)
Saves all edits in the collection
Parameters:
| Name |
Type |
Description |
e |
Event
|
The DOM Event that triggerd this function |
- Overrides:
- Source:
saveDraft()
Queue a draft save of the EML model. Editing a field fires one DOM
change event per blur, and each draft serializes the whole document,
so drafts are debounced. Documents above the size cap are not drafted
at all: for those, serializing freezes (or crashes) the tab, which
costs the user more than a missing draft.
- Source:
saveDraftNow()
Serialize and store a draft of the parent EML model immediately.
- Since:
- Source:
saveError(errorMsg)
When the data package collection fails to save, tell the user
Parameters:
| Name |
Type |
Description |
errorMsg |
string
|
The error message from the failed save()
function |
- Overrides:
- Source:
saveSuccess(_result, optionsopt)
When the data package collection saves successfully, tell the user
Parameters:
| Name |
Type |
Attributes |
Description |
_result |
UploadResult
|
|
Upload result |
options |
object
|
<optional>
|
Success options
Properties
| Name |
Type |
Attributes |
Description |
skippedFileReplacements |
Array.<string>
|
<optional>
|
File replacements
skipped so the rest of the package could save |
skippedNewDataFiles |
Array.<string>
|
<optional>
|
New files omitted so the
rest of the package could save |
|
- Overrides:
- Source:
setDataPackageListeners(dataPackage) → {void}
Listen for changes and upload events from a data package.
Parameters:
| Name |
Type |
Description |
dataPackage |
DataPackage
|
Data package for the active render |
- Since:
- Source:
Returns:
-
Type
-
void
setFileTableDisabled(disabled) → {void}
Enable or disable file table interactions.
Parameters:
| Name |
Type |
Description |
disabled |
boolean
|
Whether file table controls are disabled |
- Since:
- Source:
Returns:
-
Type
-
void
setListeners()
Set listeners on the metadata model and application event dispatcher.
Reset these listeners when the metadata model is replaced.
- Overrides:
- Source:
showAccessPolicyLoadError(message)
Shows an error in the AccessPolicy modal body.
Parameters:
| Name |
Type |
Description |
message |
string
|
Error message |
- Since:
- Inherited From:
- Source:
showAccessPolicyLoadingModal(e, messageopt) → {boolean}
Shows a loading state in the AccessPolicy modal.
Parameters:
| Name |
Type |
Attributes |
Description |
e |
Event
|
|
Click event |
message |
string
|
<optional>
|
Loading message |
- Since:
- Inherited From:
- Source:
Returns:
Whether the loading modal was shown
-
Type
-
boolean
showAccessPolicyModal(e)
Show the AccessPolicy view in a modal dialog
This method calls the superclass method, feeding it the identifier
associated with the row in the package table that was clicked. The
reason for this is so the AccessPolicyView can be used for single
objects (like in the Portal editor) or an entire Collection of objects,
like in the EML editor: The superclass impelements the generic behavior
and the subclass tweaks it.
Parameters:
| Name |
Type |
Description |
e |
EventHandler
|
The click event that triggered this method |
- Overrides:
- Source:
showControls()
Show the editor footer controls (Save bar)
- Inherited From:
- Source:
showEntity(e) → {boolean}
Show the entity editor
Parameters:
| Name |
Type |
Description |
e |
Event
|
The DOM Event that triggerd this function |
- Source:
Returns:
True when the entity editor is shown
-
Type
-
boolean
Show or create the EML entity editor for a data member.
Parameters:
| Name |
Type |
Attributes |
Description |
dataPackageMember |
DataPackageMember
|
|
Member to describe |
rowModel |
Backbone.Model
|
<optional>
|
File table row |
- Since:
- Source:
Returns:
True when the entity editor is shown
-
Type
-
boolean
showEntityFromModel(model, switchToAttrTabopt)
Show the entity editor for a model
Parameters:
| Name |
Type |
Attributes |
Description |
model |
EMLEntity
|
EMLOtherEntity
|
|
The model to show |
switchToAttrTab |
boolean
|
<optional>
|
Set to true to automatically
switch to the attributes tab instead of default overview tab |
- Since:
- Source:
showError(category, errorMsg)
Log an error message for a specific category
Parameters:
| Name |
Type |
Description |
category |
string
|
The category of the error |
errorMsg |
string
|
The error message to display |
- Since:
- Source:
showFileTableAccessPolicy(rowModel, eventopt) → {Promise.<boolean>}
Load and show sharing controls for a file table row.
Parameters:
| Name |
Type |
Attributes |
Description |
rowModel |
Backbone.Model
|
|
File table row |
event |
Event
|
<optional>
|
Click event |
- Since:
- Source:
Returns:
True when the request was handled
-
Type
-
Promise.<boolean>
showFullPageAlert(message, type, emailBodyopt, emailSubjectopt)
Empty the body of this view and show a full-page alert message. The
message will not be dissmissable, and the user will not be able to
interact with the page until they refresh or navigate away. All
listeners will be removed.
Parameters:
| Name |
Type |
Attributes |
Description |
message |
string
|
|
The message to display in the alert |
type |
"warning"
|
"error"
|
"success"
|
"info"
|
|
The type of alert to
show. Defaults to "warning". |
emailBody |
string
|
<optional>
|
Optional. The body of the email to send
when the user clicks the "Email Support" button. |
emailSubject |
string
|
<optional>
|
Optional. The subject of the email to send
when the user clicks the "Email Support" button. |
- Since:
- Inherited From:
- Source:
showInterruptedSave(metadataPid)
Stop editing an older package until its interrupted save is recovered.
Parameters:
| Name |
Type |
Description |
metadataPid |
string
|
Metadata PID with a recovery record |
- Since:
- Source:
showLatestVersion()
Find the most recently updated version of the metadata
- Source:
showLeafErrors(category, errorObj)
Recursively log the leaf errors in the error object
Parameters:
| Name |
Type |
Description |
category |
string
|
The category of the error |
errorObj |
string
|
The object containing the error messages |
- Since:
- 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:
Explain why metadata from an earlier dataset version cannot be edited.
Parameters:
| Name |
Type |
Description |
error |
Error
|
Structured ResourceMap loading error |
- Since:
- Source:
Returns:
-
Type
-
void
showNotFound()
Called when there is no object found with this ID
- Inherited From:
- Source:
showNotIndexed()
Show a message to the user that the metadata document is being indexed.
This will check the user's authorization to write to the document
before showing the message. If the user is not authorized, then the not
authorized message will be shown instead.
- Since:
- Source:
showPackageMemberLimitExceeded(detailsopt) → {void}
Block editing and show support details for an oversized package.
Parameters:
| Name |
Type |
Attributes |
Description |
details |
object
|
<optional>
|
Member limit error or package details |
- Since:
- Source:
Returns:
-
Type
-
void
showReplaceFileFailedAlert(error, messageopt) → {void}
Show a temporary alert for a failed file replacement.
Parameters:
| Name |
Type |
Attributes |
Description |
error |
Error
|
|
Replacement failure |
message |
string
|
<optional>
|
User-facing message override |
- Since:
- Source:
Returns:
-
Type
-
void
showReplaceNewestVersionModal(options) → {Promise.<boolean>}
Ask whether a replacement should target a newer remote version.
Parameters:
| Name |
Type |
Description |
options |
object
|
Modal options
Properties
| Name |
Type |
Description |
rowId |
string
|
Selected row identifier |
member |
DataPackageMember
|
Selected member |
sourceDetails |
object
|
Selected version details |
latestPid |
string
|
Newest remote PID |
latestDetails |
object
|
Newest version details |
file |
File
|
Replacement file |
|
- Since:
- Source:
Returns:
True when the newest version was replaced
-
Type
-
Promise.<boolean>
showResourceMapNotEditable(error) → {void}
Show a blocking message for a ResourceMap that was found but cannot be
safely edited. Diagnostics are rendered as text so imported RDF values
cannot inject markup into the editor.
Parameters:
| Name |
Type |
Description |
error |
Error
|
Structured ResourceMap loading error |
- Since:
- Source:
Returns:
-
Type
-
void
showResourceMapNotFound(erroropt)
Show a message when no resource map was found an existing metadata
document.
Parameters:
| Name |
Type |
Attributes |
Description |
error |
Error
|
<optional>
|
Structured Resource Map loading error |
- 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:
showSkippedFilesWarning(introText, messagesopt) → {void}
Show files omitted from an otherwise successful package save.
Parameters:
| Name |
Type |
Attributes |
Description |
introText |
string
|
|
Warning introduction |
messages |
Array.<string>
|
<optional>
|
Skipped file messages |
- Since:
- Source:
Returns:
-
Type
-
void
showValidation()
Show any errors that occurred when trying to save changes
- Overrides:
- Source:
startFileReplacementPreview(rowId, memberopt) → {void}
Show an uploading state while a replacement is prepared.
Parameters:
| Name |
Type |
Attributes |
Description |
rowId |
string
|
|
File table row identifier |
member |
DataPackageMember
|
<optional>
|
Member being replaced |
- Since:
- Source:
Returns:
-
Type
-
void
startRender() → {Object}
Start a render and cancel work owned by the previous render.
- Since:
- Source:
Returns:
Render identity and
cancellation signal
-
Type
-
Object
Add missing EML entities and fill missing fields for data members documented by the metadata.
Parameters:
- Since:
- Source:
Returns:
-
Type
-
void
template(attrs) → {string}
A method that returns the initial template for the editor view
Parameters:
| Name |
Type |
Description |
attrs |
object
|
An object containing the attributes to render
Properties
| Name |
Type |
Description |
loading |
string
|
The loading message to display |
submitButtonText |
string
|
The text to display on the
submit button |
|
- Source:
Returns:
The HTML template for the editor view
-
Type
-
string
toggleControls()
Toggle the editor footer controls (Save bar)
- Source:
toggleEnableControls()
Toggles whether the Save controls for the Editor are enabled or
disabled based on various attributes of the DataPackage and its models.
- Since:
- Source:
updateDataPackageLoadProgress(progressopt) → {void}
Update the loading message for a typed DataPackage load phase.
Parameters:
| Name |
Type |
Attributes |
Description |
progress |
object
|
<optional>
|
DataPackage load progress payload |
- Since:
- Source:
Returns:
-
Type
-
void
updateFileTableMemberStatus(memberOrPid) → {Backbone.Model|null}
Update one data member row without rebuilding the table.
Parameters:
- Since:
- Source:
Returns:
Updated row model, or null when absent
-
Type
-
Backbone.Model
|
null
updateLoadingText(message)
Update the text that is shown below the spinner while the editor is
loading
Parameters:
| Name |
Type |
Description |
message |
string
|
The message to display. If not provided, the
message will not be updated. |
- Source:
waitForNextPaint() → {Promise.<void>}
Leave a rendering opportunity before continuing bulk file work.
- Since:
- Source:
Returns:
Resolves after an intervening animation frame
-
Type
-
Promise.<void>