CREATING A PISE XML FILE FOR A TOOL: notes, caveats, hints, etc
==============================================================================================================
For what it's worth, I think we should be referring to our "pise" xml files as "workbench xml",
rather than "pise" xml.
- Don't do it from scratch, modify one of the existing ones.
I did raxmlhpc.xml and garli from scratch for ngbw: these can be good examples.
Clustalw.xml can also be very useful because it has so many parameters of so many types. A
caveat is that many of the files that we got from pise use features that are completely
ignored and meaningless in the workbench.
paup.xml can serve as an example of how to create an xml parameter file. It makes use of
CDATA and perl "here" documents.
- Pointers for Excl lists:
- Can use instead of a Switch if you want the two values to be something other than true or
false. If you have only two items in the vlist the gui will display it as radio buttons.
You must make it ismandatory=1 or the gui will a third button titled "Not Mandatory" that
sets the value to "".
- With more than two items in the vlist, you'll get a drop down list. The gui will add
an additional blank choice that sends "", unless you set ismandatory=1.
- Multiple choice "List" types:
* You can't use an "@" character within a list value.
* If you don't specify a separator the selected values will be concatenated.
* If you do use a separator, it must be a single character within single quotes, like ' ' or ','.
The selected values will be concatenated with the separator in between.
* You can't add whitespace to a value with something like a . It will be stripped off.
- Use a "ctrl" element to add validations, such as "must be greater than 0" or "must be
between 1 and 10". Ctrl elements are coded in perl.
- Code elements: in the workbench code is used in only three places, precond, format and ctrl elements.
Format and Precond elements are evaluated by the PiseCommandRenderer.restituteFormat and
PiseCommandRenderer.restitutePreCond methods. Ctrl elements are handled
by freemarker templates that translate them to javascript. In the future they may also be
used to create Java validator classes (ask Jeremy about the status of this). The point being, that
the perl that can be used is limited and there are some slight, subtle differences in how the perl is handled
in each of the three element types.
- Division "/" is broken! Try to rewrite your test in terms of multiplication. Freemarker code that maps
the perl expression to javascript translates "/" to something else entirely. It ends up being a syntax
error and all controls will be disabled.
MESSAGES ELEMENTS - BE CAREFULL:
Also be careful of special characters in elements within controls. I know quotes are not
allowed, I'm not sure what else may cause a problem. elements become literals in
geneated javascript code, appearing in an alert() fn. When I inadvertantly used a quote all
javascript functionality was effectively disabled ... the preconditions didn't cause controls
to be disabled and the ctrls didn't show a popup error message on form submit.
Don't split a across multiple lines! Apparently the newline is preserved when we parse
the xml and a string containing a newline will be passed to the javascript alert(...) fn. This
breaks all the javascript!
Also be careful about using single or double quote marks in any text that will end up as a string in
the gui. I used the word "Don't" in a