Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A lot of fixes and improvements, see the single commit messages for more information #99

Closed
wants to merge 79 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
87111ce
remove phonehome leftovers
Vampire Mar 8, 2013
65c6af6
fix ant task documentation
Vampire Mar 8, 2013
289f787
integrate ant task documentation into main documentation
Vampire Mar 8, 2013
bf96995
remove unused variable
Vampire Mar 8, 2013
37267d2
fix cleanup of task variables
Vampire Mar 8, 2013
b4aaa35
do not skip ant task execution if input and output have the same last…
Vampire Mar 8, 2013
ef304a7
fix NullPointerException in ant task when parameter or option are giv…
Vampire Mar 8, 2013
745a005
fix code-style issues
Vampire Mar 11, 2013
b388aad
fix wrong error messages
Vampire Mar 11, 2013
15cf115
fix output resource handling
Vampire Mar 11, 2013
084c780
remove unused variables and unnecessary assignments
Vampire Mar 11, 2013
903d7c5
fix method name
Vampire Mar 11, 2013
417d110
fix wrong JavaDoc comments
Vampire Mar 11, 2013
c08ef58
fix if attribute for Option and Param nested tags which were document…
Vampire Mar 11, 2013
7322ace
use pipeline directly as Resource and let Ant do the conversion impli…
Vampire Mar 11, 2013
4a1f323
honor failOnError setting for misconfigured pipeline elements
Vampire Mar 27, 2013
5f29443
show a meaningful error if no pipeline is given instead of throwing a…
Vampire Mar 12, 2013
2b5475b
also check whether libraries and pipeline are specified together and …
Vampire Mar 13, 2013
2cc1589
output a linebreak before the usage message to separate it from the e…
Vampire Mar 13, 2013
035d9e6
fix, improve and extend the usage message
Vampire Mar 12, 2013
a95197d
refactor QName building into own method and add null and clark name h…
Vampire Mar 13, 2013
eace965
make -d understand - for reading from stdin
Vampire Mar 15, 2013
4e353a1
allow multiple explicit bindings of outputs to stdout
Vampire Mar 15, 2013
10657ff
allow multiple implicit bindings of outputs to stdout
Vampire Mar 15, 2013
136a319
refactor Main driver and ParseArgs to have a separate data holder for…
Vampire Mar 15, 2013
cea547c
escape quotes in parameter values correctly
Vampire Mar 15, 2013
25fbfb2
do not require a prefix binding to be defined before its usage, but c…
Vampire Mar 15, 2013
686fb51
do not search through all the configured ports multiple times
Vampire Mar 17, 2013
339eb86
make the port specification for -o option optional and bind to the pr…
Vampire Mar 17, 2013
76e3c8c
make the port specification for -i and -d options optional and bind t…
Vampire Mar 17, 2013
e578823
document in which cases the port specification for --with-param has t…
Vampire May 2, 2013
c0129d8
prevent multiple bindings for the same prefix
Vampire Mar 18, 2013
351a6ab
log the stacktrace of exceptions on verbose level in ant task
Vampire Mar 18, 2013
ba309df
change the CalabashTask driver to use UserArgs and the refactored wor…
Vampire Mar 30, 2013
8c1607e
allow usage of streams for output to make it possible to use any writ…
Vampire Mar 30, 2013
8e1872c
allow usage of streams for pipeline to make it possible to use any re…
Vampire Mar 30, 2013
022ec6d
add namespace declaration for parameter names in implicit pipeline
Vampire Mar 30, 2013
19cbe24
prevent NullPointerException if input mapper does not produce results
Vampire Mar 30, 2013
16d66a9
use UserArgs directly where possible and remove some class attributes…
Vampire Mar 31, 2013
b424f8b
interpret input and pipeline resources' lastModified date as Long.MAX…
Vampire Mar 31, 2013
53ff6fb
beautify some code
Vampire Mar 31, 2013
347f75c
correct documentation for command line
Vampire Apr 15, 2013
158d007
use baseDir only for input, use destDir for output instead
Vampire Apr 22, 2013
63195e0
clarify why a check is done multiple times instead of the 'parent' me…
Vampire Apr 22, 2013
daccacd
check again for option and parameter uniqueness in given parameters a…
Vampire Apr 22, 2013
3dc448c
fix Ant task documentation to be up-to-date
Vampire Apr 23, 2013
43a966e
do not close stdout as it will suppress further output
Vampire Apr 25, 2013
7989ad5
use URI.create() instead of new URI(), as this should be used for kno…
Vampire Apr 25, 2013
e08830a
add Ant task variants to the descriptions on how to set various confi…
Vampire Apr 27, 2013
3dc9db7
add profileFile attribute to Ant task
Vampire Apr 27, 2013
af13195
add saxonProcessor attribute to Ant task
Vampire Apr 27, 2013
7d6de4b
add saxonConfigFile attribute to Ant task
Vampire Apr 27, 2013
bfc0d7d
throw an error if schema-aware processing is selected with a saxon pr…
Vampire Apr 27, 2013
a8f51aa
add schemaAware attribute to Ant task
Vampire Apr 27, 2013
fa0cc18
add safeMode attribute to Ant task
Vampire Apr 27, 2013
5979627
add configFile attribute to Ant task
Vampire Apr 27, 2013
d6a79b8
fix NullPointerException in p:log code if href attribute has not scheme
Vampire Apr 27, 2013
fe43cac
fix NullPointerException in p:log code if the pipeline comes from an …
Vampire Apr 27, 2013
031aa33
add logStyle attribute to Ant task
Vampire Apr 27, 2013
27a787c
add entityResolver attribute to Ant task
Vampire Apr 27, 2013
fe3cd1f
add uriResolver attribute to Ant task
Vampire Apr 27, 2013
48865b5
add the possibility to specify non-XML input via the Ant task
Vampire Apr 28, 2013
ea34379
fix JavaDoc
Vampire Apr 28, 2013
847bcf4
add library loading to the Ant task
Vampire Apr 28, 2013
33a3195
give a meaningful error if neither pipeline nor libraries and / or st…
Vampire Apr 29, 2013
12aec04
fix not working mappers that are nested in input elements
Vampire Apr 29, 2013
8a2b931
fix ant task documentation, the nested element is called <parameter>,…
Vampire Apr 29, 2013
baa471e
add the possibility to specify an implicit pipeline out of steps to t…
Vampire Apr 29, 2013
5ec8b30
add "if" and "unless" attributes to <namespace>, <pipeline> and <libr…
Vampire Apr 29, 2013
2e749de
fix that entity-resolver is not an URI resolver in usage.txt
Vampire Apr 29, 2013
0f07241
document in usage.txt that --schema-aware sets saxon-processor to 'ee…
Vampire Apr 29, 2013
ec5298e
document the valid extensions in usage.txt
Vampire Apr 29, 2013
656f195
improve the Ant task documentation regarding Ant resources
Vampire Apr 29, 2013
d2a620a
add Ant resources that connect to stdin, stdout and stderr and provid…
Vampire Apr 29, 2013
69c8105
make it possible to specify profileFile as arbitrary writable Ant res…
Vampire Apr 29, 2013
bbb8586
make it possible to specify saxon configuration as arbitrary readable…
Vampire Apr 30, 2013
1bea6fc
make it possible to specify configuration as arbitrary readable Ant r…
Vampire Apr 30, 2013
84a6a2a
correctly handle a return value of "null" from URLConnection.getConte…
Vampire May 2, 2013
f5bc23d
make it possible to specify the content type for data inputs from the…
Vampire May 2, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions build.xml
Expand Up @@ -434,7 +434,6 @@ java -Xmx1024m -jar %INSTALL_PATH/calabash.jar "$@"
<path refid="full.classpath"/>
</classpath>
<jvmarg value="-Xmx1024m"/>
<sysproperty key="com.xmlcalabash.phonehome" value="false"/>
<arg value="-D"/>
<arg value="-a"/>
<arg value="${tests.root}/tests/required/test-suite.xml"/>
Expand Down Expand Up @@ -465,7 +464,6 @@ java -Xmx1024m -jar %INSTALL_PATH/calabash.jar "$@"
<path refid="full.classpath"/>
</classpath>
<jvmarg value="-Xmx1024m"/>
<sysproperty key="com.xmlcalabash.phonehome" value="false"/>
<arg value="-isource=${test.report}"/>
<arg value="xpl/submit-test-report.xpl"/>
<arg value="username=${submit.username}"/>
Expand Down
873 changes: 661 additions & 212 deletions docs/src/anttask.xml

Large diffs are not rendered by default.

215 changes: 205 additions & 10 deletions docs/src/configuration.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/src/ref.xml
Expand Up @@ -30,6 +30,7 @@

<xi:include href="preface.xml"/>
<xi:include href="running.xml"/>
<xi:include href="anttask.xml"/>
<xi:include href="configuration.xml"/>
<xi:include href="extensions.xml"/>

Expand Down
202 changes: 171 additions & 31 deletions docs/src/running.xml
Expand Up @@ -162,25 +162,25 @@ Parser</link> requires <filename>htmlparser-1.3.1.jar</filename>.</para>
<para>For example:</para>

<screen><prompt>$</prompt> <userinput>cd calabash-<replaceable>version</replaceable></userinput>
<prompt>$</prompt> <userinput>java com.xmlcalabash.drivers.Main xpl/pipe.xpl</userinput>
<prompt>$</prompt> <userinput>java -jar calabash.jar xpl/pipe.xpl</userinput>
<computeroutput>&lt;doc xmlns:p="http://www.w3.org/ns/xproc"&gt;
Congratulations! You've run your first pipeline!
&lt;/doc&gt;</computeroutput></screen>

<para>You can use
<option>-i<replaceable>port</replaceable>=<replaceable>uri</replaceable></option>
<option>-i <replaceable>port</replaceable>=<replaceable>uri</replaceable></option>
to change the inputs and
<option>-o<replaceable>port</replaceable>=<replaceable>file</replaceable></option>
<option>-o <replaceable>port</replaceable>=<replaceable>file</replaceable></option>
to change the output location.</para>

<para>For example:</para>

<screen><prompt>$</prompt> <userinput>java com.xmlcalabash.drivers.Main -isource=xpl/pipe.xpl -oresult=/tmp/out.xml xpl/pipe.xpl</userinput></screen>
<screen><prompt>$</prompt> <userinput>java -jar calabash.jar -i source=xpl/pipe.xpl -o result=/tmp/out.xml xpl/pipe.xpl</userinput></screen>

<para>That will run <filename>xpl/pipe.xpl</filename> using <filename>xpl/pipe.xpl</filename>
as the input and writing the result to <filename>/tmp/out.xml</filename>.</para>

<para>If you run java com.xmlcalabash.drivers.Main with no options, it will
<para>If you run java -jar calabash.jar with no options, it will
print a short usage summary.</para>

<para>Throughout this book, we assume that the command <replaceable>calabash</replaceable>
Expand All @@ -194,48 +194,188 @@ will run Java with the correct class path and other arguments.</para>

<cmdsynopsis>
<command><replaceable>calabash</replaceable></command>
<arg>--saxon-processor <replaceable>processortype</replaceable></arg>
<arg>--saxon-configuration <replaceable>filename</replaceable></arg>
<arg>--schema-aware</arg>
<arg>--debug</arg>
<arg>--safe-mode</arg>
<arg>--config <replaceable>configuri</replaceable></arg>
<arg>--log-style=
<group choice="plain">
<arg>
<group choice="req">
<arg choice="plain">-P</arg>
<arg choice="plain">--saxon-processor</arg>
</group>
<group choice="req">
<arg choice="plain">he</arg>
<arg choice="plain">pe</arg>
<arg choice="plain">ee</arg>
</group>
</arg>
<arg>--saxon-configuration <replaceable>file</replaceable></arg>
<arg>
<group choice="req">
<arg choice="plain">-a</arg>
<arg choice="plain">--schema-aware</arg>
</group>
</arg>
<arg>
<group choice="req">
<arg choice="plain">-D</arg>
<arg choice="plain">--debug</arg>
</group>
</arg>
<arg>
<group choice="req">
<arg choice="plain">-v</arg>
<arg choice="plain">--version</arg>
</group>
</arg>
<arg>--profile <replaceable>file</replaceable></arg>
<arg>
<group choice="req">
<arg choice="plain">-S</arg>
<arg choice="plain">--safe-mode</arg>
</group>
</arg>
<arg>
<group choice="req">
<arg choice="plain">-c</arg>
<arg choice="plain">--config</arg>
</group>
<replaceable>configfile</replaceable>
</arg>
<arg>
<group choice="req">
<arg choice="plain">-G</arg>
<arg choice="plain">--log-style</arg>
</group>
<group choice="req">
<arg choice="plain">off</arg>
<arg choice="plain">plain</arg>
<arg choice="plain">wrapped</arg>
<arg choice="plain">directory</arg>
</group>
</arg>
<sbr/>
<arg>--entity-resolver=<replaceable>classname</replaceable></arg>
<arg>--uri-resolver=<replaceable>classname</replaceable></arg>
<arg rep="repeat">--extension=<replaceable>extname</replaceable></arg>
<sbr/>
<arg rep="repeat">--binding <replaceable>prefix</replaceable>=<replaceable>uri</replaceable></arg>
<arg rep="repeat">--with-param <replaceable>name</replaceable>=<replaceable>value</replaceable></arg>
<arg>
<group choice="req">
<arg choice="plain">-E</arg>
<arg choice="plain">--entity-resolver</arg>
</group>
<replaceable>className</replaceable>
</arg>
<arg>
<group choice="req">
<arg choice="plain">-U</arg>
<arg choice="plain">--uri-resolver</arg>
</group>
<replaceable>className</replaceable>
</arg>
<arg rep="repeat">
<group choice="req">
<arg choice="plain">-X</arg>
<arg choice="plain">--extension</arg>
</group>
<group choice="req">
<arg choice="plain">general-values</arg>
<arg choice="plain">xpointer-on-text</arg>
<arg choice="plain">
<group choice="req">
<arg choice="plain">use-xslt-1.0</arg>
<arg choice="plain">use-xslt-10</arg>
</group>
</arg>
<arg choice="plain">transparent-json</arg>
<arg choice="plain">json-flavor=<replaceable>flavor</replaceable></arg>
</group>
</arg>
<sbr/>
<arg rep="repeat">--input <replaceable>portname</replaceable>=<replaceable>uri</replaceable></arg>
<arg rep="repeat">--data-input <replaceable>portname</replaceable>=<replaceable>uri</replaceable></arg>
<arg rep="repeat">--output <replaceable>portname</replaceable>=<replaceable>uri</replaceable></arg>
<arg rep="repeat">
<group choice="req">
<arg choice="plain">-b</arg>
<arg choice="plain">--binding</arg>
</group>
<replaceable>prefix</replaceable>=<replaceable>uri</replaceable>
</arg>
<arg rep="repeat">
<group choice="req">
<arg choice="plain">-p</arg>
<arg choice="plain">--with-param</arg>
</group>
<arg choice="opt"><replaceable>port</replaceable>@</arg><replaceable>param</replaceable>=<replaceable>value</replaceable>
</arg>
<sbr/>
<arg>--library=<replaceable>uri</replaceable></arg>
<group choice="plain">
<group choice="plain">
<arg choice="plain" rep="repeat">--step=<replaceable>steptype</replaceable></arg>
<arg rep="repeat">
<group choice="req">
<arg choice="plain">-i</arg>
<arg choice="plain">--input</arg>
</group>
<arg choice="plain"><replaceable>pipeline-uri</replaceable></arg>
</group>
<arg choice="opt"><replaceable>port</replaceable>=</arg><replaceable>uri</replaceable>
</arg>
<arg rep="repeat">
<group choice="req">
<arg choice="plain">-d</arg>
<arg choice="plain">--data-input</arg>
</group>
<arg choice="opt"><replaceable>contentType</replaceable>@</arg><arg choice="opt"><replaceable>port</replaceable>=</arg><replaceable>uri</replaceable>
</arg>
<arg rep="repeat">
<group choice="req">
<arg choice="plain">-o</arg>
<arg choice="plain">--output</arg>
</group>
<arg choice="opt"><replaceable>port</replaceable>=</arg><replaceable>uri</replaceable>
</arg>
<arg rep="repeat"><replaceable>option</replaceable>=<replaceable>value</replaceable></arg>
<sbr/>
<arg rep="repeat"><replaceable>name</replaceable>=<replaceable>value</replaceable></arg>
<group choice="opt">
<arg choice="opt">
<arg rep="repeat">
<group choice="req">
<arg choice="plain">-l</arg>
<arg choice="plain">--library</arg>
</group>
<replaceable>library.xpl</replaceable>
</arg>
<arg choice="opt" rep="repeat">
<arg rep="repeat">
<group choice="req">
<arg choice="plain">-p</arg>
<arg choice="plain">--with-param</arg>
</group>
<arg choice="opt"><replaceable>port</replaceable>@</arg><replaceable>param</replaceable>=<replaceable>value</replaceable>
</arg>
<arg rep="repeat">
<group choice="req">
<arg choice="plain">-i</arg>
<arg choice="plain">--input</arg>
</group>
<arg choice="opt"><replaceable>port</replaceable>=</arg><replaceable>uri</replaceable>
</arg>
<arg rep="repeat">
<group choice="req">
<arg choice="plain">-d</arg>
<arg choice="plain">--data-input</arg>
</group>
<arg choice="opt"><replaceable>port</replaceable>=</arg><replaceable>uri</replaceable>
</arg>
<arg rep="repeat">
<group choice="req">
<arg choice="plain">-s</arg>
<arg choice="plain">--step</arg>
</group>
<replaceable>steptype</replaceable>
</arg>
<arg rep="repeat"><replaceable>option</replaceable>=<replaceable>value</replaceable></arg>
</arg>
</arg>
<arg choice="opt">
<arg choice="plain"><replaceable>pipeline-uri</replaceable></arg>
<arg rep="repeat"><replaceable>option</replaceable>=<replaceable>value</replaceable></arg>
</arg>
</group>
</cmdsynopsis>

<para>See <xref linkend="configuration"/> for a description of these arguments and what they
mean.</para>

<para>There are two different ways to select the pipeline to run: you can specify the URI of
the pipeline document or you can specify one or more step types.</para>
<para>There are three different ways to select the pipeline to run: you can specify the URI of
the pipeline document on the commandline, you can specify one or more step types on the commandline,
or you can specify the URI of the pipeline document in the configfile.</para>
</section>

<section xml:id="help">
Expand Down
8 changes: 8 additions & 0 deletions resources/com/xmlcalabash/antlib.xml
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<antlib>
<taskdef name="calabash" classname="com.xmlcalabash.drivers.CalabashTask"/>
<typedef name="stdin" classname="com.xmlcalabash.util.StdinResource"/>
<typedef name="stdout" classname="com.xmlcalabash.util.StdoutResource"/>
<typedef name="stdinout" classname="com.xmlcalabash.util.StdinoutResource"/>
<typedef name="stderr" classname="com.xmlcalabash.util.StderrResource"/>
</antlib>
52 changes: 31 additions & 21 deletions resources/etc/usage.txt
@@ -1,26 +1,36 @@
Usage: com.xmlcalabash.drivers.Main [switches] [pipeline.xpl] [options]
or: com.xmlcalabash.drivers.Main [switches] \
{ [inputs/outputs/parameters] step [options] }+
Usage: com.xmlcalabash.drivers.Main [switches/options] [pipeline.xpl] [options]
or: com.xmlcalabash.drivers.Main [switches/options] { [inputs/parameters] step [options] }+

Where switches are:
-a, --schema-aware Turn on schema-aware processing
-b, --binding prefix=uri Specify namespace binding
-c, --config configfile Specify a particular configuration file
-d, --data-input port=uri Bind the specified input port to data
-D, --debug Turn on debugging
-E, --entity-resolver className Specify a resolver class for URI resolution
-G, --log-style logstyle Specify the default style for p:log output
-i, --input port=uri Bind the specified input port
-l, --library library.xpl Load the specified library
-o, --output port=uri Bind the specified output port
-p, --with-param [port@]param=value Specify a parameter
-P, --saxon-processor edition Request a specific edition of Saxon
-s, --step-name stepname Run the step named 'stepname'
-S, --safe-mode Request "safe" execution
-U, --uri-resolver className Specify a resolver class for URI resolution
-v, --version Show XML Calabash version
-X, --extension extname Enable the 'extname' extension
--saxon-configuration file Load the specified Saxon configuration
-a, --schema-aware Turn on schema-aware processing,
this also sets saxon-processor to 'ee' implicitly
-b, --binding prefix=uri Specify namespace binding
-c, --config configfile Specify a particular configuration file
-d, --data-input [contentType@][port=]uri Bind the specified input port to data, if no port is specified,
the first unbound input port is used
-D, --debug Turn on debugging
-E, --entity-resolver className Specify a resolver class for entity resolution
-G, --log-style logstyle Specify the default style for p:log output;
Must be 'off', 'plain', 'wrapped' (default), or 'directory'
-i, --input [port=]uri Bind the specified input port, if no port is specified,
the first unbound input port is used
-l, --library library.xpl Load the specified library
-o, --output [port=]uri Bind the specified output port, if no port is specified,
the first unbound output port is used
-p, --with-param [port@]param=value Specify a parameter
--profile file Specify a file, or '-' for console output,
where to write profiling information of the
pipeline that was run
-P, --saxon-processor edition Request a specific edition of Saxon;
Must be 'he' (default), 'pe' or 'ee'
-s, --step stepname Run the step named 'stepname' instead of a pipeline
-S, --safe-mode Request 'safe' execution
-U, --uri-resolver className Specify a resolver class for URI resolution
-v, --version Show XML Calabash version
-X, --extension extname Enable the 'extname' extension;
valid extname values are 'general-values', 'xpointer-on-text',
'transparent-json', 'json-flavor=<flavor>' and 'use-xslt-10'
--saxon-configuration file Load the specified Saxon configuration

For more information, consult http://xmlcalabash.com/docs/reference/ or
the documentation that came with the distribution.
Expand Down