Files
galaxy/test
John Chilton 1de2d73f38 Allow parameterization of XML macros.
This comes in two modes - simple lists of required attributes and per-attribute parameters that may specify defaults.

The following toy example:

```
<tool>
    <expand macro="inputs" bar="hello" />
    <macros>
        <xml name="inputs" dollar_tokens="bar">
            <inputs type="the type is $BAR$" />
        </xml>
    </macros>
</tool>
```

will evalute to ``<tool><inputs type="the type is hello" /><tool>``. The XML macro definition tag can now take in two new fixed attributes dollar_tokens and at_tokens - which will be interpreted as a list of parameter names. Each parameter can be specified when expanding the macros as simple attributes specifying the value of the parameter. The "dollar" parameter with name bar would map to a token with name $BAR$. Likewise an "at" parameter with name foo would map to a token with name @FOO@.

Both parameter types can be specified on a per-parameter basis to also specify default values. So the following example:

```
<tool>
    <expand macro="inputs" foo="hello" />
    <expand macro="inputs" foo="world" />
    <expand macro="inputs" />
    <macros>
        <xml name="inputs" at_token_foo="the_default">
            <inputs>@FOO@</inputs>
        </xml>
    </macros>
</tool>
```

Would evalute to ``<tool><inputs>hello</inputs><inputs>world</inputs><inputs>the_default</inputs>``.

Updated unit tests explain the above much more succinctly - though some like English and words for reasons that escape me.
2015-06-18 14:35:33 -04:00
..
2015-06-16 14:44:37 -04:00
2015-05-01 17:42:53 -04:00
2015-06-16 16:53:49 +01:00