Templates CLI

The template engine can be invoked from the command line:

  java net.sf.csutils.poi.Main
    -csUrl http://127.0.0.1:53305/CentraSite/CentraSite
    -csUser MyUsername
    -csPassword MyPassword
    -inputFile SomeFile.txt
    -outputFile AnotherFile.xls
    -spreadsheetFile XlsTemplate.xlt

This example would read a data template from SomeFile.txt, process it, and write the output to AnotherFile.xls. (Of course, you've got to enter the complete command as a single line.)

Available options

Options are introduced by one or two dashs, like this:

    -csUrl http://127.0.0.1:53305/CentraSite/CentraSite
    --csUrl http://127.0.0.1:53305/CentraSite/CentraSite

It doesn't matter, which version you choose. The following options are available in the command line interface:

Option nameDescription
csPasswordSets the CentraSite password. Example: -csPassword MyPassword
csUrlSets the CentraSite URL. Example: -csUrl http://127.0.0.1:53305/CentraSite/CentraSite
csUserSets the CentraSite user name. Example: -csUser MyDomain\MyUsername
helpPrints the usage description and exits with error status. Example: -help
inputEncodingSets the input templates encoding; defaults to UTF8. Example: -inputEncoding CP-1252
inputFileSets the input file, this option is mutually exclusive with inputUrl. Example: -inputFile MyFile.xml
inputUrlSets the input URL, this option is mutually exclusive with inputFile. Example: -inputURL http://127.0.0.1/MyFile.xml
outputFileSets the output file. Example: -outputFile OtherFile.xls
spreadsheetFileSets the name of a spreadsheet, which is being read as an Excel template. Typically, this file will contain formulas, style definitions, macros, and so on, which operate on the data that is being filled into the file. Example: -spreadsheetFile MyFile.xls This option is mutually exclusive with spreadsheetUrl.
spreadsheetTypeSets spreadsheet type, either of xls (default), or xlsx (Office Open XML). Example: -spreadsheetType xslx
spreadsheetUrlSets the URL of a spreadsheet, which is being read as an Excel template. Typically, this file will contain formulas, style definitions, macros, and so on, which operate on the data that is being filled into the file. Example: -spreadsheetFile MyFile.xls This option is mutually exclusive with spreadsheetFile.