GNLegacyAPIManager
GNLegacyAPIManager
Value
Object of R6Class
with methods for communication with
the REST API of a GeoNetwork instance using the legacy API.
Super class
geonapi::GNAbstractManager
-> GNLegacyAPIManager
Methods
Method new()
This method is used to instantiate a GNLegacyAPIManager with the url
of the
GeoNetwork and credentials to authenticate (user
/pwd
).
The keyring_backend
can be set to use a different backend for storing
the Geonetwork password/token with keyring (Default value is 'env').
The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" (for complete curl http calls logs)
Usage
GNLegacyAPIManager$new(
url,
user = NULL,
pwd = NULL,
version,
logger = NULL,
keyring_backend = "env"
)
Method login()
#' This methods attempts a connection to GeoNetwork REST API. User internally
during initialization of GNLegacyAPIManager
.
Method insertMetadata()
Inserts a metadata by file, XML object or geometa object of class
ISOMetadata
or ISOFeatureCatalogue
. If successful, returns the Geonetwork
metadata internal identifier (integer). Extra parameters geometa_validate
(TRUE
by default) and geometa_inspire
(FALSE by default) can be used with geometa objects
for perform ISO and INSPIRE validation respectively. In that case on object of class
geometa::INSPIREMetadataValidator
, with a proper user API key, should be specified as
geometa_inspireValidator
argument.
Usage
GNLegacyAPIManager$insertMetadata(
xml = NULL,
file = NULL,
geometa = NULL,
group,
category = NULL,
stylesheet = NULL,
validate = FALSE,
geometa_validate = TRUE,
geometa_inspire = FALSE,
geometa_inspireValidator = NULL
)
Arguments
xml
xml object of class XMLInternalNode-class from XML
file
file
geometa
geometa, object of class
ISOMetadata
orISOFeatureCatalogue
from geometagroup
group
category
category
stylesheet
stylesheet
validate
validate
geometa_validate
validate geometa object
geometa_inspire
validate geometa object vs. INSPIRE
geometa_inspireValidator
geometa INSPIRE validator to use
Method setPrivConfiguration()
Set the privilege configuration for a metadata. 'id' is the metadata integer id. 'config' is an object of class "GNPrivConfiguration".
Method get()
Generic getter for metadata. Possible values for by are 'id', 'uuid'. Used internally only. The 'output' argument gives the type of output to return, with possible values "id", "metadata", "info".
Method updateMetadata()
Updates a metadata by file, XML object or geometa object of class
'ISOMetadata' or 'ISOFeatureCatalogue'. Extra parameters geometa_validate
(TRUE
by default) and geometa_inspire
(FALSE by default) can be used with geometa objects
for perform ISO and INSPIRE validation respectively. In that case on object of class
geometa::INSPIREMetadataValidator
, with a proper user API key, should be specified as
geometa_inspireValidator
argument.
Usage
GNLegacyAPIManager$updateMetadata(
id,
xml = NULL,
file = NULL,
geometa = NULL,
geometa_validate = TRUE,
geometa_inspire = FALSE,
geometa_inspireValidator = NULL
)
Arguments
id
metadata id
xml
xml object of class XMLInternalNode-class from XML
file
file
geometa
geometa, object of class
ISOMetadata
orISOFeatureCatalogue
from geometageometa_validate
validate geometa object
geometa_inspire
validate geometa object vs. INSPIRE
geometa_inspireValidator
geometa INSPIRE validator to use