August 2007
LASRequestDOM.js is deprecated. Please see the documentation for the newer LASRequest component released with LAS 7.0
Documentation & Source
Examples
Use in Velocity templates
If you are creating active productsfor LAS you can include the LASRequestDOM.js code in your Velocitytemplate for the products. The servlet context gives the templatesaccess to the XML string that was used to request the product and youcan use this string to initialize the LASRequest DOM:
Req = new LASRequest('$las_request.toJavaScriptSafeString()');
Onceyou have initialized the LASRequestDOM object you can then allow userinterface elements in the product page to modify this request and thenresubmit it to LAS for a new product.
Background
The LASRequest
An LAS product request is sent from a web page to the server encoded in XML. An example request string (using the LAS6 syntax) would be:
<?xml version="1.0"?>
<lasRequest href="file:las.xml">
<link match="/lasdata/operations/shade" />
<properties>
<ferret>
<size>.5</size>
</ferret>
</properties>
<args>
<link match="/lasdata/datasets/COADS_1degree_Enhanced/variables/air947"></link>
<region>
<range type="x" low="-180.0" high="180.0"/>
<range type="y" low="-89.5" high="89.5"/>
<point type="t" v="01-Jan-1960"/>
</region>
</args>
</lasRequest>
The only change in the Armstrong syntax is to the tag defining the operation. In the Armstrong syntax, the line immediately below <lasRequest ...> would read:
<link match="/lasdata/operations/operation[@ID='shade']" />
What LASRequestDOM.js does
The job of the code in LASRequestDOM.js is to make creation of the XML string above as simple as possible. It does this through a javascript API that provides the following functionality:
- the LASRequestDOM object is initialized via an existing XML string or defaults to the request above
- methods allow javascript code in the web page to modify specific elements of the request
- differences in syntax between LAS6 and Armstrong are hidden
- a toString() method returns a string (as above) ready to be sent to an LAS


