GNLegacyAPIManager: GNLegacyAPIManager

GNLegacyAPIManagerR Documentation

GNLegacyAPIManager

Description

GNLegacyAPIManager

GNLegacyAPIManager

Format

R6Class object.

Value

Object of R6Class with methods for communication with the REST API of a GeoNetwork instance using the legacy API.

Super class

geonapi::GNAbstractManager -> GNLegacyAPIManager

Methods

Public methods

Inherited methods

Method new()

This method is used to instantiate a GNLegacyAPIManager with the url of the GeoNetwork and credentials to authenticate (user/pwd).

The keyring_backend can be set to use a different backend for storing the Geonetwork password/token with keyring (Default value is 'env').

The logger can be either NULL, "INFO" (with minimum logs), or "DEBUG" (for complete curl http calls logs)

Usage
GNLegacyAPIManager$new(
  url,
  user = NULL,
  pwd = NULL,
  version,
  logger = NULL,
  keyring_backend = "env"
)
Arguments
url

url

user

user

pwd

pwd

version

version

logger

logger

keyring_backend

keyring backend. Default is 'env'


Method login()

#' This methods attempts a connection to GeoNetwork REST API. User internally during initialization of GNLegacyAPIManager.

Usage
GNLegacyAPIManager$login(user, pwd)
Arguments
user

user

pwd

pwd


Method getGroups()

Retrieves the list of user groups available in Geonetwork

Usage
GNLegacyAPIManager$getGroups()
Returns

an object of class data.frame


Method getCategories()

Retrieves the list of categories available in Geonetwork

Usage
GNLegacyAPIManager$getCategories()
Returns

an object of class data.frame


Method insertMetadata()

Inserts a metadata by file, XML object or geometa object of class ISOMetadata or ISOFeatureCatalogue. If successful, returns the Geonetwork metadata internal identifier (integer). Extra parameters geometa_validate (TRUE by default) and 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 geometa::INSPIREMetadataValidator, with a proper user API key, should be specified as geometa_inspireValidator argument.

Usage
GNLegacyAPIManager$insertMetadata(
  xml = NULL,
  file = NULL,
  geometa = NULL,
  group,
  category = NULL,
  stylesheet = NULL,
  validate = FALSE,
  geometa_validate = TRUE,
  geometa_inspire = FALSE,
  geometa_inspireValidator = NULL
)
Arguments
xml

xml object of class XMLInternalNode-class from XML

file

file

geometa

geometa, object of class ISOMetadata or ISOFeatureCatalogue from geometa

group

group

category

category

stylesheet

stylesheet

validate

validate

geometa_validate

validate geometa object

geometa_inspire

validate geometa object vs. INSPIRE

geometa_inspireValidator

geometa INSPIRE validator to use


Method setPrivConfiguration()

Set the privilege configuration for a metadata. 'id' is the metadata integer id. 'config' is an object of class "GNPrivConfiguration".

Usage
GNLegacyAPIManager$setPrivConfiguration(id, config)
Arguments
id

id

config

config


Method 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".

Usage
GNLegacyAPIManager$get(id, by, output)
Arguments
id

id

by

by

output

output


Method getMetadataByID()

Get a metadata by Id

Usage
GNLegacyAPIManager$getMetadataByID(id)
Arguments
id

id

Returns

an object of class ISOMetadata (ISO 19115) or ISOFeatureCatalogue (ISO 19110) (from geometa package)


Method getMetadataByUUID()

Get a metadata by UUID

Usage
GNLegacyAPIManager$getMetadataByUUID(uuid)
Arguments
uuid

uuid

Returns

an object of class ISOMetadata (ISO 19115) or ISOFeatureCatalogue (ISO 19110) (from geometa package)


Method getInfoByID()

Get a metadata Info by Id.

Usage
GNLegacyAPIManager$getInfoByID(id)
Arguments
id

id

Returns

an XML document object


Method getInfoByUUID()

Get a metadata Info by UUID

Usage
GNLegacyAPIManager$getInfoByUUID(uuid)
Arguments
uuid

uuid

Returns

an XML document object


Method updateMetadata()

Updates a metadata by file, XML object or geometa object of class 'ISOMetadata' or 'ISOFeatureCatalogue'. Extra parameters geometa_validate (TRUE by default) and 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 geometa::INSPIREMetadataValidator, with a proper user API key, should be specified as geometa_inspireValidator argument.

Usage
GNLegacyAPIManager$updateMetadata(
  id,
  xml = NULL,
  file = NULL,
  geometa = NULL,
  geometa_validate = TRUE,
  geometa_inspire = FALSE,
  geometa_inspireValidator = NULL
)
Arguments
id

metadata id

xml

xml object of class XMLInternalNode-class from XML

file

file

geometa

geometa, object of class ISOMetadata or ISOFeatureCatalogue from geometa

geometa_validate

validate geometa object

geometa_inspire

validate geometa object vs. INSPIRE

geometa_inspireValidator

geometa INSPIRE validator to use


Method deleteMetadata()

Deletes metadata by Id.

Usage
GNLegacyAPIManager$deleteMetadata(id)
Arguments
id

id

Returns

the id of the record deleted, NULL otherwise


Method deleteMetadataAll()

Deletes all metadata

Usage
GNLegacyAPIManager$deleteMetadataAll()

Method clone()

The objects of this class are cloneable with this method.

Usage
GNLegacyAPIManager$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

Emmanuel Blondel <emmanuel.blondel1@gmail.com>

Examples

## Not run: 
   GNLegacyAPIManager$new("http://localhost:8080/geonetwork", "admin", "geonetwork", "3.0.0")

## End(Not run)


eblondel/geonapi documentation built on March 28, 2024, 7:53 a.m.