Introduction

igpp.docgen is a tool to parse structured information (metadata) and merge the information with an Apache Velocity template

A Velocity template contains text and references to variables. The pds.docgen executable is used to defined the value assigned to variables. Variables can be defined on the command line, read from a PDS3 label or from a text file. Variables are placed into one or more named contexts. When loading varaibles from a file the context name can be choosen. Variables from the command line are placed in a context named "options". The syntax for specifying a named context that is populated from a file is:

[format:]name:file

The extension on the file name is used to determined how to parse the file. Supported extensions are:

.lbl, .cat, or .fmt are parsed as PDS3 label files.
.txt are parsed as variable lists containing one keyword=value per line.
.cdf are parsed as CDF files.
.json are parsed as JSON files.
.csv or .tab are processed as delimited text files.
with the first line containing field names. Lines begining with "#" are considered comments.

The format determined by the filename extension can be overriden with a "format" designator prefix in the context options. Supported format designators are:

pds3: for PDS3 formatted information
list: for variable lists
csv: for delimited text
cdf: for CDF data files
json: for JSON formated data

Usage: java igpp.docgen.Process [options] [file...]

Options:
-f,--format Format. Format output with a given style. Allowed values are PDS3 and XML. Default: XML
-h,--helpDispay this text
-i,--include Include Path. Path to look for files referenced with an INCLUDE or STRUCTURE pointer.
-l,--list List. Parse file as though it is in list format. With the list format values are expressed as keyword=value, one per line.
-o,--output Output. Output generated document to {file}. Default: System.out.
-s,--separator Separator. Pattern that separates values in tabular files. Default: is a tab ()
-t,--template Template. The template folder to search for templates file.
-v,--verboseVerbose. Show status at each step.

Command-line Variables

Variables can be defined on the command-line using the syntax:

name=value

The name and value for each variable is placed in the "options" context.

Using the Tool

Shell scripts to run the tool are in the "bin" directory in the distribution. You can run the tool on a Linux system with the command:

% docgen
or on a Windows system with the command:
% docgen.bat