geoflow_handler: Geoflow handler class

geoflow_handlerR Documentation

Geoflow handler class

Description

This class models a content handler. An handler is a method to handle some content (eg entity or contact). It is mainly driven by a function that takes as argument the handler considered (as self accessible object), a source which identifiers the source to be handled, that can be of a different type (eg a URL, a file path) depending on the handler, and a config object, as the overall configuration created by geoflow initWorkflow function.

Format

R6Class object.

Details

geoflow_handler

Value

Object of R6Class for modelling a handler

Public fields

id

handler id

type

handler type (entity,contact,dictionary)

funders

funders

authors

authors

maintainer

maintainer

def

handler definition

packages

handler packages

fun

handler function

script

handler script

options

options

available_options

available options

status

status

notes

notes

Methods

Public methods


Method new()

Initializes a geoflow_handler

Usage
geoflow_handler$new(
  yaml = NULL,
  id = NULL,
  type = c("entity", "contact", "dictionary"),
  funders = list(),
  authors = list(),
  maintainer = NULL,
  def = "",
  packages = list(),
  fun = NULL,
  script = NULL,
  options = list(),
  available_options = list(),
  status = "stable",
  notes = ""
)
Arguments
yaml

a YAML file

id

id

type

type

funders

funders

authors

authors

maintainer

maintainer

def

def

packages

list of packages required for the handler

fun

the handler function having 2 arguments config and source

script

a handler script

options

action options

available_options

available options for the action

status

status (experimental/stable/deprecated/superseded)

notes

notes


Method fromYAML()

Reads handler properties from YAML file

Usage
geoflow_handler$fromYAML(file)
Arguments
file

file


Method checkPackages()

Check that all packages required for the handler are available, if yes, import them in the R session, and return a data.frame giving the packages names and version. If one or more packages are unavailable, an error is thrown and user informed of the missing packages.

Usage
geoflow_handler$checkPackages()

Method getOption()

Get handler option value

Usage
geoflow_handler$getOption(option)
Arguments
option

option id

Returns

the option value, either specified through a workflow, or the default value


Method clone()

The objects of this class are cloneable with this method.

Usage
geoflow_handler$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Note

This class is essentially called internally by geoflow to register default handlers for entities and contacts.

Author(s)

Emmanuel Blondel <emmanuel.blondel1@gmail.com>

Examples

## Not run: 
  handler <- geoflow_handler$new(
   id = "some-id",
   def = "some definition",
   packages = list(),
   fun = function(handler, source, config){},
   available_options = list()
 )

## End(Not run)


geoflow documentation built on Dec. 12, 2025, 5:08 p.m.