Skip to content

Commit

Permalink
add missing class -placeholder for supporting GN 4 OpenAPI #2 - expan…
Browse files Browse the repository at this point in the history
…d tests to GN legacy APIs
  • Loading branch information
eblondel committed Sep 9, 2021
1 parent 3e120df commit bc31b80
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 0 deletions.
79 changes: 79 additions & 0 deletions R/GNOpenAPIManager.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#' @name GNOpenAPIManager
#' @title GNOpenAPIManager
#' @aliases GNOpenAPIManager
#'
#' @docType class
#'
#' @export
#' @keywords geonetwork rest api
#' @return Object of \code{\link{R6Class}} with methods for communication with
#' the REST API of a GeoNetwork instance using the legacy API.
#' @format \code{\link{R6Class}} object.
#'
#' @examples
#' \dontrun{
#' GNOpenAPIManager$new("http://localhost:8080/geonetwork", "admin", "geonetwork", "4.0.5")
#' }
#'
#'@section Abstract Methods:
#' \describe{
#' \item{\code{new(url, user, pwd, version, logger)}}{
#' This method is used to instantiate a \code{GNOpenAPIManager} 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). This argument
#' accepts two possible values: \code{INFO}: to print only geonapi logs,
#' \code{DEBUG}: to print geonapi and CURL 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)}}{
#' This method is used to instantiate a \code{GNOpenAPIManager} 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). This argument
#' accepts two possible values: \code{INFO}: to print only geonapi logs,
#' \code{DEBUG}: to print geonapi and CURL logs
#' }
#' }
#'
#' @author Emmanuel Blondel <emmanuel.blondel1@@gmail.com>
GNOpenAPIManager <- R6Class("GNOpenAPIManager",
inherit = GNAbstractManager,
private = list(),

public = list(
#manager
initialize = function(url, user = NULL, pwd = NULL, version, logger = NULL){
super$initialize(url, user = user, pwd = pwd, version = version, logger = logger)

#try to login
#if(!is.null(user) && !is.null(pwd)){
# self$INFO(sprintf("Connecting to GeoNetwork services as authenticated user '%s'", user))
# self$login(user, pwd)
#}else{
# self$INFO("Connected to GeoNetwork services as anonymous user")
#}
}

)

)
72 changes: 72 additions & 0 deletions man/GNOpenAPIManager.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bc31b80

Please sign in to comment.