Difference between revisions of "RmimDesDoc-CommandLine"
Line 76: | Line 76: | ||
====Command Line Parsing Notes:==== | ====Command Line Parsing Notes:==== | ||
#In keeping with convention, the command line will be parsed left to right, as a space-delimited string, in which double quotes are used to group a single value (ignore space delimiters within quotes). Both the -SUB and -SRC sections are repeating elements, and each new element is added to the set until a new section designator is reached. | #In keeping with convention, the command line will be parsed left to right, as a space-delimited string, in which double quotes are used to group a single value (ignore space delimiters within quotes). Both the -SUB and -SRC sections are repeating elements, and each new element is added to the set until a new section designator is reached. | ||
− | + | ||
#If Visio stops processing the command line functions without closing (perhaps due to a an unexpected error), the HL7VisioRunner form will be displayed. The "Cancel" button on this form will attempt (and usually succeed) to close Visio, and subsequently itself. | #If Visio stops processing the command line functions without closing (perhaps due to a an unexpected error), the HL7VisioRunner form will be displayed. The "Cancel" button on this form will attempt (and usually succeed) to close Visio, and subsequently itself. |
Revision as of 19:03, 3 March 2009
Contents
Introduction
In 2008, the need to be able to "drive" selected RMIM Designer "batch" functions from the command line arose in order to allow the ANT-automation of these publishing processes. Limited documentation of this interface was embedded in the Visual Basic (VBA) code in the RMIM Designer stencils and has been distributed as part of the releases in a text file. This documentation is presented here with sparse embellishment and corrections.
Invocation of Command Line Processing
Note on VBA command line module - CmdLineProcessor
This module contains the entire Command Line Functionality of the Visio RMIM Designer. If appropriate, it is invoked by the "Startup" sub of ThisDocument (which is invoked whenever a new drawing is opened). It replaces the key initialization functions of that subroutine, and REPLICATES rather than using the batch functions defined in the code of the BatchTask form.
This replication risks divergence, but the BatchTask code is very complex because it handles about a dozen functions, whereas this code needed only the simplest three of these. It does use the same HTML overlay and PNG generation functions that BatchTask uses.
Command line Syntax and Structure
Elements
RMIM Visio Command Line is expressed as a set of space-delimited elements (with quotes surrounding text elements that include a space.)
Sections
These elements are grouped into sections, each of which starts with a "-" and a keyword, as "-<keyWord>". Within a section, the values are single in many cases and repeat in others. The order of the "sections" is not important, except that "-TASK" section must appear somewhere or the line will be rejected, and if it is used, the "-DEBUG" section must be first.
The section key words and certain of the values must be drawn from the set of enumerations listed here. These constrained elements are indicated with angle brackets
Section <keywords> List
The following lists the section keywords. Notes:
- a number of elements are listed in angle brackets, such as <taskName>. These elements too are fully enumerated in sections that follow this one.
- Whenever a task is followed by a quote-delimited string, the contents of the string describe the element that should replace this string in the command line
- The words single or repeat in parentheses indicate whether or not the element repeats in the section.
- Descriptive notes are listed below each element.
Section <keyWords>:
- -TASK <taskName> (single)
- -SUB <option> <option> ... (repeat)
- -DBPATH "Full path to Design Repository." (single)
- [If blank, will use last repository saved (last used) by Visio RMIM Designer]
- -SPATH "SourcePath prefix for source files" (single)
- points to the "root" of the directory(s) from which the "-SRC" files are drawn. If the "-SRC" files have no sub-directory info, then this is the directory from which the source files were drawn.
- -TPATH "Target path" (single)
- Interpretation depends on value of "-TPRELATIVE". (NOTE: several of the "-TASKs" create an internal algorithm for determining the output path.)
- -TPRELATIVE "Boolean (default = false)"
- If true, and if "-TPATH" is valued then ALL generated files are placed "under" "-TPATH" in sub-directory(s) that are determined by the sub-directories (if any) in the -SRC file strings.
- If false, and if "-TPATH" is valued, then "-TPATH" is the absolute target directory for all output.
- -IGNOREDTS "Boolean (default = false)"
- The output files for these processes do not have the same base name as the source files, and frequently, a single source produces multiple outputs. Therefore, the simple ANT date-time stamp (DTS) is not sufficient to test for result currency. Thus each TASK includes a check on the result and will only regenerate if the source (and/or the algorithm) is newer than the previous result.
- If -IGNOREDTS is true, the internal DTS check will be ignored and all results will be (re)generated.
- -SRC "Filename1 (perhaps with partial path at beginning)" "Filename2" "Filename3" ... (repeat)
<taskNames> Used By RMIM VISIO
The following is a list of allowed task names that can follow the "-TASK" section listed above:
- VSD2PNG
- Convert -SRC VSD files to PNG and create the HTML overlay.
- Saves to "editable" where editable is sibling directory to directiory that holds the source file. (Or the equivalent in the -TPATH hierarchy if -TPATH is valued and -TPRELATIVE is true.)
- [DTS NOTE: date-time comparisons are made against the generated HTML file that holds the image map for hyperlinks.]
- UPGRADE
- Upgrade -SRC VSD files from Visio 2000/2002 to Visio 2007/7 [ONLY available in Visio 2003/7]
- [DTS NOTE: File currency is not tested. The process runs every time.]
- REVERT
- Revert -SRC VSD files from Visio 2003/7 to Visio 2002 [ONLY available in Visio 2003/7]
- [DTS NOTE: File currency is not tested. The process runs every time.]
- NOTE: The "-SRC" files for all of these tasks listed above must be Visio "vsd" files
<option> Names for VSD2PNG Task
The following lists the sub-task options (to be listed in "-SUB") for the VSD2PNG task:
- FIXVOC
- Scan/fix Domain specs before VSD2PNG
- RENAME
- Run "Rename" process before VSD2PNG
- RESAVE
- Resave the VSD in situ after either of above two options
Command Line Parsing Notes:
- In keeping with convention, the command line will be parsed left to right, as a space-delimited string, in which double quotes are used to group a single value (ignore space delimiters within quotes). Both the -SUB and -SRC sections are repeating elements, and each new element is added to the set until a new section designator is reached.
- If Visio stops processing the command line functions without closing (perhaps due to a an unexpected error), the HL7VisioRunner form will be displayed. The "Cancel" button on this form will attempt (and usually succeed) to close Visio, and subsequently itself.