Overview
The job of the code in LASRequest.js is to make creationof the XML string above as simple as possible. It does this through ajavascript API that provides the following functionality:
- the LASRequest 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
- the getXMLText() method returns a string (as above) ready to be sent to an LAS
Changes from v1.0 LASRequestDOM.js
-
The file is now called LASRequest.js instead of LASRequestDOM.js.
-
The toString() method has been replaced with getXMLText().
Documentation & Source
- API
- $LAS_HOME/WebContent/JavaScript/components/LASRequest.js
Examples
Use in Velocity templates
If you are creating active productsfor LAS you can include the LASRequest.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 object:
Req = new LASRequest('$las_request.toJavaScriptSafeString()');
Onceyou have initialized the LASRequest 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']" />