GNLegacyAPIManager | R Documentation |
GNLegacyAPIManager
GNLegacyAPIManager
R6Class
object.
Object of R6Class
with methods for communication with
the REST API of a GeoNetwork instance using the legacy API.
geonapi::GNAbstractManager
-> GNLegacyAPIManager
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)
GNLegacyAPIManager$new( url, user = NULL, pwd = NULL, version, logger = NULL, keyring_backend = "env" )
url
url
user
user
pwd
pwd
version
version
logger
logger
keyring_backend
keyring backend. Default is 'env'
login()
#' This methods attempts a connection to GeoNetwork REST API. User internally
during initialization of GNLegacyAPIManager
.
GNLegacyAPIManager$login(user, pwd)
user
user
pwd
pwd
getGroups()
Retrieves the list of user groups available in Geonetwork
GNLegacyAPIManager$getGroups()
an object of class data.frame
getCategories()
Retrieves the list of categories available in Geonetwork
GNLegacyAPIManager$getCategories()
an object of class data.frame
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.
GNLegacyAPIManager$insertMetadata( xml = NULL, file = NULL, geometa = NULL, group, category = NULL, stylesheet = NULL, validate = FALSE, geometa_validate = TRUE, geometa_inspire = FALSE, geometa_inspireValidator = NULL )
xml
xml object of class XMLInternalNode-class from XML
file
file
geometa
geometa, object of class ISOMetadata
or ISOFeatureCatalogue
from geometa
group
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
setPrivConfiguration()
Set the privilege configuration for a metadata. 'id' is the metadata integer id. 'config' is an object of class "GNPrivConfiguration".
GNLegacyAPIManager$setPrivConfiguration(id, config)
id
id
config
config
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".
GNLegacyAPIManager$get(id, by, output)
id
id
by
by
output
output
getMetadataByID()
Get a metadata by Id
GNLegacyAPIManager$getMetadataByID(id)
id
id
an object of class ISOMetadata
(ISO 19115) or ISOFeatureCatalogue
(ISO 19110) (from geometa package)
getMetadataByUUID()
Get a metadata by UUID
GNLegacyAPIManager$getMetadataByUUID(uuid)
uuid
uuid
an object of class ISOMetadata
(ISO 19115) or ISOFeatureCatalogue
(ISO 19110) (from geometa package)
getInfoByID()
Get a metadata Info by Id.
GNLegacyAPIManager$getInfoByID(id)
id
id
an XML document object
getInfoByUUID()
Get a metadata Info by UUID
GNLegacyAPIManager$getInfoByUUID(uuid)
uuid
uuid
an XML document object
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.
GNLegacyAPIManager$updateMetadata( id, xml = NULL, file = NULL, geometa = NULL, geometa_validate = TRUE, geometa_inspire = FALSE, geometa_inspireValidator = NULL )
id
metadata id
xml
xml object of class XMLInternalNode-class from XML
file
file
geometa
geometa, object of class ISOMetadata
or ISOFeatureCatalogue
from geometa
geometa_validate
validate geometa object
geometa_inspire
validate geometa object vs. INSPIRE
geometa_inspireValidator
geometa INSPIRE validator to use
deleteMetadata()
Deletes metadata by Id.
GNLegacyAPIManager$deleteMetadata(id)
id
id
the id of the record deleted, NULL
otherwise
deleteMetadataAll()
Deletes all metadata
GNLegacyAPIManager$deleteMetadataAll()
clone()
The objects of this class are cloneable with this method.
GNLegacyAPIManager$clone(deep = FALSE)
deep
Whether to make a deep clone.
Emmanuel Blondel <emmanuel.blondel1@gmail.com>
## Not run:
GNLegacyAPIManager$new("http://localhost:8080/geonetwork", "admin", "geonetwork", "3.0.0")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.