| GNLegacyAPIManager {geonapi} | R Documentation |
GNLegacyAPIManager
Description
GNLegacyAPIManager
GNLegacyAPIManager
Format
R6Class object.
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
Public methods
Inherited 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" )
Arguments
urlurl
useruser
pwdpwd
versionversion
loggerlogger
keyring_backendkeyring backend. Default is 'env'
Method login()
#' This methods attempts a connection to GeoNetwork REST API. User internally
during initialization of GNLegacyAPIManager.
Usage
GNLegacyAPIManager$login(user, pwd)
Arguments
useruser
pwdpwd
Method getGroups()
Retrieves the list of user groups available in Geonetwork
Usage
GNLegacyAPIManager$getGroups()
Returns
an object of class data.frame
Method getCategories()
Retrieves the list of categories available in Geonetwork
Usage
GNLegacyAPIManager$getCategories()
Returns
an object of class data.frame
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
xmlxml object of class XMLInternalNode-class from XML
filefile
geometageometa, object of class
ISOMetadataorISOFeatureCataloguefrom geometagroupgroup
categorycategory
stylesheetstylesheet
validatevalidate
geometa_validatevalidate geometa object
geometa_inspirevalidate geometa object vs. INSPIRE
geometa_inspireValidatorgeometa 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".
Usage
GNLegacyAPIManager$setPrivConfiguration(id, config)
Arguments
idid
configconfig
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".
Usage
GNLegacyAPIManager$get(id, by, output)
Arguments
idid
byby
outputoutput
Method getMetadataByID()
Get a metadata by Id
Usage
GNLegacyAPIManager$getMetadataByID(id)
Arguments
idid
Returns
an object of class ISOMetadata (ISO 19115) or ISOFeatureCatalogue
(ISO 19110) (from geometa package)
Method getMetadataByUUID()
Get a metadata by UUID
Usage
GNLegacyAPIManager$getMetadataByUUID(uuid)
Arguments
uuiduuid
Returns
an object of class ISOMetadata (ISO 19115) or ISOFeatureCatalogue
(ISO 19110) (from geometa package)
Method getInfoByID()
Get a metadata Info by Id.
Usage
GNLegacyAPIManager$getInfoByID(id)
Arguments
idid
Returns
an XML document object
Method getInfoByUUID()
Get a metadata Info by UUID
Usage
GNLegacyAPIManager$getInfoByUUID(uuid)
Arguments
uuiduuid
Returns
an XML document object
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
idmetadata id
xmlxml object of class XMLInternalNode-class from XML
filefile
geometageometa, object of class
ISOMetadataorISOFeatureCataloguefrom geometageometa_validatevalidate geometa object
geometa_inspirevalidate geometa object vs. INSPIRE
geometa_inspireValidatorgeometa INSPIRE validator to use
Method deleteMetadata()
Deletes metadata by Id.
Usage
GNLegacyAPIManager$deleteMetadata(id)
Arguments
idid
Returns
the id of the record deleted, NULL otherwise
Method deleteMetadataAll()
Deletes all metadata
Usage
GNLegacyAPIManager$deleteMetadataAll()
Method clone()
The objects of this class are cloneable with this method.
Usage
GNLegacyAPIManager$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Author(s)
Emmanuel Blondel <emmanuel.blondel1@gmail.com>
Examples
## Not run:
GNLegacyAPIManager$new("http://localhost:8080/geonetwork", "admin", "geonetwork", "3.0.0")
## End(Not run)