GNOpenAPIManager | R Documentation |
GNOpenAPIManager
GNOpenAPIManager
R6Class
object.
Object of R6Class
with methods for communication with
the REST API of a GeoNetwork instance using the legacy API.
geonapi::GNAbstractManager
-> GNOpenAPIManager
new()
This method is used to instantiate a GNOpenAPIManager
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)
GNOpenAPIManager$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
login()
This methods attempts a connection to GeoNetwork REST API. User internally
during initialization of GNLegacyAPIManager
.
GNOpenAPIManager$login(user, pwd)
user
user
pwd
pwd
getGroups()
Retrieves the list of user groups available in Geonetwork
GNOpenAPIManager$getGroups()
an object of class data.frame
getTags()
Retrieves the list of tags (categories) available in Geonetwork
GNOpenAPIManager$getTags()
an object of class data.frame
getCategories()
Retrieves the list of categories (same as tags) available in Geonetwork
GNOpenAPIManager$getCategories()
an object of class data.frame
getMetadataByUUID()
Get a metadata by UUID.
GNOpenAPIManager$getMetadataByUUID( uuid, addSchemaLocation = TRUE, increasePopularity = TRUE, approved = TRUE )
uuid
uuid
addSchemaLocation
add schema location. Default is TRUE
increasePopularity
increase popularity. Default is TRUE
approved
approved
Returns an object of class ISOMetadata
(ISO 19115)
or ISOFeatureCatalogue
(ISO 19110) (from geometa package)
insertRecord()
Inserts a record by file, XML object or geometa object of class ISOMetadata
or ISOFeatureCatalogue
.
Extra parameters related to geometa objects: geometa_validate
(TRUE by default) and geometa_inspire
(FALSE by default) can be used to 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.
GNOpenAPIManager$insertRecord( xml = NULL, file = NULL, geometa = NULL, metadataType = "METADATA", uuidProcessing = "NOTHING", group, category = NULL, rejectIfInvalid = FALSE, publishToAll = TRUE, transformWith = "_none_", schema = NULL, extra = NULL, geometa_validate = TRUE, geometa_inspire = FALSE, geometa_inspireValidator = NULL )
xml
object of class XMLInternalNode-class from XML
file
file
geometa
geometa object of class ISOMetadata
or ISOFeatureCatalogue
metadataType
metadata type. By default METADATA
uuidProcessing
UUID processing. By default NOTHING
. Other possible value: OVERWRITE
group
group
category
category
rejectIfInvalid
reject if invalid. Default FALSE
publishToAll
publish to all. Default TRUE
transformWith
transform with. Default is _none_
schema
schema
extra
extra
geometa_validate
validate geometa object
geometa_inspire
validate geometa object vs. INSPIRE
geometa_inspireValidator
geometa INSPIRE validator to use
insertMetadata()
Inserts a metadata by file, XML object or geometa object of class ISOMetadata
or ISOFeatureCatalogue
.
Extra parameters related to geometa objects: geometa_validate
(TRUE by default) and geometa_inspire
(FALSE by default) can be used to 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.
GNOpenAPIManager$insertMetadata( xml = NULL, file = NULL, geometa = NULL, metadataType = "METADATA", uuidProcessing = "NOTHING", group, category = NULL, rejectIfInvalid = FALSE, publishToAll = TRUE, transformWith = "_none_", schema = NULL, extra = NULL, geometa_validate = TRUE, geometa_inspire = FALSE, geometa_inspireValidator = NULL )
xml
object of class XMLInternalNode-class from XML
file
file
geometa
geometa object of class ISOMetadata
or ISOFeatureCatalogue
metadataType
metadata type. By default METADATA
uuidProcessing
UUID processing. By default NOTHING
. Other possible value: OVERWRITE
group
group
category
category
rejectIfInvalid
reject if invalid. Default FALSE
publishToAll
publish to all. Default TRUE
transformWith
transform with. Default is _none_
schema
schema
extra
extra
geometa_validate
validate geometa object
geometa_inspire
validate geometa object vs. INSPIRE
geometa_inspireValidator
geometa INSPIRE validator to use
updateMetadata()
Inserts a metadata by file, XML object or geometa object of class ISOMetadata
or ISOFeatureCatalogue
.
Extra parameters related to geometa objects: geometa_validate
(TRUE by default) and geometa_inspire
(FALSE by default) can be used to 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.
GNOpenAPIManager$updateMetadata( xml = NULL, file = NULL, geometa = NULL, metadataType = "METADATA", group, category = NULL, rejectIfInvalid = FALSE, publishToAll = TRUE, transformWith = "_none_", schema = NULL, extra = NULL, geometa_validate = TRUE, geometa_inspire = FALSE, geometa_inspireValidator = NULL )
xml
object of class XMLInternalNode-class from XML
file
file
geometa
geometa object of class ISOMetadata
or ISOFeatureCatalogue
metadataType
metadata type. By default METADATA
group
group
category
category
rejectIfInvalid
reject if invalid. Default FALSE
publishToAll
publish to all. Default TRUE
transformWith
transform with. Default is _none_
schema
schema
extra
extra
geometa_validate
validate geometa object
geometa_inspire
validate geometa object vs. INSPIRE
geometa_inspireValidator
geometa INSPIRE validator to use
deleteMetadata()
Deletes a metadata by ID
GNOpenAPIManager$deleteMetadata(id, withBackup = TRUE)
id
id
withBackup
proceed with backup. Default is TRUE
uploadAttachment()
Uploads attachment
GNOpenAPIManager$uploadAttachment( id, file, visibility = "public", approved = TRUE )
id
metadata identifier
file
file to upload
visibility
public or private
approved
object of class logical
a named list of the uploaded attachment, including the url, size, id and type, NULL
otherwise
publishThumbnail()
Publishes thumbnail based on URL
GNOpenAPIManager$publishThumbnail(id, url, desc = "")
id
metadata identifier
url
thumbnail URL
desc
thumbnail description
TRUE
if published, FALSE
otherwise
doiCheckPreConditions()
Checks pre-conditions to publish DOI
GNOpenAPIManager$doiCheckPreConditions(id)
id
metadata identifier
TRUE
if DOI pre-conditions are fulfiled, FALSE
otherwise
createDOI()
Submit a record to the Datacite metadata store in order to create a DOI.
GNOpenAPIManager$createDOI(id)
id
metadata identifier
TRUE
if metadata record has been submitted with DOI created, FALSE
otherwise
deleteDOI()
Remove a DOI (this is not recommended, DOI are supposed to be persistent once created. This is mainly here for testing).
GNOpenAPIManager$deleteDOI(id)
id
clone()
The objects of this class are cloneable with this method.
GNOpenAPIManager$clone(deep = FALSE)
deep
Whether to make a deep clone.
Emmanuel Blondel <emmanuel.blondel1@gmail.com>
## Not run:
GNOpenAPIManager$new("http://localhost:8080/geonetwork", "admin", "geonetwork", "4.0.5")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.