This class models an action to be executed by geoflow
Object of R6Class for modelling an action
R6Class object.
Emmanuel Blondel <emmanuel.blondel1@gmail.com>
geoflow::geoflowLogger -> geoflow_action
idaction ID
enabledenabled
fundersfunders
authorsauthors
maintainermaintainer
scopeaction scope
typestypes of action
defthe action definition
targetthe action target
target_dirthe action target directory
packageslist of packages required to perform the action
pid_generatora name referencing the PID generator (if existing)
pid_typestypes of PIDs to generate
generic_uploaderwhether the action is a generic uploader or not.
funa function for the action
scripta script for the action
optionsaction options
available_optionsa list of available options for the actions
statusstatus
notesnotes
new()Initialize a geoflow_action
geoflow_action$new(
yaml = NULL,
id = NULL,
enabled = TRUE,
funders = list(),
authors = list(),
maintainer = NULL,
scope = "global",
types = list(),
def = "",
target = NA,
target_dir = NA,
packages = list(),
pid_generator = NULL,
pid_types = list(),
generic_uploader = FALSE,
fun = NULL,
script = NULL,
options = list(),
available_options = list(),
status = "stable",
notes = ""
)yamla yaml file
idaction id
enabledenabled
fundersfunders
authorsauthors
maintainermaintainer
scopeaction scope "global" or "local"
typesaction types
defaction definition
targetthe action target, e.g. "entity"
target_dirthe action target directory
packageslist of packages required to perform the action
pid_generatora name referencing the PID generator (if existing)
pid_typestypes of PIDs to generate by the action
generic_uploaderwhether the action is a generic uploader or not.
funaction function
scriptaction script
optionsaction options
available_optionsavailable options for the action
statusstatus of the action (experimental, stable, deprecated, superseded)
notesnotes
fromYAML()Reads action properties from YAML file
geoflow_action$fromYAML(file)filefile
checkPackages()Check that all packages required for the action 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.
geoflow_action$checkPackages()
run()Runs the action
geoflow_action$run(entity, config)entityentity
configconfig
optionoption id
the option value, either specified through a workflow, or the default value
isPIDGenerator()Indicates if the action is PID generator
geoflow_action$isPIDGenerator()TRUE if the action is a PID generator, FALSE otherwise
exportPIDs()Exports PIDs for the action. This function will export the PIDs in several ways. First, a simple CSV file including the list of PIDs for each entity, and associated status (eg. draft/release) for the given PID resource. In addition, for each metadata entities file, an equivalent metadata table will be produced as CSV to handle entities enriched with the PID (added in the "Identifier" column), ready for use as workflow entities input. In addition, a new configuration file will be produced with name "<pid_generator>_geoflow_config_for_publication.json" turned as ready for publishing resources with PIDs (eg. publishing deposits in Zenodo).
geoflow_action$exportPIDs(config, entities)configa geoflow configuration
entitiesone or more objects of class geoflow_entity
isGenericUploader()Indicates if the action is a generic uploader
geoflow_action$isGenericUploader()TRUE if the action is a generic uploader, FALSE otherwise
clone()The objects of this class are cloneable with this method.
geoflow_action$clone(deep = FALSE)deepWhether to make a deep clone.
geoflow_action
if (FALSE) {
action <- geoflow_action$new(
id = "some-id",
scope = "global",
types = list("some purpose1", "some purpose2"),
target = "entity",
target_dir = "data",
def = "some definition",
packages = list(),
pid_generator = NULL,
generic_uploader = FALSE,
fun = function(action, entity, config){},
available_options = list(
option_name = list(def = "option description", default = FALSE)
),
options = list(option_name = TRUE)
)
}
Run the code above in your browser using DataLab