ISOAbstractObject
ISOAbstractObject
Object of R6Class
for modelling an ISO Metadata Element
R6Class
object.
getISOClassByNode(node)
Inherit the ISO class matching an XML document or node
compare(metadataElement1, metadataElement2)
Compares two metadata elements objects. Returns TRUE if they are equal, FALSE otherwise. The comparison of object is done by comparing the XML representation of the objects (since no R6 object comparison method seems to exist)
new(xml, element, namespace, defaults, attrs)
This method is used to instantiate an ISOAbstractObject
INFO(text)
Logger to report information. Used internally
WARN(text)
Logger to report warnings. Used internally
ERROR(text)
Logger to report errors. Used internally
print()
Provides a custom print output (as tree) of the current class
decode(xml)
Decodes a ISOMetadata* R6 object from XML representation
encode(addNS, validate, strict, resetSerialID, setSerialID, encoding)
Encodes a ISOMetadata* R6 object to XML representation. By default, namespace
definition will be added to XML root (addNS = TRUE
), and validation
of object will be performed (validate = TRUE
) prior to its XML encoding.
The argument strict
allows to stop the encoding in case object is not
valid, with a default value set to FALSE
. The argument setSerialID
is used by geometa to generate automatically serial IDs associated to
XML elements, in particular for GML, default value is TRUE
(recommended value).
The argument resetSerialID
is used by geometa for reseting mandatory IDs
associated to XML elements, such as GML objects, default value is TRUE
(recommended value).
validate(xml, strict)
Validates the encoded XML against ISO 19139 XML schemas. If strict
is
TRUE
, a error will be raised. Default is FALSE
.
save(file)
Saves the current metadata object XML representation to a file. This utility ensures proper indentation of XML file produced.
getNamespaceDefinition(recursive)
Gets the namespace definition of the current ISO* class. By default, only
the namespace definition of the current element is retrieved (recursive = FALSE
).
getClassName()
Gets the class name
getClass()
Gets the class
wrapBaseElement(field, fieldObj)
Wraps a base element type
setIsNull(isNull, reason)
Sets the object as null object for the XML. In case isNull
is TRUE
,
a reason should be specified among values 'inapplicable', 'missing', 'template',
'unknown', 'withheld'. By default, the reason is set 'missing'.
contains(field, metadataElement)
Indicates of the present class object contains an metadata element object for a particular list-based field.
addListElement(field, metadataElement)
Adds a metadata element to a list-based field. Returns TRUE if the element has been added, FALSE otherwise. In case an element is already added, the element will not be added and this method will return FALSE.
delListElement(field, metadataElement)
Deletes a metadata element from a list-based field. Returns TRUE if the element has been deleted, FALSE otherwise. In case an element is abstent, this method will return FALSE.
setAttr(attrKey, attrValue)
Set an attribute
setId(id, addNS)
Set an id. By default addNS
is FALSE
(no namespace prefix added).
setHref(href)
Sets an href reference
setCodeList(codeList)
Sets a codeList
setCodeListValue(codeListValue)
Sets a codeList value
setCodeSpace(codeSpace)
Set a codeSpace
setValue(value)
Set a value
isDocument()
Indicates if the object is a metadata document, typically an object of class
ISOMetadata
or ISOFeatureCatalogue
isFieldInheritedFrom(field)
Gives the parent from which the field is inherited, otherwise return NULL
.