Creating Batches Using Command Line Interface

Overview

The Batch Builder 2 installation package includes a command line interface tool (CLI) designed for automated deposit workflows that performs three actions:

  • build: build the descriptors and batch.xml for a specified batch within a specified project using batch, object and directory level property values supplied on command line or/and in the Graphical User Interface (GUI).
  • templatedirs: rebuild the directories in the object template from the information in the project configuration file .
  • buildtemplate: Create a new batch with objects from template in the specified project.

CLI should be used in conjunction with the GUI. For instance, a depositor can use the Batch Builder GUI to build the initial project, and then use the command line to substitute batch-level, object-level and directory level metadata values when processing batches of objects.

CLI On-screen Help. To see on-screen help while in CLI type:

batchbuildercli –h to display only example usage
batchbuildercli –fullhelp to display example usage and a list of all overridable batch, object and directory properties

Basic Command Line Syntax

Please note that on computers running Microsoft Windows XP or later, the maximum length of the string that you can use at the command prompt is 8191 characters. 

batchbuildercli -a action -p project_dir -b batch_name

-a actions: templatedirs, buildtemplate, build.

[-aleph object_name=123;...]

[-batchprop property=value,property=value,property=value...]

[-objectprop object_name::property=value,property=value;...]

[-dirprop object_name::directory_path::property=value,property=value;...]

Deposit Settings Properties (Batch Properties)

Syntax: -batchprop property=value,property=value,property=value...

  • projectName – substitutes passed string for the existing BB project name

  • projectDescription – substitutes passed string for the existing content of the project description field

  • batchName – substitutes passed string for the default batch name (not the batch directory name)
    E.g.: - batchprop batchName=mybatch
    E.g.: - batchprop batchName={depositAgent}{batchDir}{ss}
  • successEmail – substitutes passed string for success email(s). Each email should be passed as a separate property=value pair separated by a comma "," without any blank space in between.
    E.g.: - batchprop successEmail=myname@example.com,successEmail=myname2@example2.com
  • failureEmail – substitutes passed string for failure email(s). Each email should be passed as a separate propery=value pair separated by a comma "," without any blank space in between.
    E.g.: - batchprop failureEmail=myname@example.com,failureEmail=myname2@example2.com
  • successMethod - substitutes passed string for the successMethod specified in deposit settings panel in the GUI. The options are email, all, dropbox.
    E.g.: - batchprop successMethod=email
  • depositAgent - substitutes passed string for the deposit agent HUID specified in deposit settings panel
    E.g.: - batchprop depositAgent=12345678

  • depositAgentEmail - substitutes passed string for the deposit agent email address specified in deposit settings panel. Note that the supplied email value has be the same as the email in Wordshack person record for the depositor.
    E.g.: - batchprop depositAgentEmail=john_harvard@harvard.edu

    Example: 
    C:\BatchBuilder-2.0.61> batchbuildercli -a build -p "C:\my_project_path" -b batch1 –batchprop "batchName=mybatch{depositAgent}{batchDir}{ss},successEmail=success@me.me,failureEmail=failure@me.me,successMethod=email,depositAgent=12345678,depositAgentEmail=john_harvard@harvard.edu"

On this page:

In this section: