-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add missing class -placeholder for supporting GN 4 OpenAPI #2 - expan…
…d tests to GN legacy APIs
- Loading branch information
Showing
2 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
#} | ||
} | ||
|
||
) | ||
|
||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.