diff --git a/DESCRIPTION b/DESCRIPTION index 8b55e2c..dd8deb3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,4 +14,3 @@ URL: https://github.com/eblondel/geonapi/wiki, https://geonetwork-opensource.org BugReports: https://github.com/eblondel/geonapi/issues LazyLoad: yes RoxygenNote: 7.1.0 -Roxygen: list(r6 = FALSE) diff --git a/R/GNAbstractManager.R b/R/GNAbstractManager.R index 8209683..81a9ddc 100644 --- a/R/GNAbstractManager.R +++ b/R/GNAbstractManager.R @@ -9,54 +9,6 @@ #' @return Object of \code{\link{R6Class}} with methods for communication with #' the REST API of a GeoNetwork instance. #' @format \code{\link{R6Class}} object. -#' -#' @field loggerType the type of logger -#' @field verbose.info if geosapi logs have to be printed -#' @field verbose.debug if curl logs have to be printed -#' @field url the Base url of GeoNetwork -#' @field version the version of GeoNetwork. Handled as \code{GNVersion} object -#' @field lang the language for Geonetwork service. Default is \code{eng} -#' @field user the user name -#' -#' @section Methods: -#' \describe{ -#' \item{\code{new(url, user, pwd, version, logger, keyring_backend)}}{ -#' This method is used to instantiate a GNManager with the \code{url} of the -#' GeoNetwork and credentials to authenticate (\code{user}/\code{pwd}). By default, -#' the \code{logger} argument will be set to \code{NULL} (no logger). -#' -#' The \code{keyring_backend} can be set to use a different backend for storing -#' the Geonetwork password/token with \pkg{keyring} (Default value is 'env'). -#' -#' The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" -#' (for complete curl http calls logs) -#' } -#' \item{\code{logger(type, text)}}{ -#' Basic logger to report geonapi logs. Used internally -#' } -#' \item{\code{INFO(text)}}{ -#' Logger to report information. Used internally -#' } -#' \item{\code{WARN(text)}}{ -#' Logger to report warnings. Used internally -#' } -#' \item{\code{ERROR(text)}}{ -#' Logger to report errors. Used internally -#' } -#' \item{\code{getUrl()}}{ -#' Get the authentication URL -#' } -#' \item{\code{getLang()}}{ -#' Get the service lang -#' } -#' \item{\code{login(user, pwd)}}{ -#' This methods (here abstract) attempts a connection to GeoNetwork API. Used internally -#' by subclass of \code{GNAbstractManager} to login Geonetwork. -#' } -#' \item{\code{getClassName()}}{ -#' Retrieves the name of the class instance -#' } -#'} #' #' @author Emmanuel Blondel GNAbstractManager <- R6Class("GNAbstractManager", @@ -90,24 +42,56 @@ GNAbstractManager <- R6Class("GNAbstractManager", ), public = list( - #logger + #'@field verbose.info If package info log messages have to be printed out verbose.info = FALSE, + #'@field verbose.debug If curl debug log messages have to be printed out verbose.debug = FALSE, + #' @field loggerType the type of logger loggerType = NULL, + #'@description Provides log messages + #'@param type type of log ("INFO", "WARN", "ERROR") + #'@param text the log message text logger = function(type, text){ if(self$verbose.info){ cat(sprintf("[geonapi][%s] %s \n", type, text)) } }, + #'@description Provides INFO log messages + #'@param text the log message text INFO = function(text){self$logger("INFO", text)}, + #'@description Provides WARN log messages + #'@param text the log message text WARN = function(text){self$logger("WARN", text)}, + #'@description Provides ERROR log messages + #'@param text the log message text ERROR = function(text){self$logger("ERROR", text)}, - #manager + #'@field url the Base url of GeoNetwork url = NA, + #'@field version the version of GeoNetwork. Handled as \code{GNVersion} object version = NULL, + #' @field lang the language for Geonetwork service. Default is \code{eng} lang = "eng", + #'@field basicAuth if basic auth is performed basicAuth = FALSE, + + #'@description This method is used to instantiate a \link{GNAbstractManager} with the \code{url} of the + #' GeoNetwork and credentials to authenticate (\code{user}/\code{pwd}). By default, + #' the \code{logger} argument will be set to \code{NULL} (no logger). + #' + #' The \code{keyring_backend} can be set to use a different backend for storing + #' the Geonetwork password/token with \pkg{keyring} (Default value is 'env'). + #' + #' The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" + #' (for complete curl http calls logs) + #' + #' @param url url + #' @param user user + #' @param pwd pwd + #' @param version version + #' @param logger logger + #' @param keyring_backend keyring backend. Default is 'env' + #' initialize = function(url, user = NULL, pwd = NULL, version, logger = NULL, keyring_backend = 'env'){ @@ -146,26 +130,28 @@ GNAbstractManager <- R6Class("GNAbstractManager", invisible(self) }, - #getUrl - #--------------------------------------------------------------------------- + #'@description Get URL + #'@return an object of class \code{character} getUrl = function(){ return(self$url) }, - #getLang - #--------------------------------------------------------------------------- + #'@description Get service language + #'@return an object of class \code{character} getLang = function(){ return(self$lang) }, - #login - #--------------------------------------------------------------------------- + #'@description Log-ins. This methods (here abstract) attempts a connection to GeoNetwork API. Used internally + #' by subclasses of \link{GNAbstractManager} to login Geonetwork. + #'@param user user + #'@param pwd pwd login = function(user, pwd){ stop("Login method not implemented") }, - #getClassName - #--------------------------------------------------------------------------- + #'@description Get class name + #'@return an object of class \code{character} getClassName = function(){ return(class(self)[1]) } diff --git a/R/GNLegacyAPIManager.R b/R/GNLegacyAPIManager.R index c7375ff..02f33d8 100644 --- a/R/GNLegacyAPIManager.R +++ b/R/GNLegacyAPIManager.R @@ -14,110 +14,6 @@ #' \dontrun{ #' GNLegacyAPIManager$new("http://localhost:8080/geonetwork", "admin", "geonetwork", "3.0.0") #' } -#' -#'@section Abstract Methods: -#' \describe{ -#' \item{\code{new(url, user, pwd, version, logger, keyring_backend)}}{ -#' This method is used to instantiate a GNLegacyAPIManager with the \code{url} of the -#' GeoNetwork and credentials to authenticate (\code{user}/\code{pwd}). -#' -#' The \code{keyring_backend} can be set to use a different backend for storing -#' the Geonetwork password/token with \pkg{keyring} (Default value is 'env'). -#' -#' The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" -#' (for complete curl http calls logs) -#' } -#' \item{\code{logger(type, text)}}{ -#' Basic logger to report geonapi logs. Used internally -#' } -#' \item{\code{INFO(text)}}{ -#' Logger to report information. Used internally -#' } -#' \item{\code{WARN(text)}}{ -#' Logger to report warnings. Used internally -#' } -#' \item{\code{ERROR(text)}}{ -#' Logger to report errors. Used internally -#' } -#' \item{\code{getUrl()}}{ -#' Get the authentication URL -#' } -#' \item{\code{getLang()}}{ -#' Get the service lang -#' } -#'} -#' -#' @section Methods: -#' \describe{ -#' \item{\code{new(url, user, pwd, version, logger, keyring_backend)}}{ -#' This method is used to instantiate a GNLegacyAPIManager with the \code{url} of the -#' GeoNetwork and credentials to authenticate (\code{user}/\code{pwd}). -#' -#' The \code{keyring_backend} can be set to use a different backend for storing -#' the Geonetwork password/token with \pkg{keyring} (Default value is 'env'). -#' -#' The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" -#' (for complete curl http calls logs) -#' } -#' \item{\code{login(user, pwd)}}{ -#' This methods attempts a connection to GeoNetwork REST API. User internally -#' during initialization of \code{GNLegacyAPIManager}. -#' } -#' \item{\code{getGroups()}}{ -#' Retrieves the list of user groups available in Geonetwork -#' } -#' \item{\code{getCategories()}}{ -#' Retrieves the list of categories available in Geonetwork -#' } -#' \item{\code{insertMetadata(xml, file, geometa, group, category, stylesheet, validate, geometa_validate, -#' geometa_inspire, geometa_inspireValidator)}}{ -#' Inserts a metadata by file, XML object or \pkg{geometa} object of class -#' \code{ISOMetadata} or \code{ISOFeatureCatalogue}. If successful, returns the Geonetwork -#' metadata internal identifier (integer). Extra parameters \code{geometa_validate} (TRUE -#' by default) and \code{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 -#' \code{geometa::INSPIREMetadataValidator}, with a proper user API key, should be specified as -#' \code{geometa_inspireValidator} argument. -#' } -#' \item{\code{setPrivConfiguration(id, config)}}{ -#' Set the privilege configuration for a metadata. 'id' is the metadata integer id. -#' 'config' is an object of class "GNPrivConfiguration". -#' } -#' \item{\code{get(id, by, output)}}{ -#' 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". -#' } -#' \item{\code{getMetadataByID(id)}}{ -#' Get a metadata by Id. Returns an object of class \code{ISOMetadata} (ISO 19115) -#' or \code{ISOFeatureCatalogue} (ISO 19110) (from \pkg{geometa} package) -#' } -#' \item{\code{getMetadataByUUID(uuid)}}{ -#' Get a metadata by UUID. Returns an object of class \code{ISOMetadata} (ISO 19115) -#' or \code{ISOFeatureCatalogue} (ISO 19110) (from \pkg{geometa} package) -#' } -#' \item{\code{getInfoByID(id)}}{ -#' Get a metadata Info by Id. Returns an XML document object -#' } -#' \item{\code{getInfoByUUID(uuid)}}{ -#' Get a metadata Info by UUID. Returns an XML document object -#' } -#' \item{\code{updateMetadata(id, xml, file, geometa, geometa_validate, -#' geometa_inspire, geometa_inspireValidator)}}{ -#' Updates a metadata by file, XML object or \pkg{geometa} object of class -#' 'ISOMetadata' or 'ISOFeatureCatalogue'. Extra parameters \code{geometa_validate} (TRUE -#' by default) and \code{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 -#' \code{geometa::INSPIREMetadataValidator}, with a proper user API key, should be specified as -#' \code{geometa_inspireValidator} argument. -#' } -#' \item{\code{deleteMetadata(id)}}{ -#' Deletes a metadata -#' } -#' \item{\code{deleteMetadataAll()}}{ -#' Deletes all metadata for which the authenticated user is owner -#' } -#' } #' #' @author Emmanuel Blondel GNLegacyAPIManager <- R6Class("GNLegacyAPIManager", @@ -157,7 +53,20 @@ GNLegacyAPIManager <- R6Class("GNLegacyAPIManager", ), public = list( - #manager + #'@description This method is used to instantiate a GNLegacyAPIManager with the \code{url} of the + #' GeoNetwork and credentials to authenticate (\code{user}/\code{pwd}). + #' + #' The \code{keyring_backend} can be set to use a different backend for storing + #' the Geonetwork password/token with \pkg{keyring} (Default value is 'env'). + #' + #' The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" + #' (for complete curl http calls logs) + #' @param url url + #' @param user user + #' @param pwd pwd + #' @param version version + #' @param logger logger + #' @param keyring_backend keyring backend. Default is 'env' initialize = function(url, user = NULL, pwd = NULL, version, logger = NULL, keyring_backend = 'env'){ super$initialize(url, user = user, pwd = pwd, version = version, logger = logger, @@ -182,8 +91,10 @@ GNLegacyAPIManager <- R6Class("GNLegacyAPIManager", } }, - #login - #--------------------------------------------------------------------------- + #'@description #' This methods attempts a connection to GeoNetwork REST API. User internally + #' during initialization of \code{GNLegacyAPIManager}. + #'@param user user + #'@param pwd pwd login = function(user, pwd){ req <- NULL @@ -250,8 +161,8 @@ GNLegacyAPIManager <- R6Class("GNLegacyAPIManager", return(TRUE) }, - #getGroups - #--------------------------------------------------------------------------- + #'@description Retrieves the list of user groups available in Geonetwork + #'@return an object of class \code{data.frame} getGroups = function(){ out <- NULL self$INFO("Getting user groups...") @@ -282,8 +193,8 @@ GNLegacyAPIManager <- R6Class("GNLegacyAPIManager", return(out) }, - #getCategories - #--------------------------------------------------------------------------- + #'@description Retrieves the list of categories available in Geonetwork + #'@return an object of class \code{data.frame} getCategories = function(){ out <- NULL self$INFO("Getting categories...") @@ -320,8 +231,23 @@ GNLegacyAPIManager <- R6Class("GNLegacyAPIManager", return(out) }, - #insertMetadata - #--------------------------------------------------------------------------- + #'@description Inserts a metadata by file, XML object or \pkg{geometa} object of class + #' \code{ISOMetadata} or \code{ISOFeatureCatalogue}. If successful, returns the Geonetwork + #' metadata internal identifier (integer). Extra parameters \code{geometa_validate} (TRUE + #' by default) and \code{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 + #' \code{geometa::INSPIREMetadataValidator}, with a proper user API key, should be specified as + #' \code{geometa_inspireValidator} argument. + #' @param xml xml object of class \link{XMLInternalNode-class} from \pkg{XML} + #' @param file file + #' @param geometa geometa, object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue} from \pkg{geometa} + #' @param group group + #' @param category category + #' @param stylesheet stylesheet + #' @param validate validate + #' @param geometa_validate validate geometa object + #' @param geometa_inspire validate geometa object vs. INSPIRE + #' @param geometa_inspireValidator geometa INSPIRE validator to use insertMetadata = function(xml = NULL, file = NULL, geometa = NULL, group, category = NULL, stylesheet = NULL, validate = FALSE, geometa_validate = TRUE, geometa_inspire = FALSE, geometa_inspireValidator = NULL){ @@ -382,8 +308,10 @@ GNLegacyAPIManager <- R6Class("GNLegacyAPIManager", return(out) }, - #setPrivConfiguration - #--------------------------------------------------------------------------- + #'@description Set the privilege configuration for a metadata. 'id' is the metadata integer id. + #' 'config' is an object of class "GNPrivConfiguration". + #'@param id id + #'@param config config setPrivConfiguration = function(id, config){ self$INFO(sprintf("Setting privileges for metadata id = %s", id)) out <- FALSE @@ -424,8 +352,12 @@ GNLegacyAPIManager <- R6Class("GNLegacyAPIManager", }, - #get - #--------------------------------------------------------------------------- + #'@description 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". + #'@param id id + #'@param by by + #'@param output output get = function(id, by, output){ allowedByValues <- c("id","uuid") if(!(by %in% allowedByValues)){ @@ -484,32 +416,49 @@ GNLegacyAPIManager <- R6Class("GNLegacyAPIManager", return(out) }, - #getMetadataByID - #--------------------------------------------------------------------------- + #'@description Get a metadata by Id + #'@param id id + #'@return an object of class \code{ISOMetadata} (ISO 19115) or \code{ISOFeatureCatalogue} + #' (ISO 19110) (from \pkg{geometa} package) getMetadataByID = function(id){ return(self$get(id, by = "id", output = "metadata")) }, - #getMetadataByUUID - #--------------------------------------------------------------------------- + #'@description Get a metadata by UUID + #'@param uuid uuid + #'@return an object of class \code{ISOMetadata} (ISO 19115) or \code{ISOFeatureCatalogue} + #' (ISO 19110) (from \pkg{geometa} package) getMetadataByUUID = function(uuid){ return(self$get(uuid, by = "uuid", output = "metadata")) }, - #getInfoByID - #--------------------------------------------------------------------------- + #'@description Get a metadata Info by Id. + #'@param id id + #'@return an XML document object getInfoByID = function(id){ return(self$get(id, by = "id", output = "info")) }, - #getInfoByUUID - #--------------------------------------------------------------------------- + #'@description Get a metadata Info by UUID + #'@param uuid uuid + #'@return an XML document object getInfoByUUID = function(uuid){ return(self$get(uuid, by = "uuid", output = "info")) }, - #updateMetadata - #--------------------------------------------------------------------------- + #'@description Updates a metadata by file, XML object or \pkg{geometa} object of class + #' 'ISOMetadata' or 'ISOFeatureCatalogue'. Extra parameters \code{geometa_validate} (TRUE + #' by default) and \code{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 + #' \code{geometa::INSPIREMetadataValidator}, with a proper user API key, should be specified as + #' \code{geometa_inspireValidator} argument. + #' @param id metadata id + #' @param xml xml object of class \link{XMLInternalNode-class} from \pkg{XML} + #' @param file file + #' @param geometa geometa, object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue} from \pkg{geometa} + #' @param geometa_validate validate geometa object + #' @param geometa_inspire validate geometa object vs. INSPIRE + #' @param geometa_inspireValidator geometa INSPIRE validator to use updateMetadata = function(id, xml = NULL, file = NULL, geometa = NULL, geometa_validate = TRUE, geometa_inspire = FALSE, geometa_inspireValidator = NULL){ @@ -574,8 +523,9 @@ GNLegacyAPIManager <- R6Class("GNLegacyAPIManager", }, - #deleteMetadata - #--------------------------------------------------------------------------- + #'@description Deletes metadata by Id. + #'@param id id + #'@return the id of the record deleted, \code{NULL} otherwise deleteMetadata = function(id){ self$INFO(sprintf("Deleting metadata id = %s ...", id)) out <- NULL @@ -601,8 +551,7 @@ GNLegacyAPIManager <- R6Class("GNLegacyAPIManager", return(out) }, - #deleteMetadataAll - #--------------------------------------------------------------------------- + #'@description Deletes all metadata deleteMetadataAll = function(){ self$INFO("Deleting all owned metadata...") diff --git a/R/GNManager.R b/R/GNManager.R index 3ca8ed7..f196f5d 100644 --- a/R/GNManager.R +++ b/R/GNManager.R @@ -31,6 +31,13 @@ GNManager <- R6Class("GNManager", lock_class = FALSE, private = list(), public = list( + + #'@description Initializes a \link{GNManager} + #'@param url url + #'@param user user + #'@param pwd pwd + #'@param version version + #'@param logger logger initialize = function(url, user = NULL, pwd = NULL, version, logger = NULL){ #nothing done: #GNManager$new becomes static to delegate to appropriate manager diff --git a/R/GNOpenAPIManager.R b/R/GNOpenAPIManager.R index c667abd..65a1dda 100644 --- a/R/GNOpenAPIManager.R +++ b/R/GNOpenAPIManager.R @@ -14,104 +14,6 @@ #' \dontrun{ #' GNOpenAPIManager$new("http://localhost:8080/geonetwork", "admin", "geonetwork", "4.0.5") #' } -#' -#'@section Abstract Methods: -#' \describe{ -#' \item{\code{new(url, user, pwd, version, logger, keyring_backend)}}{ -#' This method is used to instantiate a \code{GNOpenAPIManager} with the \code{url} of the -#' GeoNetwork and credentials to authenticate (\code{user}/\code{pwd}). -#' -#' The \code{keyring_backend} can be set to use a different backend for storing -#' the Geonetwork password/token with \pkg{keyring} (Default value is 'env'). -#' -#' The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" -#' (for complete curl http calls logs) -#' } -#' \item{\code{logger(type, text)}}{ -#' Basic logger to report geonapi logs. Used internally -#' } -#' \item{\code{INFO(text)}}{ -#' Logger to report information. Used internally -#' } -#' \item{\code{WARN(text)}}{ -#' Logger to report warnings. Used internally -#' } -#' \item{\code{ERROR(text)}}{ -#' Logger to report errors. Used internally -#' } -#' \item{\code{getUrl()}}{ -#' Get the authentication URL -#' } -#' \item{\code{getLang()}}{ -#' Get the service lang -#' } -#'} -#' -#' @section Methods: -#' \describe{ -#' \item{\code{new(url, user, pwd, version, logger, keyring_backend)}}{ -#' This method is used to instantiate a \code{GNOpenAPIManager} with the \code{url} of the -#' GeoNetwork and credentials to authenticate (\code{user}/\code{pwd}). -#' -#' The \code{keyring_backend} can be set to use a different backend for storing -#' the Geonetwork password/token with \pkg{keyring} (Default value is 'env'). -#' -#' The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" -#' (for complete curl http calls logs) -#' -#' } -#' \item{\code{login(user, pwd)}}{ -#' This methods attempts a connection to GeoNetwork REST API. User internally -#' during initialization of \code{GNLegacyAPIManager}. -#' } -#' \item{\code{getGroups()}}{ -#' Retrieves the list of user groups available in Geonetwork -#' } -#' \item{\code{getTags()}}{ -#' Retrieves the list of tags (categories) available in Geonetwork -#' } -#' \item{\code{getCategories()}}{ -#' Same as \code{getTags()} -#' } -#' \item{\code{getMetadataByUUID(uuid)}}{ -#' Get a metadata by UUID. Returns an object of class \code{ISOMetadata} (ISO 19115) -#' or \code{ISOFeatureCatalogue} (ISO 19110) (from \pkg{geometa} package) -#' } -#' \item{\code{insertRecord(xml, file, geometa, metadataType, uuidProcessing, -#' group, category, rejectIfInvalid, publishToAll, -#' transformWith, schema, extra, -#' geometa_validate, geometa_inspire, geometa_inspireValidator)}}{ -#' Inserts a record by file, XML object or \pkg{geometa} object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue}. -#' Extra parameters related to \pkg{geometa} objects: \code{geometa_validate} (TRUE by default) and \code{geometa_inspire} -#' (FALSE by default) can be used to perform ISO and INSPIRE validation respectively. In that case on object of class -#' \code{geometa::INSPIREMetadataValidator}, with a proper user API key, should be specified as \code{geometa_inspireValidator} -#' argument. -#' } -#' \item{\code{insertMetadata(xml, file, geometa, metadataType, uuidProcessing, -#' group, category, rejectIfInvalid, publishToAll, -#' transformWith, schema, extra, -#' geometa_validate, geometa_inspire, geometa_inspireValidator)}}{ -#' Inserts a metadata by file, XML object or \pkg{geometa} object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue}. -#' Extra parameters related to \pkg{geometa} objects: \code{geometa_validate} (TRUE by default) and \code{geometa_inspire} -#' (FALSE by default) can be used to perform ISO and INSPIRE validation respectively. In that case on object of class -#' \code{geometa::INSPIREMetadataValidator}, with a proper user API key, should be specified as -#' \code{geometa_inspireValidator} argument. -#' } -#' \item{\code{updateMetadata(xml, file, geometa, metadataType, -#' group, category, rejectIfInvalid, publishToAll, -#' transformWith, schema, extra, -#' geometa_validate, geometa_inspire, geometa_inspireValidator)}}{ -#' Updates a metadata by file, XML object or \pkg{geometa} object of class -#' 'ISOMetadata' or 'ISOFeatureCatalogue'. Extra parameters \code{geometa_validate} (TRUE -#' by default) and \code{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 -#' \code{geometa::INSPIREMetadataValidator}, with a proper user API key, should be specified as -#' \code{geometa_inspireValidator} argument. -#' } -#' \item{\code{deleteMetadata(id, withBackup)}}{ -#' Deletes a metadata -#' } -#' } #' #' @author Emmanuel Blondel GNOpenAPIManager <- R6Class("GNOpenAPIManager", @@ -119,7 +21,21 @@ GNOpenAPIManager <- R6Class("GNOpenAPIManager", private = list(), public = list( - #manager + + #'@description This method is used to instantiate a \code{GNOpenAPIManager} with the \code{url} of the + #' GeoNetwork and credentials to authenticate (\code{user}/\code{pwd}). + #' + #' The \code{keyring_backend} can be set to use a different backend for storing + #' the Geonetwork password/token with \pkg{keyring} (Default value is 'env'). + #' + #' The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" + #' (for complete curl http calls logs) + #'@param url url + #'@param user user + #'@param pwd pwd + #'@param version version + #'@param logger logger + #'@param keyring_backend keyring backend initialize = function(url, user = NULL, pwd = NULL, version, logger = NULL, keyring_backend = 'env'){ super$initialize(url, user = user, pwd = pwd, version = version, logger = logger, @@ -139,8 +55,10 @@ GNOpenAPIManager <- R6Class("GNOpenAPIManager", } }, - #login - #--------------------------------------------------------------------------- + #'@description This methods attempts a connection to GeoNetwork REST API. User internally + #' during initialization of \code{GNLegacyAPIManager}. + #'@param user user + #'@param pwd pwd login = function(user, pwd){ req <- GNUtils$POST( @@ -194,8 +112,8 @@ GNOpenAPIManager <- R6Class("GNOpenAPIManager", }, - #getGroups - #--------------------------------------------------------------------------- + #'@description Retrieves the list of user groups available in Geonetwork + #'@return an object of class \code{data.frame} getGroups = function(){ out <- NULL self$INFO("Getting user groups...") @@ -224,8 +142,8 @@ GNOpenAPIManager <- R6Class("GNOpenAPIManager", return(out) }, - #getTags - #--------------------------------------------------------------------------- + #'@description Retrieves the list of tags (categories) available in Geonetwork + #'@return an object of class \code{data.frame} getTags = function(){ out <- NULL self$INFO("Getting tags (categories)...") @@ -257,14 +175,19 @@ GNOpenAPIManager <- R6Class("GNOpenAPIManager", return(out) }, - #getCategories - #--------------------------------------------------------------------------- + #'@description Retrieves the list of categories (same as tags) available in Geonetwork + #'@return an object of class \code{data.frame} getCategories = function(){ return(self$getTags()) }, - #getMetadataByUUID - #--------------------------------------------------------------------------- + #'@description Get a metadata by UUID. + #'@param uuid uuid + #'@param addSchemaLocation add schema location. Default is \code{TRUE} + #'@param increasePopularity increase popularity. Default is \code{TRUE} + #'@param approved approved + #'@return Returns an object of class \code{ISOMetadata} (ISO 19115) + #' or \code{ISOFeatureCatalogue} (ISO 19110) (from \pkg{geometa} package) getMetadataByUUID = function(uuid, addSchemaLocation = TRUE, increasePopularity = TRUE, approved = TRUE){ addSchemaLocation <- tolower(as.character(addSchemaLocation)) @@ -303,8 +226,26 @@ GNOpenAPIManager <- R6Class("GNOpenAPIManager", }, - #insertRecord - #--------------------------------------------------------------------------- + #'@description Inserts a record by file, XML object or \pkg{geometa} object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue}. + #' Extra parameters related to \pkg{geometa} objects: \code{geometa_validate} (TRUE by default) and \code{geometa_inspire} + #' (FALSE by default) can be used to perform ISO and INSPIRE validation respectively. In that case on object of class + #' \code{geometa::INSPIREMetadataValidator}, with a proper user API key, should be specified as \code{geometa_inspireValidator} + #' argument. + #'@param xml object of class \link{XMLInternalNode-class} from \pkg{XML} + #'@param file file + #'@param geometa geometa object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue} + #'@param metadataType metadata type. By default \code{METADATA} + #'@param uuidProcessing UUID processing. By default \code{NOTHING}. Other possible value: \code{OVERWRITE} + #'@param group group + #'@param category category + #'@param rejectIfInvalid reject if invalid. Default \code{FALSE} + #'@param publishToAll publish to all. Default \code{TRUE} + #'@param transformWith transform with. Default is \code{_none_} + #'@param schema schema + #'@param extra extra + #'@param geometa_validate validate geometa object + #'@param geometa_inspire validate geometa object vs. INSPIRE + #'@param geometa_inspireValidator geometa INSPIRE validator to use insertRecord = function(xml = NULL, file = NULL, geometa = NULL, metadataType = "METADATA", uuidProcessing = "NOTHING", group, category = NULL, rejectIfInvalid = FALSE, publishToAll = TRUE, @@ -392,8 +333,26 @@ GNOpenAPIManager <- R6Class("GNOpenAPIManager", return(out) }, - #insertMetadata - #--------------------------------------------------------------------------- + #'@description Inserts a metadata by file, XML object or \pkg{geometa} object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue}. + #' Extra parameters related to \pkg{geometa} objects: \code{geometa_validate} (TRUE by default) and \code{geometa_inspire} + #' (FALSE by default) can be used to perform ISO and INSPIRE validation respectively. In that case on object of class + #' \code{geometa::INSPIREMetadataValidator}, with a proper user API key, should be specified as + #' \code{geometa_inspireValidator} argument. + #'@param xml object of class \link{XMLInternalNode-class} from \pkg{XML} + #'@param file file + #'@param geometa geometa object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue} + #'@param metadataType metadata type. By default \code{METADATA} + #'@param uuidProcessing UUID processing. By default \code{NOTHING}. Other possible value: \code{OVERWRITE} + #'@param group group + #'@param category category + #'@param rejectIfInvalid reject if invalid. Default \code{FALSE} + #'@param publishToAll publish to all. Default \code{TRUE} + #'@param transformWith transform with. Default is \code{_none_} + #'@param schema schema + #'@param extra extra + #'@param geometa_validate validate geometa object + #'@param geometa_inspire validate geometa object vs. INSPIRE + #'@param geometa_inspireValidator geometa INSPIRE validator to use insertMetadata = function(xml = NULL, file = NULL, geometa = NULL, metadataType = "METADATA", uuidProcessing = "NOTHING", group, category = NULL, rejectIfInvalid = FALSE, publishToAll = TRUE, @@ -408,8 +367,25 @@ GNOpenAPIManager <- R6Class("GNOpenAPIManager", geometa_inspire = geometa_inspire, geometa_inspireValidator = geometa_inspireValidator) }, - #updateMetadata - #--------------------------------------------------------------------------- + #'@description Inserts a metadata by file, XML object or \pkg{geometa} object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue}. + #' Extra parameters related to \pkg{geometa} objects: \code{geometa_validate} (TRUE by default) and \code{geometa_inspire} + #' (FALSE by default) can be used to perform ISO and INSPIRE validation respectively. In that case on object of class + #' \code{geometa::INSPIREMetadataValidator}, with a proper user API key, should be specified as + #' \code{geometa_inspireValidator} argument. + #'@param xml object of class \link{XMLInternalNode-class} from \pkg{XML} + #'@param file file + #'@param geometa geometa object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue} + #'@param metadataType metadata type. By default \code{METADATA} + #'@param group group + #'@param category category + #'@param rejectIfInvalid reject if invalid. Default \code{FALSE} + #'@param publishToAll publish to all. Default \code{TRUE} + #'@param transformWith transform with. Default is \code{_none_} + #'@param schema schema + #'@param extra extra + #'@param geometa_validate validate geometa object + #'@param geometa_inspire validate geometa object vs. INSPIRE + #'@param geometa_inspireValidator geometa INSPIRE validator to use updateMetadata = function(xml = NULL, file = NULL, geometa = NULL, metadataType = "METADATA", group, category = NULL, rejectIfInvalid = FALSE, publishToAll = TRUE, @@ -424,8 +400,9 @@ GNOpenAPIManager <- R6Class("GNOpenAPIManager", geometa_inspire = geometa_inspire, geometa_inspireValidator = geometa_inspireValidator) }, - #deleteMetadata - #--------------------------------------------------------------------------- + #'@description Deletes a metadata by ID + #'@param id id + #'@param withBackup proceed with backup. Default is \code{TRUE} deleteMetadata = function(id, withBackup = TRUE){ self$INFO(sprintf("Deleting metadata id = %s ...", id)) out <- NULL diff --git a/R/GNPriv.R b/R/GNPriv.R index 7434705..390d9d8 100644 --- a/R/GNPriv.R +++ b/R/GNPriv.R @@ -16,19 +16,18 @@ #' priv <- GNPriv$new(group="all", privileges=c("view","dynamic","featured")) #' } #' -#' @section Methods: -#' \describe{ -#' \item{\code{new()}}{ -#' This method is used to instantiate a GNPriv object. -#' } -#' } -#' #' @author Emmanuel Blondel #' GNPriv <- R6Class("GNPriv", public = list( + #'@field group group group = NULL, + #'@field privileges privileges privileges = list(), + + #'@description Initializes a \link{GNPriv} object + #'@param group group + #'@param privileges privileges initialize = function(group, privileges){ allowedGroups <- c("guest", "intranet", "all") if(!(group %in% allowedGroups)){ diff --git a/R/GNPrivConfiguration.R b/R/GNPrivConfiguration.R index e769ff1..2babd9d 100644 --- a/R/GNPrivConfiguration.R +++ b/R/GNPrivConfiguration.R @@ -17,27 +17,21 @@ #' pcfg$setPrivileges("all", c("view","dynamic","featured")) #' } #' -#' @section Methods: -#' \describe{ -#' \item{\code{new()}}{ -#' This method is used to instantiate a GNPrivConfiguration object. -#' } -#' \item{\code{setPrivileges(group, privileges)}}{ -#' Sets the operation privileges for a particular group. Allowed group values -#' are "guest","intranet" and "all". Allowed values for operation privileges -#' are "view", "download", "editing", "notify", "dynamic" and "featured". -#' } -#' } -#' #' @author Emmanuel Blondel #' GNPrivConfiguration <- R6Class("GNPrivConfiguration", public = list( + #'@field privileges privileges privileges = list(), + + #'@description Initializes an object of class \link{GNPrivConfiguration} initialize = function(){}, - #setPrivileges - #-------------------------------------------------------------------------- + #'@description Sets the operation privileges for a particular group. Allowed group values + #' are "guest","intranet" and "all". Allowed values for operation privileges + #' are "view", "download", "editing", "notify", "dynamic" and "featured". + #'@param group group + #'@param privileges privileges setPrivileges = function(group, privileges){ priv <- GNPriv$new(group = group, privileges = privileges) groupValues <- sapply(self$privileges, function(x){return(x$group)}) diff --git a/R/GNRESTRequest.R b/R/GNRESTRequest.R index 8aefa50..ad87fb2 100644 --- a/R/GNRESTRequest.R +++ b/R/GNRESTRequest.R @@ -6,19 +6,6 @@ #' @keywords geonetwork rest api #' @return Object of \code{\link{R6Class}} for modelling a GeoNetwork REST request #' @format \code{\link{R6Class}} object. -#' -#' @section Abstract Methods: -#' \describe{ -#' \item{\code{new()}}{ -#' This method is used to instantiate a GNRESTRequest -#' } -#' \item{\code{setChild(key,value)}}{ -#' Sets a child element -#' } -#' \item{\code{encode()}}{ -#' Encodes a GNRESTRequest R6 object to XML representation -#' } -#' } #' #' @author Emmanuel Blondel #' @@ -86,17 +73,26 @@ GNRESTRequest <- R6Class("GNRESTRequest", } ), public = list( + #'@field rootName root name rootName = NULL, + #'@field children children children = list(), + #'@description Initializes a \link{GNRESTRequest} + #'@param ... any parameter to pass to the request initialize = function(...){ self$rootName = "request" self$children = list(...) }, + #'@description Set child + #'@param key key + #'@param value value setChild = function(key, value){ self$children[[key]] <- value }, + #'@description Encodes request as XML + #'@return an object of class \code{character} representing the XML encode = function(){ rootXML <- xmlOutputDOM("request") for(childName in names(self$children)){ diff --git a/R/GNVersion.R b/R/GNVersion.R index b5bde99..c88424a 100644 --- a/R/GNVersion.R +++ b/R/GNVersion.R @@ -16,22 +16,6 @@ #' version <- GNVersion$new("2.6.4") #' } #' -#' @section Methods: -#' \describe{ -#' \item{\code{new(version)}}{ -#' This method is used to instantiate a GNVersion object. -#' } -#' \item{\code{lowerThan(version)}}{ -#' Compares to a version and returns TRUE if it is lower, FALSE otherwise -#' } -#' \item{\code{greaterThan(version)}}{ -#' Compares to a version and returns TRUE if it is greater, FALSE otherwise -#' } -#' \item{\code{equalTo(version)}}{ -#' Compares to a version and returns TRUE if it is equal, FALSE otherwise -#' } -#' } -#' #' @author Emmanuel Blondel #' GNVersion <- R6Class("GNVersion", @@ -52,8 +36,12 @@ GNVersion <- R6Class("GNVersion", ), public = list( + #'@field version version version = NULL, + #'@field value value value = NULL, + #'@description Initializes an object of class \link{GNVersion} + #'@param version version initialize = function(version){ value <- private$getVersionValue(version) if(is.list(value)){ @@ -62,8 +50,9 @@ GNVersion <- R6Class("GNVersion", } }, - #lowerThan - #--------------------------------------------------------------------------- + #'@description Compares to a version and returns TRUE if it is lower, FALSE otherwise + #'@param version version + #'@return \code{TRUE} if lower, \code{FALSE} otherwise lowerThan = function(version){ lower <- FALSE if(is.character(version)){ @@ -81,8 +70,9 @@ GNVersion <- R6Class("GNVersion", return(lower) }, - #greaterThan - #--------------------------------------------------------------------------- + #'@description Compares to a version and returns TRUE if it is greater, FALSE otherwise + #'@param version version + #'@return \code{TRUE} if lower, \code{FALSE} otherwise greaterThan = function(version){ greater <- FALSE if(is.character(version)){ @@ -100,8 +90,9 @@ GNVersion <- R6Class("GNVersion", return(greater) }, - #equalTo - #--------------------------------------------------------------------------- + #'@description Compares to a version and returns TRUE if it is equal, FALSE otherwise + #'@param version version + #'@return \code{TRUE} if lower, \code{FALSE} otherwise equalTo = function(version){ equal <- FALSE if(is.character(version)){ diff --git a/man/GNAbstractManager.Rd b/man/GNAbstractManager.Rd index ffc3665..f0030e2 100644 --- a/man/GNAbstractManager.Rd +++ b/man/GNAbstractManager.Rd @@ -13,15 +13,23 @@ the REST API of a GeoNetwork instance. } \description{ GNAbstractManager -} -\section{Fields}{ +GNAbstractManager +} +\author{ +Emmanuel Blondel +} +\keyword{api} +\keyword{geonetwork} +\keyword{rest} +\section{Public fields}{ +\if{html}{\out{
}} \describe{ -\item{\code{loggerType}}{the type of logger} +\item{\code{verbose.info}}{If package info log messages have to be printed out} -\item{\code{verbose.info}}{if geosapi logs have to be printed} +\item{\code{verbose.debug}}{If curl debug log messages have to be printed out} -\item{\code{verbose.debug}}{if curl logs have to be printed} +\item{\code{loggerType}}{the type of logger} \item{\code{url}}{the Base url of GeoNetwork} @@ -29,14 +37,100 @@ GNAbstractManager \item{\code{lang}}{the language for Geonetwork service. Default is \code{eng}} -\item{\code{user}}{the user name} -}} - +\item{\code{basicAuth}}{if basic auth is performed} +} +\if{html}{\out{
}} +} \section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-logger}{\code{GNAbstractManager$logger()}} +\item \href{#method-INFO}{\code{GNAbstractManager$INFO()}} +\item \href{#method-WARN}{\code{GNAbstractManager$WARN()}} +\item \href{#method-ERROR}{\code{GNAbstractManager$ERROR()}} +\item \href{#method-new}{\code{GNAbstractManager$new()}} +\item \href{#method-getUrl}{\code{GNAbstractManager$getUrl()}} +\item \href{#method-getLang}{\code{GNAbstractManager$getLang()}} +\item \href{#method-login}{\code{GNAbstractManager$login()}} +\item \href{#method-getClassName}{\code{GNAbstractManager$getClassName()}} +\item \href{#method-clone}{\code{GNAbstractManager$clone()}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-logger}{}}} +\subsection{Method \code{logger()}}{ +Provides log messages +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNAbstractManager$logger(type, text)}\if{html}{\out{
}} +} +\subsection{Arguments}{ +\if{html}{\out{
}} \describe{ - \item{\code{new(url, user, pwd, version, logger, keyring_backend)}}{ - This method is used to instantiate a GNManager with the \code{url} of the +\item{\code{type}}{type of log ("INFO", "WARN", "ERROR")} + +\item{\code{text}}{the log message text} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-INFO}{}}} +\subsection{Method \code{INFO()}}{ +Provides INFO log messages +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNAbstractManager$INFO(text)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{text}}{the log message text} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-WARN}{}}} +\subsection{Method \code{WARN()}}{ +Provides WARN log messages +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNAbstractManager$WARN(text)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{text}}{the log message text} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-ERROR}{}}} +\subsection{Method \code{ERROR()}}{ +Provides ERROR log messages +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNAbstractManager$ERROR(text)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{text}}{the log message text} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-new}{}}} +\subsection{Method \code{new()}}{ +This method is used to instantiate a \link{GNAbstractManager} with the \code{url} of the GeoNetwork and credentials to authenticate (\code{user}/\code{pwd}). By default, the \code{logger} argument will be set to \code{NULL} (no logger). @@ -45,38 +139,109 @@ GNAbstractManager The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" (for complete curl http calls logs) - } - \item{\code{logger(type, text)}}{ - Basic logger to report geonapi logs. Used internally - } - \item{\code{INFO(text)}}{ - Logger to report information. Used internally - } - \item{\code{WARN(text)}}{ - Logger to report warnings. Used internally - } - \item{\code{ERROR(text)}}{ - Logger to report errors. Used internally - } - \item{\code{getUrl()}}{ - Get the authentication URL - } - \item{\code{getLang()}}{ - Get the service lang - } - \item{\code{login(user, pwd)}}{ - This methods (here abstract) attempts a connection to GeoNetwork API. Used internally - by subclass of \code{GNAbstractManager} to login Geonetwork. - } - \item{\code{getClassName()}}{ - Retrieves the name of the class instance - } +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNAbstractManager$new( + url, + user = NULL, + pwd = NULL, + version, + logger = NULL, + keyring_backend = "env" +)}\if{html}{\out{
}} } + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{url}}{url} + +\item{\code{user}}{user} + +\item{\code{pwd}}{pwd} + +\item{\code{version}}{version} + +\item{\code{logger}}{logger} + +\item{\code{keyring_backend}}{keyring backend. Default is 'env'} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-getUrl}{}}} +\subsection{Method \code{getUrl()}}{ +Get URL +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNAbstractManager$getUrl()}\if{html}{\out{
}} } -\author{ -Emmanuel Blondel +\subsection{Returns}{ +an object of class \code{character} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-getLang}{}}} +\subsection{Method \code{getLang()}}{ +Get service language +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNAbstractManager$getLang()}\if{html}{\out{
}} +} + +\subsection{Returns}{ +an object of class \code{character} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-login}{}}} +\subsection{Method \code{login()}}{ +Log-ins. This methods (here abstract) attempts a connection to GeoNetwork API. Used internally + by subclasses of \link{GNAbstractManager} to login Geonetwork. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNAbstractManager$login(user, pwd)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{user}}{user} + +\item{\code{pwd}}{pwd} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-getClassName}{}}} +\subsection{Method \code{getClassName()}}{ +Get class name +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNAbstractManager$getClassName()}\if{html}{\out{
}} +} + +\subsection{Returns}{ +an object of class \code{character} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNAbstractManager$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} } -\keyword{api} -\keyword{geonetwork} -\keyword{rest} diff --git a/man/GNLegacyAPIManager.Rd b/man/GNLegacyAPIManager.Rd index 7d72015..23df660 100644 --- a/man/GNLegacyAPIManager.Rd +++ b/man/GNLegacyAPIManager.Rd @@ -13,46 +13,62 @@ the REST API of a GeoNetwork instance using the legacy API. } \description{ GNLegacyAPIManager -} -\section{Abstract Methods}{ -\describe{ - \item{\code{new(url, user, pwd, version, logger, keyring_backend)}}{ - This method is used to instantiate a GNLegacyAPIManager with the \code{url} of the - GeoNetwork and credentials to authenticate (\code{user}/\code{pwd}). - - The \code{keyring_backend} can be set to use a different backend for storing - the Geonetwork password/token with \pkg{keyring} (Default value is 'env'). - - The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" - (for complete curl http calls logs) - } - \item{\code{logger(type, text)}}{ - Basic logger to report geonapi logs. Used internally - } - \item{\code{INFO(text)}}{ - Logger to report information. Used internally - } - \item{\code{WARN(text)}}{ - Logger to report warnings. Used internally - } - \item{\code{ERROR(text)}}{ - Logger to report errors. Used internally - } - \item{\code{getUrl()}}{ - Get the authentication URL - } - \item{\code{getLang()}}{ - Get the service lang - } +GNLegacyAPIManager } +\examples{ +\dontrun{ + GNLegacyAPIManager$new("http://localhost:8080/geonetwork", "admin", "geonetwork", "3.0.0") } +} +\author{ +Emmanuel Blondel +} +\keyword{api} +\keyword{geonetwork} +\keyword{rest} +\section{Super class}{ +\code{\link[geonapi:GNAbstractManager]{geonapi::GNAbstractManager}} -> \code{GNLegacyAPIManager} +} \section{Methods}{ - -\describe{ - \item{\code{new(url, user, pwd, version, logger, keyring_backend)}}{ - This method is used to instantiate a GNLegacyAPIManager with the \code{url} of the +\subsection{Public methods}{ +\itemize{ +\item \href{#method-new}{\code{GNLegacyAPIManager$new()}} +\item \href{#method-login}{\code{GNLegacyAPIManager$login()}} +\item \href{#method-getGroups}{\code{GNLegacyAPIManager$getGroups()}} +\item \href{#method-getCategories}{\code{GNLegacyAPIManager$getCategories()}} +\item \href{#method-insertMetadata}{\code{GNLegacyAPIManager$insertMetadata()}} +\item \href{#method-setPrivConfiguration}{\code{GNLegacyAPIManager$setPrivConfiguration()}} +\item \href{#method-get}{\code{GNLegacyAPIManager$get()}} +\item \href{#method-getMetadataByID}{\code{GNLegacyAPIManager$getMetadataByID()}} +\item \href{#method-getMetadataByUUID}{\code{GNLegacyAPIManager$getMetadataByUUID()}} +\item \href{#method-getInfoByID}{\code{GNLegacyAPIManager$getInfoByID()}} +\item \href{#method-getInfoByUUID}{\code{GNLegacyAPIManager$getInfoByUUID()}} +\item \href{#method-updateMetadata}{\code{GNLegacyAPIManager$updateMetadata()}} +\item \href{#method-deleteMetadata}{\code{GNLegacyAPIManager$deleteMetadata()}} +\item \href{#method-deleteMetadataAll}{\code{GNLegacyAPIManager$deleteMetadataAll()}} +\item \href{#method-clone}{\code{GNLegacyAPIManager$clone()}} +} +} +\if{html}{ +\out{
Inherited methods} +\itemize{ +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-ERROR}{\code{geonapi::GNAbstractManager$ERROR()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-getClassName}{\code{geonapi::GNAbstractManager$getClassName()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-getLang}{\code{geonapi::GNAbstractManager$getLang()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-getUrl}{\code{geonapi::GNAbstractManager$getUrl()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-INFO}{\code{geonapi::GNAbstractManager$INFO()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-logger}{\code{geonapi::GNAbstractManager$logger()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-WARN}{\code{geonapi::GNAbstractManager$WARN()}}\out{} +} +\out{
} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-new}{}}} +\subsection{Method \code{new()}}{ +This method is used to instantiate a GNLegacyAPIManager with the \code{url} of the GeoNetwork and credentials to authenticate (\code{user}/\code{pwd}). The \code{keyring_backend} can be set to use a different backend for storing @@ -60,77 +76,345 @@ GNLegacyAPIManager The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" (for complete curl http calls logs) - } - \item{\code{login(user, pwd)}}{ - This methods attempts a connection to GeoNetwork REST API. User internally +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNLegacyAPIManager$new( + url, + user = NULL, + pwd = NULL, + version, + logger = NULL, + keyring_backend = "env" +)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{url}}{url} + +\item{\code{user}}{user} + +\item{\code{pwd}}{pwd} + +\item{\code{version}}{version} + +\item{\code{logger}}{logger} + +\item{\code{keyring_backend}}{keyring backend. Default is 'env'} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-login}{}}} +\subsection{Method \code{login()}}{ +#' This methods attempts a connection to GeoNetwork REST API. User internally during initialization of \code{GNLegacyAPIManager}. - } - \item{\code{getGroups()}}{ - Retrieves the list of user groups available in Geonetwork - } - \item{\code{getCategories()}}{ - Retrieves the list of categories available in Geonetwork - } - \item{\code{insertMetadata(xml, file, geometa, group, category, stylesheet, validate, geometa_validate, - geometa_inspire, geometa_inspireValidator)}}{ - Inserts a metadata by file, XML object or \pkg{geometa} object of class +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNLegacyAPIManager$login(user, pwd)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{user}}{user} + +\item{\code{pwd}}{pwd} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-getGroups}{}}} +\subsection{Method \code{getGroups()}}{ +Retrieves the list of user groups available in Geonetwork +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNLegacyAPIManager$getGroups()}\if{html}{\out{
}} +} + +\subsection{Returns}{ +an object of class \code{data.frame} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-getCategories}{}}} +\subsection{Method \code{getCategories()}}{ +Retrieves the list of categories available in Geonetwork +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNLegacyAPIManager$getCategories()}\if{html}{\out{
}} +} + +\subsection{Returns}{ +an object of class \code{data.frame} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-insertMetadata}{}}} +\subsection{Method \code{insertMetadata()}}{ +Inserts a metadata by file, XML object or \pkg{geometa} object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue}. If successful, returns the Geonetwork metadata internal identifier (integer). Extra parameters \code{geometa_validate} (TRUE by default) and \code{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 \code{geometa::INSPIREMetadataValidator}, with a proper user API key, should be specified as - \code{geometa_inspireValidator} argument. - } - \item{\code{setPrivConfiguration(id, config)}}{ - Set the privilege configuration for a metadata. 'id' is the metadata integer id. + \code{geometa_inspireValidator} argument. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNLegacyAPIManager$insertMetadata( + xml = NULL, + file = NULL, + geometa = NULL, + group, + category = NULL, + stylesheet = NULL, + validate = FALSE, + geometa_validate = TRUE, + geometa_inspire = FALSE, + geometa_inspireValidator = NULL +)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{xml}}{xml object of class \link{XMLInternalNode-class} from \pkg{XML}} + +\item{\code{file}}{file} + +\item{\code{geometa}}{geometa, object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue} from \pkg{geometa}} + +\item{\code{group}}{group} + +\item{\code{category}}{category} + +\item{\code{stylesheet}}{stylesheet} + +\item{\code{validate}}{validate} + +\item{\code{geometa_validate}}{validate geometa object} + +\item{\code{geometa_inspire}}{validate geometa object vs. INSPIRE} + +\item{\code{geometa_inspireValidator}}{geometa INSPIRE validator to use} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-setPrivConfiguration}{}}} +\subsection{Method \code{setPrivConfiguration()}}{ +Set the privilege configuration for a metadata. 'id' is the metadata integer id. 'config' is an object of class "GNPrivConfiguration". - } - \item{\code{get(id, by, output)}}{ - Generic getter for metadata. Possible values for by are 'id', 'uuid'. Used +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNLegacyAPIManager$setPrivConfiguration(id, config)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{id}}{id} + +\item{\code{config}}{config} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-get}{}}} +\subsection{Method \code{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". - } - \item{\code{getMetadataByID(id)}}{ - Get a metadata by Id. Returns an object of class \code{ISOMetadata} (ISO 19115) - or \code{ISOFeatureCatalogue} (ISO 19110) (from \pkg{geometa} package) - } - \item{\code{getMetadataByUUID(uuid)}}{ - Get a metadata by UUID. Returns an object of class \code{ISOMetadata} (ISO 19115) - or \code{ISOFeatureCatalogue} (ISO 19110) (from \pkg{geometa} package) - } - \item{\code{getInfoByID(id)}}{ - Get a metadata Info by Id. Returns an XML document object - } - \item{\code{getInfoByUUID(uuid)}}{ - Get a metadata Info by UUID. Returns an XML document object - } - \item{\code{updateMetadata(id, xml, file, geometa, geometa_validate, - geometa_inspire, geometa_inspireValidator)}}{ - Updates a metadata by file, XML object or \pkg{geometa} object of class +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNLegacyAPIManager$get(id, by, output)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{id}}{id} + +\item{\code{by}}{by} + +\item{\code{output}}{output} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-getMetadataByID}{}}} +\subsection{Method \code{getMetadataByID()}}{ +Get a metadata by Id +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNLegacyAPIManager$getMetadataByID(id)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{id}}{id} +} +\if{html}{\out{
}} +} +\subsection{Returns}{ +an object of class \code{ISOMetadata} (ISO 19115) or \code{ISOFeatureCatalogue} +(ISO 19110) (from \pkg{geometa} package) +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-getMetadataByUUID}{}}} +\subsection{Method \code{getMetadataByUUID()}}{ +Get a metadata by UUID +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNLegacyAPIManager$getMetadataByUUID(uuid)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{uuid}}{uuid} +} +\if{html}{\out{
}} +} +\subsection{Returns}{ +an object of class \code{ISOMetadata} (ISO 19115) or \code{ISOFeatureCatalogue} +(ISO 19110) (from \pkg{geometa} package) +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-getInfoByID}{}}} +\subsection{Method \code{getInfoByID()}}{ +Get a metadata Info by Id. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNLegacyAPIManager$getInfoByID(id)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{id}}{id} +} +\if{html}{\out{
}} +} +\subsection{Returns}{ +an XML document object +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-getInfoByUUID}{}}} +\subsection{Method \code{getInfoByUUID()}}{ +Get a metadata Info by UUID +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNLegacyAPIManager$getInfoByUUID(uuid)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{uuid}}{uuid} +} +\if{html}{\out{
}} +} +\subsection{Returns}{ +an XML document object +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-updateMetadata}{}}} +\subsection{Method \code{updateMetadata()}}{ +Updates a metadata by file, XML object or \pkg{geometa} object of class 'ISOMetadata' or 'ISOFeatureCatalogue'. Extra parameters \code{geometa_validate} (TRUE by default) and \code{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 \code{geometa::INSPIREMetadataValidator}, with a proper user API key, should be specified as - \code{geometa_inspireValidator} argument. - } - \item{\code{deleteMetadata(id)}}{ - Deletes a metadata - } - \item{\code{deleteMetadataAll()}}{ - Deletes all metadata for which the authenticated user is owner - } + \code{geometa_inspireValidator} argument. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNLegacyAPIManager$updateMetadata( + id, + xml = NULL, + file = NULL, + geometa = NULL, + geometa_validate = TRUE, + geometa_inspire = FALSE, + geometa_inspireValidator = NULL +)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{id}}{metadata id} + +\item{\code{xml}}{xml object of class \link{XMLInternalNode-class} from \pkg{XML}} + +\item{\code{file}}{file} + +\item{\code{geometa}}{geometa, object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue} from \pkg{geometa}} + +\item{\code{geometa_validate}}{validate geometa object} + +\item{\code{geometa_inspire}}{validate geometa object vs. INSPIRE} + +\item{\code{geometa_inspireValidator}}{geometa INSPIRE validator to use} } +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-deleteMetadata}{}}} +\subsection{Method \code{deleteMetadata()}}{ +Deletes metadata by Id. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNLegacyAPIManager$deleteMetadata(id)}\if{html}{\out{
}} } -\examples{ -\dontrun{ - GNLegacyAPIManager$new("http://localhost:8080/geonetwork", "admin", "geonetwork", "3.0.0") +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{id}}{id} +} +\if{html}{\out{
}} +} +\subsection{Returns}{ +the id of the record deleted, \code{NULL} otherwise +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-deleteMetadataAll}{}}} +\subsection{Method \code{deleteMetadataAll()}}{ +Deletes all metadata +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNLegacyAPIManager$deleteMetadataAll()}\if{html}{\out{
}} } } -\author{ -Emmanuel Blondel +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNLegacyAPIManager$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} } -\keyword{api} -\keyword{geonetwork} -\keyword{rest} diff --git a/man/GNManager.Rd b/man/GNManager.Rd index 3a400e9..9352fc1 100644 --- a/man/GNManager.Rd +++ b/man/GNManager.Rd @@ -31,3 +31,70 @@ Emmanuel Blondel \keyword{api} \keyword{geonetwork} \keyword{rest} +\section{Super class}{ +\code{\link[geonapi:GNAbstractManager]{geonapi::GNAbstractManager}} -> \code{GNManager} +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-new}{\code{GNManager$new()}} +\item \href{#method-clone}{\code{GNManager$clone()}} +} +} +\if{html}{ +\out{
Inherited methods} +\itemize{ +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-ERROR}{\code{geonapi::GNAbstractManager$ERROR()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-getClassName}{\code{geonapi::GNAbstractManager$getClassName()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-getLang}{\code{geonapi::GNAbstractManager$getLang()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-getUrl}{\code{geonapi::GNAbstractManager$getUrl()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-INFO}{\code{geonapi::GNAbstractManager$INFO()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-logger}{\code{geonapi::GNAbstractManager$logger()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-login}{\code{geonapi::GNAbstractManager$login()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-WARN}{\code{geonapi::GNAbstractManager$WARN()}}\out{} +} +\out{
} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-new}{}}} +\subsection{Method \code{new()}}{ +Initializes a \link{GNManager} +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNManager$new(url, user = NULL, pwd = NULL, version, logger = NULL)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{url}}{url} + +\item{\code{user}}{user} + +\item{\code{pwd}}{pwd} + +\item{\code{version}}{version} + +\item{\code{logger}}{logger} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNManager$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} +} diff --git a/man/GNOpenAPIManager.Rd b/man/GNOpenAPIManager.Rd index 2756d76..9b564e3 100644 --- a/man/GNOpenAPIManager.Rd +++ b/man/GNOpenAPIManager.Rd @@ -12,13 +12,59 @@ Object of \code{\link{R6Class}} with methods for communication with the REST API of a GeoNetwork instance using the legacy API. } \description{ +GNOpenAPIManager + GNOpenAPIManager } -\section{Abstract Methods}{ +\examples{ +\dontrun{ + GNOpenAPIManager$new("http://localhost:8080/geonetwork", "admin", "geonetwork", "4.0.5") +} -\describe{ - \item{\code{new(url, user, pwd, version, logger, keyring_backend)}}{ - This method is used to instantiate a \code{GNOpenAPIManager} with the \code{url} of the +} +\author{ +Emmanuel Blondel +} +\keyword{api} +\keyword{geonetwork} +\keyword{rest} +\section{Super class}{ +\code{\link[geonapi:GNAbstractManager]{geonapi::GNAbstractManager}} -> \code{GNOpenAPIManager} +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-new}{\code{GNOpenAPIManager$new()}} +\item \href{#method-login}{\code{GNOpenAPIManager$login()}} +\item \href{#method-getGroups}{\code{GNOpenAPIManager$getGroups()}} +\item \href{#method-getTags}{\code{GNOpenAPIManager$getTags()}} +\item \href{#method-getCategories}{\code{GNOpenAPIManager$getCategories()}} +\item \href{#method-getMetadataByUUID}{\code{GNOpenAPIManager$getMetadataByUUID()}} +\item \href{#method-insertRecord}{\code{GNOpenAPIManager$insertRecord()}} +\item \href{#method-insertMetadata}{\code{GNOpenAPIManager$insertMetadata()}} +\item \href{#method-updateMetadata}{\code{GNOpenAPIManager$updateMetadata()}} +\item \href{#method-deleteMetadata}{\code{GNOpenAPIManager$deleteMetadata()}} +\item \href{#method-clone}{\code{GNOpenAPIManager$clone()}} +} +} +\if{html}{ +\out{
Inherited methods} +\itemize{ +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-ERROR}{\code{geonapi::GNAbstractManager$ERROR()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-getClassName}{\code{geonapi::GNAbstractManager$getClassName()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-getLang}{\code{geonapi::GNAbstractManager$getLang()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-getUrl}{\code{geonapi::GNAbstractManager$getUrl()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-INFO}{\code{geonapi::GNAbstractManager$INFO()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-logger}{\code{geonapi::GNAbstractManager$logger()}}\out{} +\item \out{}\href{../../geonapi/html/GNAbstractManager.html#method-WARN}{\code{geonapi::GNAbstractManager$WARN()}}\out{} +} +\out{
} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-new}{}}} +\subsection{Method \code{new()}}{ +This method is used to instantiate a \code{GNOpenAPIManager} with the \code{url} of the GeoNetwork and credentials to authenticate (\code{user}/\code{pwd}). The \code{keyring_backend} can be set to use a different backend for storing @@ -26,105 +72,352 @@ GNOpenAPIManager The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" (for complete curl http calls logs) - } - \item{\code{logger(type, text)}}{ - Basic logger to report geonapi logs. Used internally - } - \item{\code{INFO(text)}}{ - Logger to report information. Used internally - } - \item{\code{WARN(text)}}{ - Logger to report warnings. Used internally - } - \item{\code{ERROR(text)}}{ - Logger to report errors. Used internally - } - \item{\code{getUrl()}}{ - Get the authentication URL - } - \item{\code{getLang()}}{ - Get the service lang - } +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNOpenAPIManager$new( + url, + user = NULL, + pwd = NULL, + version, + logger = NULL, + keyring_backend = "env" +)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{url}}{url} + +\item{\code{user}}{user} + +\item{\code{pwd}}{pwd} + +\item{\code{version}}{version} + +\item{\code{logger}}{logger} + +\item{\code{keyring_backend}}{keyring backend} +} +\if{html}{\out{
}} } } +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-login}{}}} +\subsection{Method \code{login()}}{ +This methods attempts a connection to GeoNetwork REST API. User internally + during initialization of \code{GNLegacyAPIManager}. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNOpenAPIManager$login(user, pwd)}\if{html}{\out{
}} +} -\section{Methods}{ +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{user}}{user} +\item{\code{pwd}}{pwd} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-getGroups}{}}} +\subsection{Method \code{getGroups()}}{ +Retrieves the list of user groups available in Geonetwork +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNOpenAPIManager$getGroups()}\if{html}{\out{
}} +} + +\subsection{Returns}{ +an object of class \code{data.frame} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-getTags}{}}} +\subsection{Method \code{getTags()}}{ +Retrieves the list of tags (categories) available in Geonetwork +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNOpenAPIManager$getTags()}\if{html}{\out{
}} +} + +\subsection{Returns}{ +an object of class \code{data.frame} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-getCategories}{}}} +\subsection{Method \code{getCategories()}}{ +Retrieves the list of categories (same as tags) available in Geonetwork +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNOpenAPIManager$getCategories()}\if{html}{\out{
}} +} + +\subsection{Returns}{ +an object of class \code{data.frame} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-getMetadataByUUID}{}}} +\subsection{Method \code{getMetadataByUUID()}}{ +Get a metadata by UUID. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNOpenAPIManager$getMetadataByUUID( + uuid, + addSchemaLocation = TRUE, + increasePopularity = TRUE, + approved = TRUE +)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} \describe{ - \item{\code{new(url, user, pwd, version, logger, keyring_backend)}}{ - This method is used to instantiate a \code{GNOpenAPIManager} with the \code{url} of the - GeoNetwork and credentials to authenticate (\code{user}/\code{pwd}). - - The \code{keyring_backend} can be set to use a different backend for storing - the Geonetwork password/token with \pkg{keyring} (Default value is 'env'). - - The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" - (for complete curl http calls logs) - - } - \item{\code{login(user, pwd)}}{ - This methods attempts a connection to GeoNetwork REST API. User internally - during initialization of \code{GNLegacyAPIManager}. - } - \item{\code{getGroups()}}{ - Retrieves the list of user groups available in Geonetwork - } - \item{\code{getTags()}}{ - Retrieves the list of tags (categories) available in Geonetwork - } - \item{\code{getCategories()}}{ - Same as \code{getTags()} - } - \item{\code{getMetadataByUUID(uuid)}}{ - Get a metadata by UUID. Returns an object of class \code{ISOMetadata} (ISO 19115) - or \code{ISOFeatureCatalogue} (ISO 19110) (from \pkg{geometa} package) - } - \item{\code{insertRecord(xml, file, geometa, metadataType, uuidProcessing, - group, category, rejectIfInvalid, publishToAll, - transformWith, schema, extra, - geometa_validate, geometa_inspire, geometa_inspireValidator)}}{ - Inserts a record by file, XML object or \pkg{geometa} object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue}. +\item{\code{uuid}}{uuid} + +\item{\code{addSchemaLocation}}{add schema location. Default is \code{TRUE}} + +\item{\code{increasePopularity}}{increase popularity. Default is \code{TRUE}} + +\item{\code{approved}}{approved} +} +\if{html}{\out{
}} +} +\subsection{Returns}{ +Returns an object of class \code{ISOMetadata} (ISO 19115) +or \code{ISOFeatureCatalogue} (ISO 19110) (from \pkg{geometa} package) +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-insertRecord}{}}} +\subsection{Method \code{insertRecord()}}{ +Inserts a record by file, XML object or \pkg{geometa} object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue}. Extra parameters related to \pkg{geometa} objects: \code{geometa_validate} (TRUE by default) and \code{geometa_inspire} (FALSE by default) can be used to perform ISO and INSPIRE validation respectively. In that case on object of class \code{geometa::INSPIREMetadataValidator}, with a proper user API key, should be specified as \code{geometa_inspireValidator} argument. - } - \item{\code{insertMetadata(xml, file, geometa, metadataType, uuidProcessing, - group, category, rejectIfInvalid, publishToAll, - transformWith, schema, extra, - geometa_validate, geometa_inspire, geometa_inspireValidator)}}{ - Inserts a metadata by file, XML object or \pkg{geometa} object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue}. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{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 +)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{xml}}{object of class \link{XMLInternalNode-class} from \pkg{XML}} + +\item{\code{file}}{file} + +\item{\code{geometa}}{geometa object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue}} + +\item{\code{metadataType}}{metadata type. By default \code{METADATA}} + +\item{\code{uuidProcessing}}{UUID processing. By default \code{NOTHING}. Other possible value: \code{OVERWRITE}} + +\item{\code{group}}{group} + +\item{\code{category}}{category} + +\item{\code{rejectIfInvalid}}{reject if invalid. Default \code{FALSE}} + +\item{\code{publishToAll}}{publish to all. Default \code{TRUE}} + +\item{\code{transformWith}}{transform with. Default is \code{_none_}} + +\item{\code{schema}}{schema} + +\item{\code{extra}}{extra} + +\item{\code{geometa_validate}}{validate geometa object} + +\item{\code{geometa_inspire}}{validate geometa object vs. INSPIRE} + +\item{\code{geometa_inspireValidator}}{geometa INSPIRE validator to use} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-insertMetadata}{}}} +\subsection{Method \code{insertMetadata()}}{ +Inserts a metadata by file, XML object or \pkg{geometa} object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue}. Extra parameters related to \pkg{geometa} objects: \code{geometa_validate} (TRUE by default) and \code{geometa_inspire} (FALSE by default) can be used to perform ISO and INSPIRE validation respectively. In that case on object of class \code{geometa::INSPIREMetadataValidator}, with a proper user API key, should be specified as \code{geometa_inspireValidator} argument. - } - \item{\code{updateMetadata(xml, file, geometa, metadataType, - group, category, rejectIfInvalid, publishToAll, - transformWith, schema, extra, - geometa_validate, geometa_inspire, geometa_inspireValidator)}}{ - Updates a metadata by file, XML object or \pkg{geometa} object of class - 'ISOMetadata' or 'ISOFeatureCatalogue'. Extra parameters \code{geometa_validate} (TRUE - by default) and \code{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 +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{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 +)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{xml}}{object of class \link{XMLInternalNode-class} from \pkg{XML}} + +\item{\code{file}}{file} + +\item{\code{geometa}}{geometa object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue}} + +\item{\code{metadataType}}{metadata type. By default \code{METADATA}} + +\item{\code{uuidProcessing}}{UUID processing. By default \code{NOTHING}. Other possible value: \code{OVERWRITE}} + +\item{\code{group}}{group} + +\item{\code{category}}{category} + +\item{\code{rejectIfInvalid}}{reject if invalid. Default \code{FALSE}} + +\item{\code{publishToAll}}{publish to all. Default \code{TRUE}} + +\item{\code{transformWith}}{transform with. Default is \code{_none_}} + +\item{\code{schema}}{schema} + +\item{\code{extra}}{extra} + +\item{\code{geometa_validate}}{validate geometa object} + +\item{\code{geometa_inspire}}{validate geometa object vs. INSPIRE} + +\item{\code{geometa_inspireValidator}}{geometa INSPIRE validator to use} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-updateMetadata}{}}} +\subsection{Method \code{updateMetadata()}}{ +Inserts a metadata by file, XML object or \pkg{geometa} object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue}. + Extra parameters related to \pkg{geometa} objects: \code{geometa_validate} (TRUE by default) and \code{geometa_inspire} + (FALSE by default) can be used to perform ISO and INSPIRE validation respectively. In that case on object of class \code{geometa::INSPIREMetadataValidator}, with a proper user API key, should be specified as \code{geometa_inspireValidator} argument. - } - \item{\code{deleteMetadata(id, withBackup)}}{ - Deletes a metadata - } +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{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 +)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{xml}}{object of class \link{XMLInternalNode-class} from \pkg{XML}} + +\item{\code{file}}{file} + +\item{\code{geometa}}{geometa object of class \code{ISOMetadata} or \code{ISOFeatureCatalogue}} + +\item{\code{metadataType}}{metadata type. By default \code{METADATA}} + +\item{\code{group}}{group} + +\item{\code{category}}{category} + +\item{\code{rejectIfInvalid}}{reject if invalid. Default \code{FALSE}} + +\item{\code{publishToAll}}{publish to all. Default \code{TRUE}} + +\item{\code{transformWith}}{transform with. Default is \code{_none_}} + +\item{\code{schema}}{schema} + +\item{\code{extra}}{extra} + +\item{\code{geometa_validate}}{validate geometa object} + +\item{\code{geometa_inspire}}{validate geometa object vs. INSPIRE} + +\item{\code{geometa_inspireValidator}}{geometa INSPIRE validator to use} +} +\if{html}{\out{
}} } } +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-deleteMetadata}{}}} +\subsection{Method \code{deleteMetadata()}}{ +Deletes a metadata by ID +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNOpenAPIManager$deleteMetadata(id, withBackup = TRUE)}\if{html}{\out{
}} +} -\examples{ -\dontrun{ - GNOpenAPIManager$new("http://localhost:8080/geonetwork", "admin", "geonetwork", "4.0.5") +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{id}}{id} + +\item{\code{withBackup}}{proceed with backup. Default is \code{TRUE}} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNOpenAPIManager$clone(deep = FALSE)}\if{html}{\out{
}} } +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} } -\author{ -Emmanuel Blondel } -\keyword{api} -\keyword{geonetwork} -\keyword{rest} diff --git a/man/GNPrivConfiguration.Rd b/man/GNPrivConfiguration.Rd index 59cfe1a..7a81116 100644 --- a/man/GNPrivConfiguration.Rd +++ b/man/GNPrivConfiguration.Rd @@ -25,27 +25,6 @@ GeoNetwork REST API - GeoNetwork privilege configuration GeoNetwork REST API - GeoNetwork privilege configuration } -\section{Methods}{ - -\describe{ - \item{\code{new()}}{ - This method is used to instantiate a GNPriv object. - } -} - - -\describe{ - \item{\code{new()}}{ - This method is used to instantiate a GNPrivConfiguration object. - } - \item{\code{setPrivileges(group, privileges)}}{ - Sets the operation privileges for a particular group. Allowed group values - are "guest","intranet" and "all". Allowed values for operation privileges - are "view", "download", "editing", "notify", "dynamic" and "featured". - } -} -} - \examples{ \dontrun{ priv <- GNPriv$new(group="all", privileges=c("view","dynamic","featured")) @@ -65,3 +44,120 @@ Emmanuel Blondel \keyword{GeoNetwork} \keyword{configuration} \keyword{privilege} +\section{Public fields}{ +\if{html}{\out{
}} +\describe{ +\item{\code{group}}{group} + +\item{\code{privileges}}{privileges} +} +\if{html}{\out{
}} +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-new}{\code{GNPriv$new()}} +\item \href{#method-clone}{\code{GNPriv$clone()}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-new}{}}} +\subsection{Method \code{new()}}{ +Initializes a \link{GNPriv} object +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNPriv$new(group, privileges)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{group}}{group} + +\item{\code{privileges}}{privileges} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNPriv$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} +} +\section{Public fields}{ +\if{html}{\out{
}} +\describe{ +\item{\code{privileges}}{privileges} +} +\if{html}{\out{
}} +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-new}{\code{GNPrivConfiguration$new()}} +\item \href{#method-setPrivileges}{\code{GNPrivConfiguration$setPrivileges()}} +\item \href{#method-clone}{\code{GNPrivConfiguration$clone()}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-new}{}}} +\subsection{Method \code{new()}}{ +Initializes an object of class \link{GNPrivConfiguration} +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNPrivConfiguration$new()}\if{html}{\out{
}} +} + +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-setPrivileges}{}}} +\subsection{Method \code{setPrivileges()}}{ +Sets the operation privileges for a particular group. Allowed group values + are "guest","intranet" and "all". Allowed values for operation privileges + are "view", "download", "editing", "notify", "dynamic" and "featured". +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNPrivConfiguration$setPrivileges(group, privileges)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{group}}{group} + +\item{\code{privileges}}{privileges} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNPrivConfiguration$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} +} diff --git a/man/GNRESTRequest.Rd b/man/GNRESTRequest.Rd index 21cb4b4..d5270e8 100644 --- a/man/GNRESTRequest.Rd +++ b/man/GNRESTRequest.Rd @@ -12,25 +12,97 @@ Object of \code{\link{R6Class}} for modelling a GeoNetwork REST request } \description{ GeoNetwork REST API REST Request -} -\section{Abstract Methods}{ -\describe{ - \item{\code{new()}}{ - This method is used to instantiate a GNRESTRequest - } - \item{\code{setChild(key,value)}}{ - Sets a child element - } - \item{\code{encode()}}{ - Encodes a GNRESTRequest R6 object to XML representation - } -} +GeoNetwork REST API REST Request } - \author{ Emmanuel Blondel } \keyword{api} \keyword{geonetwork} \keyword{rest} +\section{Public fields}{ +\if{html}{\out{
}} +\describe{ +\item{\code{rootName}}{root name} + +\item{\code{children}}{children} +} +\if{html}{\out{
}} +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-new}{\code{GNRESTRequest$new()}} +\item \href{#method-setChild}{\code{GNRESTRequest$setChild()}} +\item \href{#method-encode}{\code{GNRESTRequest$encode()}} +\item \href{#method-clone}{\code{GNRESTRequest$clone()}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-new}{}}} +\subsection{Method \code{new()}}{ +Initializes a \link{GNRESTRequest} +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNRESTRequest$new(...)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{...}}{any parameter to pass to the request} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-setChild}{}}} +\subsection{Method \code{setChild()}}{ +Set child +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNRESTRequest$setChild(key, value)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{key}}{key} + +\item{\code{value}}{value} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-encode}{}}} +\subsection{Method \code{encode()}}{ +Encodes request as XML +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNRESTRequest$encode()}\if{html}{\out{
}} +} + +\subsection{Returns}{ +an object of class \code{character} representing the XML +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNRESTRequest$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} +} diff --git a/man/GNUtils.Rd b/man/GNUtils.Rd index e292d79..638e7d4 100644 --- a/man/GNUtils.Rd +++ b/man/GNUtils.Rd @@ -12,6 +12,8 @@ Object of \code{\link{R6Class}} with static util methods for communication with the REST API of a GeoNetwork instance. } \description{ +GeoNetwork REST API Manager Utils + GeoNetwork REST API Manager Utils } \section{Static methods}{ @@ -58,3 +60,27 @@ Emmanuel Blondel \keyword{api} \keyword{geonetwork} \keyword{rest} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-clone}{\code{GNUtils$clone()}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNUtils$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} +} diff --git a/man/GNVersion.Rd b/man/GNVersion.Rd index cd6d640..7384ba3 100644 --- a/man/GNVersion.Rd +++ b/man/GNVersion.Rd @@ -16,24 +16,6 @@ This class is an utility wrap the Geonetwork version \details{ GeoNetwork REST API - GeoNetwork Version } -\section{Methods}{ - -\describe{ - \item{\code{new(version)}}{ - This method is used to instantiate a GNVersion object. - } - \item{\code{lowerThan(version)}}{ - Compares to a version and returns TRUE if it is lower, FALSE otherwise - } - \item{\code{greaterThan(version)}}{ - Compares to a version and returns TRUE if it is greater, FALSE otherwise - } - \item{\code{equalTo(version)}}{ - Compares to a version and returns TRUE if it is equal, FALSE otherwise - } -} -} - \examples{ \dontrun{ version <- GNVersion$new("2.6.4") @@ -45,3 +27,117 @@ Emmanuel Blondel } \keyword{GeoNetwork} \keyword{version} +\section{Public fields}{ +\if{html}{\out{
}} +\describe{ +\item{\code{version}}{version} + +\item{\code{value}}{value} +} +\if{html}{\out{
}} +} +\section{Methods}{ +\subsection{Public methods}{ +\itemize{ +\item \href{#method-new}{\code{GNVersion$new()}} +\item \href{#method-lowerThan}{\code{GNVersion$lowerThan()}} +\item \href{#method-greaterThan}{\code{GNVersion$greaterThan()}} +\item \href{#method-equalTo}{\code{GNVersion$equalTo()}} +\item \href{#method-clone}{\code{GNVersion$clone()}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-new}{}}} +\subsection{Method \code{new()}}{ +Initializes an object of class \link{GNVersion} +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNVersion$new(version)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{version}}{version} +} +\if{html}{\out{
}} +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-lowerThan}{}}} +\subsection{Method \code{lowerThan()}}{ +Compares to a version and returns TRUE if it is lower, FALSE otherwise +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNVersion$lowerThan(version)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{version}}{version} +} +\if{html}{\out{
}} +} +\subsection{Returns}{ +\code{TRUE} if lower, \code{FALSE} otherwise +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-greaterThan}{}}} +\subsection{Method \code{greaterThan()}}{ +Compares to a version and returns TRUE if it is greater, FALSE otherwise +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNVersion$greaterThan(version)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{version}}{version} +} +\if{html}{\out{
}} +} +\subsection{Returns}{ +\code{TRUE} if lower, \code{FALSE} otherwise +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-equalTo}{}}} +\subsection{Method \code{equalTo()}}{ +Compares to a version and returns TRUE if it is equal, FALSE otherwise +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNVersion$equalTo(version)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{version}}{version} +} +\if{html}{\out{
}} +} +\subsection{Returns}{ +\code{TRUE} if lower, \code{FALSE} otherwise +} +} +\if{html}{\out{
}} +\if{html}{\out{}} +\if{latex}{\out{\hypertarget{method-clone}{}}} +\subsection{Method \code{clone()}}{ +The objects of this class are cloneable with this method. +\subsection{Usage}{ +\if{html}{\out{
}}\preformatted{GNVersion$clone(deep = FALSE)}\if{html}{\out{
}} +} + +\subsection{Arguments}{ +\if{html}{\out{
}} +\describe{ +\item{\code{deep}}{Whether to make a deep clone.} +} +\if{html}{\out{
}} +} +} +}