Skip to contents

Convenience wrapper that executes the same two-step flow as the CatMapperJS edit page: first /uploadInputNodes, then /updateWaitingUSES.

Usage

submitEditUpload(
  df,
  database,
  formData = list(),
  so = "standard",
  ao = "add_node",
  addoptions = list(district = FALSE, recordyear = FALSE),
  allContext = list(),
  mergingType = "0",
  api_key = NULL,
  refresh_waiting_uses = TRUE,
  url = NULL
)

Arguments

df

Data frame or list of row objects to upload.

database

Target database, typically "SocioMap" or "ArchaMap".

formData

Named list matching the edit-page formData payload.

so

Upload mode, usually "standard" or "simple".

ao

Advanced upload option. Supported values map directly to the CatMapperJS Edit-page advanced upload options:

  • "add_node" = "Adding new node for every row"

  • "node_add" = "Updating existing Node properties–add or add to properties"

  • "node_replace" = "Updating existing Node properties–replace one property"

  • "add_uses" = "Adding new uses ties (with old or new nodes)"

  • "update_add" = "Updating existing USES only–add or add to properties"

  • "update_replace" = "Updating existing USES only–replace one property"

  • "add_merging" = "Adding new merging ties for every row"

  • "merging_add" = "Updating existing Merging tie properties–add or add to properties"

  • "merging_replace" = "Updating existing Merging tie properties–replace one property"

addoptions

Named list with district and recordyear booleans.

allContext

Optional vector/list of contextual columns.

mergingType

Optional merging mode used by merge upload workflows.

api_key

API key used for authenticated write actions. If NULL, CATMAPR_API_KEY is used.

refresh_waiting_uses

If TRUE, call updateWaitingUSES after upload.

url

API URL override. If NULL, CATMAPR_API_URL is used when set.

Value

Named list with upload and waiting_uses elements.

Examples

if (FALSE) { # \dontrun{
submitEditUpload(
  df = data.frame(
    CMName = "Example",
    Name = "Example",
    CMID = "",
    Key = "Type == Example",
    stringsAsFactors = FALSE
  ),
  database = "SocioMap",
  formData = list(
    datasetID = "SD1",
    cmNameColumn = "CMName",
    categoryNamesColumn = "Name",
    cmidColumn = "CMID",
    keyColumn = "Key"
  ),
  ao = "add_node",
  api_key = Sys.getenv("CATMAPR_API_KEY")
)
} # }