Extends
- Backbone.Model
Members
nodeNameMap
The map of lower case to camel case node names needed to deal with
parsing issues with $.parseHTML(). Use this until we can figure out
issues with $.parseXML().
Methods
addAttribute(attribute, index)
Add an attribute to the attributeList, inserting it at the zero-based
index
Parameters:
Name | Type | Description |
---|---|---|
attribute |
EMLAttribute | The EMLAttribute model to add |
index |
number | The index to insert the attribute at |
defaults() → {object}
Attributes of any entity
Properties:
Name | Type | Description |
---|---|---|
xmlID |
string | The XML id of the entity |
alternateIdentifier |
Array | Zero or more alt ids |
entityName |
string | Required, the name of the entity |
entityDescription |
string | Description of the entity |
physical |
Array | Zero to many EMLPhysical objects |
physicalMD5Checksum |
string | The MD5 checksum of the physical object |
physicalSize |
string | The size of the physical object in bytes |
physicalObjectName |
string | The name of the physical object |
coverage |
Array | Zero to many EML{Geo|Taxon|Temporal}Coverage objects |
methods |
EMLMethod | Zero or one EMLMethod object |
additionalInfo |
Array | Zero to many EMLText objects |
attributeList |
EMLAttributes | Zero to many EMLAttribute objects as a collection |
constraint |
Array | Zero to many EMLConstraint objects |
references |
string | A reference to another EMLEntity by id (needs work) |
downloadID |
string | A temporary attribute until we implement the eml-physical module |
formatName |
string | A temporary attribute until we implement the eml-physical module |
nodeOrder |
Array | The order of the top level XML element nodes |
parentModel |
EML211 | The parent model this entity belongs to |
dataONEObject |
DataONEObject | Reference to the DataONEObject this EMLEntity describes |
objectXML |
string | The serialized XML of this EML entity |
objectDOM |
object | The DOM of this EML entity |
type |
string | The type of entity |
Returns:
- The default attributes
- Type
- object
formatXML(xmlString) → {string}
Format the EML XML for entities
Parameters:
Name | Type | Description |
---|---|---|
xmlString |
string | The XML string to format |
Returns:
- The formatted XML string
- Type
- string
getEMLPosition(objectDOM, nodeName) → {object}
Get the DOM node preceding the given nodeName to find what position in
the EML document the named node should be appended
Parameters:
Name | Type | Description |
---|---|---|
objectDOM |
object | The DOM object to search |
nodeName |
string | The name of the node to find |
Returns:
- The DOM node to insert after
- Type
- object
getFileName() → {string}
Get the file name for the entity
Returns:
- The file name for the entity
- Type
- string
getId() → {string}
Get the id for the entity
Returns:
- The id for the entity
- Type
- string
getParentEML() → {EML211|false}
Climbs up the model heirarchy until it finds the EML model
Returns:
- Returns the EML 211 Model or false if not
found
- Type
- EML211 | false
initialize()
listenToAttributeList()
Listen to changes on the attributeList collection and trigger change
events on the parent model and collection
parse(attrs, _options) → {object}
Parse the incoming entity's common XML elements Content example:
file-alt.1.1.txt
file-again.1.1.txt
file.1.1.txt A file
summary
Parameters:
Name | Type | Description |
---|---|---|
attrs |
object | The XML attributes |
_options |
object | Any options passed to the parse function |
Returns:
- The parsed attributes
- Type
- object
removeAttribute(attribute)
Remove an EMLAttribute model from the attributeList array
Parameters:
Name | Type | Description |
---|---|---|
attribute |
EMLAttribute | The EMLAttribute model to remove from this model's attributeList |
trickleUpChange()
Pass any change events up to the parent EML model
updateDOM(objectDOMOriginal) → {object}
Copy the original XML and update fields in a DOM object
Parameters:
Name | Type | Description |
---|---|---|
objectDOMOriginal |
object | The original DOM object |
Returns:
- The updated DOM object
- Type
- object
updateFileName()
Update the file name in the EML
validate()
validateAttributes() → {Array}
Validates each of the EMLAttribute models in the attributeList
Returns:
- Returns an array of error messages for all the
EMlAttribute models
- Type
- Array