Defining a Collection of Options
In the operation definition above the options associated with the operation are identified with this XML:
<optiondef IDREF="My_Options"/>
Now you have to create the XML that defines the options. In your running server the options defined for the operations included with the distribution can be found in $TOMCAT_HOME/content/las/conf/server/options.xml. You should add any options you want to include to this file. You should add your options using an ENTITY reference so you can keep your additions separate and easily add them to any new options.xml file that comes with a future release of LAS.
The basic building block for a set of options is an optiondef element. For example, the option to choose how the land is drawn on a latitude-longitude plot looks like this:
<optiondef name="land_type">
<option>
<help>Style for drawing continents. Only applies to XY plots.
Choices are:
<ul><li><b>Default</b> -- let LAS decide
<li><b>None</b> -- don\'t draw continents
<li><b>Outline</b> -- draw continent outlines
<li><b>Filled</b> -- draw filled continents
</ul>
</help>
<title>Land fill style</title>
<menu type="options" name="land_type">
<item values="default">Default</item>
<item values="none">None</item>
<item values="contour">Outline</item>
<item values="filled">Filled</item>
</menu>
</option>
</optiondef>
Within the optiondef there can appear one or more options. The option should contain a small block of escaped HTML in the <help> element that will be displayed to the user if they need help. The <title> element, and then one of two different elements that defines how the option is presented the user. In this case, the element is a <menu> which results in the UI building a drop down menu with the <item> elements used to build the menu choices.
The <menu> element can be replaced <textfield name="fill_levels2"/> element which results in a box into which the user can type in the information required by the option.
Once you have built or find the existing optiondef elements you need for your operation you can group them together by inheriting from existing optiondef elements. For example, for your new operation you might want to have the user be able to choose the land type and the contour levels. In that case your new option definition My_Options would look like this:
<optiondef name="My_Options" inherit="#contour_levels,#land_type"/>
simply reusing the existing <optiondef> elements for the land type and contour levels by referencing them in the <optiondef> for My_Options