| GNOpenAPIManager {geonapi} | R Documentation |
GNOpenAPIManager
Description
GNOpenAPIManager
GNOpenAPIManager
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 -> GNOpenAPIManager
Methods
Public methods
Inherited methods
Method 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)
Usage
GNOpenAPIManager$new( url, user = NULL, pwd = NULL, version, logger = NULL, keyring_backend = "env" )
Arguments
urlurl
useruser
pwdpwd
versionversion
loggerlogger
keyring_backendkeyring backend
Method login()
This methods attempts a connection to GeoNetwork REST API. User internally
during initialization of GNLegacyAPIManager.
Usage
GNOpenAPIManager$login(user, pwd)
Arguments
useruser
pwdpwd
Method getGroups()
Retrieves the list of user groups available in Geonetwork
Usage
GNOpenAPIManager$getGroups()
Returns
an object of class data.frame
Method getTags()
Retrieves the list of tags (categories) available in Geonetwork
Usage
GNOpenAPIManager$getTags()
Returns
an object of class data.frame
Method getCategories()
Retrieves the list of categories (same as tags) available in Geonetwork
Usage
GNOpenAPIManager$getCategories()
Returns
an object of class data.frame
Method getMetadataByUUID()
Get a metadata by UUID.
Usage
GNOpenAPIManager$getMetadataByUUID( uuid, addSchemaLocation = TRUE, increasePopularity = TRUE, approved = TRUE )
Arguments
uuiduuid
addSchemaLocationadd schema location. Default is
TRUEincreasePopularityincrease popularity. Default is
TRUEapprovedapproved
Returns
Returns an object of class ISOMetadata (ISO 19115)
or ISOFeatureCatalogue (ISO 19110) (from geometa package)
Method 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.
Usage
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 )
Arguments
xmlobject of class XMLInternalNode-class from XML
filefile
geometageometa object of class
ISOMetadataorISOFeatureCataloguemetadataTypemetadata type. By default
METADATAuuidProcessingUUID processing. By default
NOTHING. Other possible value:OVERWRITEgroupgroup
categorycategory
rejectIfInvalidreject if invalid. Default
FALSEpublishToAllpublish to all. Default
TRUEtransformWithtransform with. Default is
_none_schemaschema
extraextra
geometa_validatevalidate geometa object
geometa_inspirevalidate geometa object vs. INSPIRE
geometa_inspireValidatorgeometa INSPIRE validator to use
Method 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.
Usage
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 )
Arguments
xmlobject of class XMLInternalNode-class from XML
filefile
geometageometa object of class
ISOMetadataorISOFeatureCataloguemetadataTypemetadata type. By default
METADATAuuidProcessingUUID processing. By default
NOTHING. Other possible value:OVERWRITEgroupgroup
categorycategory
rejectIfInvalidreject if invalid. Default
FALSEpublishToAllpublish to all. Default
TRUEtransformWithtransform with. Default is
_none_schemaschema
extraextra
geometa_validatevalidate geometa object
geometa_inspirevalidate geometa object vs. INSPIRE
geometa_inspireValidatorgeometa INSPIRE validator to use
Method 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.
Usage
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 )
Arguments
xmlobject of class XMLInternalNode-class from XML
filefile
geometageometa object of class
ISOMetadataorISOFeatureCataloguemetadataTypemetadata type. By default
METADATAgroupgroup
categorycategory
rejectIfInvalidreject if invalid. Default
FALSEpublishToAllpublish to all. Default
TRUEtransformWithtransform with. Default is
_none_schemaschema
extraextra
geometa_validatevalidate geometa object
geometa_inspirevalidate geometa object vs. INSPIRE
geometa_inspireValidatorgeometa INSPIRE validator to use
Method deleteMetadata()
Deletes a metadata by ID
Usage
GNOpenAPIManager$deleteMetadata(id, withBackup = TRUE)
Arguments
idid
withBackupproceed with backup. Default is
TRUE
Method uploadAttachment()
Uploads attachment
Usage
GNOpenAPIManager$uploadAttachment( id, file, visibility = "public", approved = TRUE )
Arguments
idmetadata identifier
filefile to upload
visibilitypublic or private
approvedobject of class
logical
Returns
a named list of the uploaded attachment, including the url, size, id and type, NULL otherwise
Method publishThumbnail()
Publishes thumbnail based on URL
Usage
GNOpenAPIManager$publishThumbnail(id, url, desc = "")
Arguments
idmetadata identifier
urlthumbnail URL
descthumbnail description
Returns
TRUE if published, FALSE otherwise
Method doiCheckPreConditions()
Checks pre-conditions to publish DOI
Usage
GNOpenAPIManager$doiCheckPreConditions(id)
Arguments
idmetadata identifier
Returns
TRUE if DOI pre-conditions are fulfiled, FALSE otherwise
Method createDOI()
Submit a record to the Datacite metadata store in order to create a DOI.
Usage
GNOpenAPIManager$createDOI(id)
Arguments
idmetadata identifier
Returns
TRUE if metadata record has been submitted with DOI created, FALSE otherwise
Method deleteDOI()
Remove a DOI (this is not recommended, DOI are supposed to be persistent once created. This is mainly here for testing).
Usage
GNOpenAPIManager$deleteDOI(id)
Arguments
id
Method clone()
The objects of this class are cloneable with this method.
Usage
GNOpenAPIManager$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Author(s)
Emmanuel Blondel <emmanuel.blondel1@gmail.com>
Examples
## Not run:
GNOpenAPIManager$new("http://localhost:8080/geonetwork", "admin", "geonetwork", "4.0.5")
## End(Not run)