On this page:
Overview
This is a description of the procedure to automatically build a batch of Text objects from template using Batch Builder 2 (BB). Use this method if you have a large number of objects (over 10) that need to be created and your source files are in directories that are not broken by object.
Procedure summary:
- Create a new project.
- Enter DRS deposit settings.
- Create object template.
- Add directives to template.
- Move/copy files into template directories.
- Add object name prefix to file names or supply a mapping.txt file.
Create new object batch.
Process the batch.
What you need before you start:
- Prepare a dozen of text files and put them in a directory of your choice somewhere on local hard disk or network drive.
- Decide what you will use for Owner Supplied Names for your objects and the files they consist of. For instance, you could use local classification or local accession numbers. See Section 3 for more information about owner supplied names.
- Make sure you either provide object name prefix for each file to specify which objects it should be assigned to (The syntax is: [obj-osn]--[file_name].[extension]) or provide object assignment for your file in an external mapping file. For more details about providing object prefixes for your files see the File name pattern options section of Installation and Setup. For more details about external mapping files see Using mapping.txt File
Procedure:
- Create a new project.
- Open BB by double clicking on the executable.
- From the Project menu select New.
- In the dialog enter Project Name (used for internal tracking); select the directory on disk in which the project will be saved (click the ellipsis button to browse to it on disk); select Content Model "text" from the dropdown; click OK to continue.
- Enter DRS deposit information.
- Click on "Deposit Settings" in Project Panel tree.
- Enter deposit data in the form:
Batch Name Pattern: default -{owner}{batchDir}{yyyy}{mo}{dd}_{hh24}{mm}{ss}
(This is the name for a batch that appears on DRS deposit reports. Batch name must be at least 3 characters long.)
Success Email: type email and press enter.
Failure Email: type email and press enter.
Success Method: choose how you will receive load report.
Deposit Agent: type your HUID.
- Create object template (called "batch template" in BB 1).
- Select "Object Template" in Project Panel on the left and then enter information in the Content Panel on the right.
- Enter Owner Code for objects you will be depositing (use all caps).
- Enter Billing Code for objects you will be depositing (use all caps).
- Select DRS Access Flag value for objects you will be depositing.
- Enter the URN Authority Path for your objects (Look up your Path here if needed: http://nrs.harvard.edu/urn-3:hul.ois:nrsstatusprod) – use all caps.
- Enter URN Resource Name Pattern.
- (Optional) Switch to "optional" tab in the Content Panel to enter any additional optional metadata (for example descriptive metadata, roles or/and relationships that will apply to your objects). For more about optional metadata see Sections 8. Adding Relationships, 9. Adding Descriptive Metadata, 10. Adding Licenses, Documentation and Other Supporting Content. Note that metadata entered at the object level will override metadata entered at the template level.
- Add directories to template.
- Right click on "Object Template" in the Project Panel on the left and add a directory (The directory name starts with "text" but you can append a custom suffix).
- In the Project Panel on the left select the directory you just created.
- In the Content Panel on the right, choose "yes" from the dropdown list for the field "First Generation in DRS".
- Choose "HIGHUSE" for Usage Class.
- Note about Role: For text objects, role at the file directory level is optional. In any case, there is no "deliverable" role at this level and one is not needed since the DRS loader automatically generates a delivery URN for text files.
- Go to Project menu in the top menu bar and choose Save to save your project.
- Move/Copy files into template directory (Done outside Batch Builder)
Once you added directories to Object Template in BB, they were also created on disk. The directory structure on disk is the same as what you see in the Project Panel in Batch Builder when you expand the Object Template icon, but on disk the Object Template directory is called "template." If you need to check where on disk Batch Builder built the directory structure, click on Deposit Settings in the Project Panel and take a look at the Project Path field at the bottom of the main metadata panel.
Copy files to the corresponding text directory inside the template directory. - Add object name prefix to file names or supply a mapping.txt file.
In order to tell BB which object each file should end up with you need to either add object name prefixes to each file name or supply a mapping.txt file that associates each file with its future object.
- Add an object owner supplied name as a prefix to the name of each file. The prefix needs to be separated from the file name by the special separator sting "-". E.g.: obj1-file1.txt is a file name that tells Batch Builder that this particular file needs to be part of object obj1.
Provide a mapping file mapping.txt placed in the project /_aux/template directory which maps each file to an object owner supplied name. - Syntax: relative_file_path,file_OwnerSuppliedName,PDS_sequence number(optional),object_OwnerSuppliedName
Example:
Notes on syntax: There should be no spaces between a comma "," and the next character. If an optional element value is skipped it still needs to be designated by a comma "," so that Batch Builder can associate the right value with the right element. For example, when using mapping.txt file for objects other than PDS Documents, an extra comma needs to be inserted between the FILE OSN value and Object OSN value where PDS sequence number value would be expected.
- Add an object owner supplied name as a prefix to the name of each file. The prefix needs to be separated from the file name by the special separator sting "-". E.g.: obj1-file1.txt is a file name that tells Batch Builder that this particular file needs to be part of object obj1.
7. Create a new object batch.
You can create your new object batch in the Graphical User Interface or using the Command Line Interface (CLI).
In the Graphical User Interface
- From the Object menu in BB select "Create a new batch with objects from template"; enter the name of the batch directory to be created on disk and click OK. A new batch icon will be added to the Project Panel on the right (icon with a red letter B) and new objects will be built that are going to be part of this batch.
- In the Project Panel click on the "+" next to the Batch icon of the batch you just created to expand the tree – it will show the icons for the new objects (a blue letter O).
- (Optional) Select the object icon of your new object in the Project Panel and switch to "optional" tab in the Content Panel to add any additional optional metadata (for example descriptive metadata, roles or/and relationships that will apply to your objects). For more about optional metadata see Sections 8. Adding Relationships, 9. Adding Descriptive Metadata, 10. Adding Licenses, Documentation and Other Supporting Content. Note that metadata entered at the object level will override metadata entered at the template level.
In the Command Line Interface
- In the command line window (Terminal on Mac or Linux or CMD on Windows) change to the BB installation directory, e.g.: cd C:\Program Files\BatchBuilder\BatchBuilder-2.0.45
Typebathcbuildercli –a buildtemplate –p [project_directory_path] –b [batch_directory_name]
, e.g.: batchbuildercli -a buildtemplate -p "E:\My Project" -b batch1
Note that the batch directory name is the name of your new batch directory, to be created by BB. - If the batch creation is successful you will see the following messages:
Initializing BB...
Done!
Creating batch1 and objects from files in the template...
Success!
- In the command line window (Terminal on Mac or Linux or CMD on Windows) change to the BB installation directory, e.g.: cd C:\Program Files\BatchBuilder\BatchBuilder-2.0.45
8. Process the batch.
You can process your batch in the Graphical User Interface (GUI) or using the Command Line Interface (CLI)
In the Graphical User Interface
- In the Project Panel on the left right-click on the batch you want to process (batch icon with a red letter B) and select "Create descriptors and batch.xml."
- Builder will start processing the batch.
- When the batch is successfully processed you will see the following message: FINISHED - Creation of batch.xml and descriptors complete for batch: …
If you see any error messages, remedy the errors and re-process the batch.
In the Command Line Interface
- In the command line window (Terminal on Mac or Linux or CMD on Windows) change to the BB installation directory, e.g.: cd C:\Program Files\BatchBuilder\BatchBuilder-2.0.45
Typebathcbuildercli –a build –p [project_directory_path] –b [batch_directory_name]
, e.g.: batchbuildercli -a build -p "E:\My Project" -b batch1 - (Optional) add additional parameters to the bathcbuildercli command to substitute batch, object and directory level properties. For more information see Section 14. Processing Batches Using Command Line Interface.
- When the batch is successfully processed you will see the following messages:
Building PREMIS file metadata...
Building HulDrsAdmin file metadata...
Success!
- In the command line window (Terminal on Mac or Linux or CMD on Windows) change to the BB installation directory, e.g.: cd C:\Program Files\BatchBuilder\BatchBuilder-2.0.45
If you see any error messages at the end of batch processing, remedy the errors and re-process the batch (you can disregard any errors showing during batch processing on command line as long as you get the final "Success!" message).