Return to LAS FAQ


Modifying available views


Question:



How can I change the views displayed in the "Select view" selector?

Explanation:

Sometimes you will want to modify the list of available views associated with a dataset or a particular variable. One example might be a server with satellite datasets. These may be very high resolution and may have files stored as individual timesteps. Although the defining grid for the data will have a time axis and you want the user to be able to choose a time you may not be prepared to provide time selections in the back end software.

Solution:

As of LAS v5.2, many aspects of the user interface are configurable. User interface information is stored in a named <default> and attached to a dataset or variable with <properties> tags in the dataset .xml file:

<properties>
 <ui>
  <default>file:ui.xml#no_T_Views</default>
 </ui>
</properties>

As in this example, all user interface properties are (must be) defined in the file named ui.xml. Each <default> defines user interface behavior and consists of descriptions of the operations, views, livemap and options. Detailed information is available in the documentation on User Interface behavior. The following example provides for a new default with no time axis:

<menus> 
 <menu type="views" name="Views_no_T">
  <ifitem view="xy" values="xy">xy (lat/lon) slice</ifitem>
  <ifitem view="xz" values="xz">xz (lon/depth) slice</ifitem>
  <ifitem view="yz" values="yz">yz (lat/depth) slice</ifitem>
  <ifitem view="xyz" values="xyz">xyz volume</ifitem>
 </menu>
</menus>
<maps>
 <map type="views" name="no_T_Views">
  <menu href="#Views_no_T"/>
 </map>
</maps>
<defaults>
 <default name="no_T_Views">
  <map href="#DefaultOperations"/>
  <map href="#no_T_Views"/>
  <map href="#DefaultLivemap"/>
  <map href="#DefaultOptions"/>
 </default>
</defaults>

The <default> named "no_T_Views" references a <map> (a container) called "no_T_Views" which references a <menu> of type view called "Views_no_T". This view menu omits all views which contain the time axis. All other elements used in the <default> referenceelements defined in ui.xml.

To add this functionality to your LAS you might store the example above in a file named ui_no_T.xml and reference it in ui.xml as follows:

<!DOCTYPE spec SYSTEM "spec.dtd" [
   <!ENTITY ui_no_T SYSTEM "ui_no_T.xml">
   <!ENTITY StdOptions SYSTEM "options.xml">]>
<lasui>
   &StdOptions;
   &ui_no_T;
   ...
After attaching the new <default> to a dataset you simply remake the server try it out.


Jonathan Callahan: Jonathan.S.Callahan@noaa.gov
Last modified: May 31, 2002