| 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" )
urlurl
useruser
pwdpwd
versionversion
loggerlogger
keyring_backendkeyring backend
login()This methods attempts a connection to GeoNetwork REST API. User internally
during initialization of GNLegacyAPIManager.
GNOpenAPIManager$login(user, pwd)
useruser
pwdpwd
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
downloadMetadataByUUID()Download a metadata by UUID.
GNOpenAPIManager$downloadMetadataByUUID( uuid, addSchemaLocation = TRUE, increasePopularity = TRUE, approved = TRUE, filename )
uuiduuid
addSchemaLocationadd schema location. Default is TRUE
increasePopularityincrease popularity. Default is TRUE
approvedapproved
filenameoutput filename
getMetadataByUUID()Get a metadata by UUID.
GNOpenAPIManager$getMetadataByUUID( uuid, addSchemaLocation = TRUE, increasePopularity = TRUE, approved = TRUE )
uuiduuid
addSchemaLocationadd schema location. Default is TRUE
increasePopularityincrease popularity. Default is TRUE
approvedapproved
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 )
xmlobject of class XMLInternalNode-class
filefile
geometageometa object of class ISOMetadata or ISOFeatureCatalogue
metadataTypemetadata type. By default METADATA
uuidProcessingUUID processing. By default NOTHING. Other possible value: OVERWRITE
groupgroup
categorycategory
rejectIfInvalidreject if invalid. Default FALSE
publishToAllpublish to all. Default TRUE
transformWithtransform with. Default is _none_
schemaschema
extraextra
geometa_validatevalidate geometa object
geometa_inspirevalidate geometa object vs. INSPIRE
geometa_inspireValidatorgeometa 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 )
xmlobject of class XMLInternalNode-class
filefile
geometageometa object of class ISOMetadata or ISOFeatureCatalogue
metadataTypemetadata type. By default METADATA
uuidProcessingUUID processing. By default NOTHING. Other possible value: OVERWRITE
groupgroup
categorycategory
rejectIfInvalidreject if invalid. Default FALSE
publishToAllpublish to all. Default TRUE
transformWithtransform with. Default is _none_
schemaschema
extraextra
geometa_validatevalidate geometa object
geometa_inspirevalidate geometa object vs. INSPIRE
geometa_inspireValidatorgeometa 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 )
xmlobject of class XMLInternalNode-class
filefile
geometageometa object of class ISOMetadata or ISOFeatureCatalogue
metadataTypemetadata type. By default METADATA
groupgroup
categorycategory
rejectIfInvalidreject if invalid. Default FALSE
publishToAllpublish to all. Default TRUE
transformWithtransform with. Default is _none_
schemaschema
extraextra
geometa_validatevalidate geometa object
geometa_inspirevalidate geometa object vs. INSPIRE
geometa_inspireValidatorgeometa INSPIRE validator to use
deleteMetadata()Deletes a metadata by ID
GNOpenAPIManager$deleteMetadata(id, withBackup = TRUE)
idid
withBackupproceed with backup. Default is TRUE
uploadAttachment()Uploads attachment
GNOpenAPIManager$uploadAttachment( id, file, visibility = "public", approved = TRUE )
idmetadata identifier
filefile to upload
visibilitypublic or private
approvedobject 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 = "")
idmetadata identifier
urlthumbnail URL
descthumbnail description
TRUE if published, FALSE otherwise
doiCheckPreConditions()Checks pre-conditions to publish DOI
GNOpenAPIManager$doiCheckPreConditions(id)
idmetadata 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)
idmetadata 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)
idclone()The objects of this class are cloneable with this method.
GNOpenAPIManager$clone(deep = FALSE)
deepWhether 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.