Skip to contents

Exports an entire folder hierarchy — including subfolders, analysis trees (with their workflow steps), standalone files, and links — to a zip file that can be imported into another repository. Cross-tree links and folder-level links are preserved.

Usage

exportFolder(folderIdent, exportName, targetFolder = ".")

Arguments

folderIdent

Identifier of the folder to export. Can be a path, resource ID, or entity ID.

exportName

Character. Name for the exported folder package (without extension). Used as the zip filename and internal folder name.

targetFolder

Character. Directory path where the zip file and mapping templates will be created. Defaults to current directory (".").

Value

Invisibly returns the path to the created zip file.

Details

The export process:

  1. Recursively traverses the folder hierarchy via loadChildResources()

  2. Classifies each child: Folder, File, Analysis Tree, Link, ExtLink

  3. For trees: extracts steps via getWorkflow() / getStep() into a unified step data frame (same format as workflow export)

  4. Collects internal links across ALL trees (cross-tree links supported)

  5. Downloads step files via cloneCli(); standalone folder files via getData()

  6. Generates manifest.json, workflow.json-compatible step data, and mapping templates

  7. Packages everything into a single zip file

Export Structure


<exportName>/
  manifest.json              # Folder structure + tree/link metadata
  workflow.json              # Unified step data (same format as exportWorkflow)
  internalLinks.json         # Step-to-step links across all trees
  links/                     # External dependency files
  <stepHandle>/
    inputFiles/
    outputFiles/
  folderFiles/               # Standalone files from folders
    <resourceId>_<filename>

Generated Mapping Templates

Same as exportWorkflow: <exportName>LinkMapping.json and <exportName>ToolMapping.json are created alongside the zip.

See also

importFolder for importing exported folders, exportWorkflow for exporting single workflows

Examples

if (FALSE) { # \dontrun{
exportFolder("/Projects/MyFolder", "MyFolderExport")
# Creates: MyFolderExport.zip, MyFolderExportLinkMapping.json,
#          MyFolderExportToolMapping.json
} # }