Last modified: Mon, 04/03/2017 - 17:28
API for the LASRequest javascript component
Class LASRequest
Object | +--LASRequest
- class LASRequest
This is the basic LASRequest class.
Defined in LASRequest.js
Constructor Summary | |
LASRequest (<string> xml) Constructs a new LASRequest object. An LASRequest object contains all the information needed to generate an XML representation of an LASRequest. |
Method Summary | |
void |
addProperty(<string> group,<string> property,value) Adds a new <property>value<property> element inside the named PropertyGroup element of the LASRequest.If the propertyGroup is missing it will be added. If the property already exists its value will be replaced with the incoming value. |
void |
addPropertyGroup(<string> group) Adds a <properties><group></group></properties> element to the LASRequest.If the named PropertyGroup already exists, no action is taken. |
void |
addRange(<string> xyzt,<string> lo,<string> hi,<int> region_ID) Adds a new Range element to <region> section of the LASRequest.If no Region with this region_ID is found, one will be created. If a Range along the desired axis already exists it will be replaced. |
void |
addRegion() Adds a Region element to the <args> section of the LASRequest.The region added will initially be empty. |
void |
addTextConstraint(<string> variable,<string> operator,<string> value) Adds a Constraint element of type 'text' to the <args> section of the LASRequest.Constraints are also known as 'data options' and are used to modify or subset the data before the product is created. |
void |
addVariable(<string> dataset,<string> variable) Adds a <link match=.../> element to the <args> section of the LASRequest.This will add a new dataset-variable pair to the LASRequest. Note that the order in which variables appear in an LASRequest is important as differencing products (as of 2007-10-24) always subtract the second variable from the first. |
void |
addVariableConstraint(<string> dataset,<string> variable,<string> operator,<string> value) Adds a Constraint element of type 'variable' to the <args> section of the LASRequest.Constraints of type 'variable' contain dataset-variable xpath information as the left hand side. |
object |
getAnalysis(<int> index) Returns an Analysis object with the following attributes:
|
Object |
getAxisType(<string> xyzt,<int> region_ID) Returns the axis type ('point' or 'range') if it is found, null otherwise. |
Object |
getDataset(<int> data_ID) Returns the dataset string from the <link match=...> element in the <args> section of the LASRequest. |
Object |
getOperation(<string> style) Returns the Operation currently assigned in the top level <link match=...> element of the LASRequest. |
Object |
getProperty(<string> group,<string> property) Returns the value named Property defined in the named PropertyGroup of the LASRequest. A null value is returned if the Property is not found. |
Object |
getRangeHi(<string> xyzt,<int> region_ID) Returns the value representing the 'hi' end of the Range if is of type 'range', or a null if it is of type 'point' or is not defined. |
Object |
getRangeLo(<string> xyzt,<int> region_ID) Returns the value representing the 'lo' end of the Range if this axis is defined, null otherwise. |
Object |
getVariable(<int> data_ID) Returns the variable string from the <link match=...> element in the <args> section of the LASRequest. |
string |
getXMLText() Returns a XML string representation of the LASRequest object. |
void |
removeAnalysis(<int> index) Removes the Analysis element from an existing Variable defined in the <args> section of the LASRequest. |
void |
removeConstraints() Removes all Constraint elements defined in the <args> section of the LASRequest.No 'data options' will be applied before creating the product. |
void |
removeProperty(<string> group,<string> property) Removes the named Property element defined in the named propertyGroup element of the LASRequest. |
void |
removePropertyGroup(<string> group) Removes an entire <properties><group></group></properties> element from the LASRequest.This will remove all properties within the named group from the LASRequest. |
void |
removeRange(<string> xyzt,<int> region_ID) Removes a Range element tfrom the <region> section of the LASRequest. |
void |
removeRegion(<int> region_ID) Removes a Region element, optionally identified by region_ID , from the <args> section of the LASRequest.If no region_ID is specified, a value of 0 is assumed resulting in the removal of the first (or only) Region in the request. |
void |
removeVariable(<int> data_ID) Removes a single <link match=...> element defined in the <args> section of the LASRequest. |
void |
removeVariables() Removes all <link match=...> elements defined in the <args> section of the LASRequest.Clears out all dataset-variable pairs defined in the LASRequest. |
void |
replaceVariable(<string> dataset,<string> variable,<int> data_ID) Replaces a single <link match=...> element defined in the <args> section of the LASRequest. |
void |
setAnalysis(<int> index,A) Adds an Analysis element to an existing Variable in the <args> section of the LASRequest.Each analysis is applied to a single axis and will typically be a Ferret axis-compressing transform like SUM, AVE, etc. |
void |
setOperation(<string> operation,<string> style) Replaces the top level <link match=...> element in the LASRequest. |
void |
setProperty(<string> group,<string> property,<string> value) Replaces the value of a Property element in the named PropertyGroup of the LASRequest. If the property is not found a new Property element will be created. |
void |
setRange(<string> xyzt,<string> lo,<string> hi,<int> region_ID) Adds a new Range element to the <region> section of the LASRequest.If a Range along the desired axis already exists it will be replaced. |
void |
setVariable(<string> dataset,<string> variable) Replaces all existing dataset-variable Link elements defined in the <args> section of the LASRequest with the incoming pair.NOTE: The setVariable(...) method is deprecated. Multiple variables are possible and the ability to modify only a single variable would normally require that you identify an existing variable you wish to modify. |
Constructor Detail |
LASRequest
LASRequest(<string> xml)
- Constructs a new LASRequest object.
An LASRequest object contains all the information needed to generate an XML representation of an LASRequest. Javascript within an HTML page can modify this LASRequest object and then obtain the XML string to be sent to a Live Access Server (LAS).
- Parameters:
xml
- XML representation of an LASRequest used to initialize the LASRequest object
- Returns:
- A new LASRequest object
Method Detail |
addProperty
void addProperty(<string> group,<string> property,value)
- Adds a new
<property>value<property>
element inside the named PropertyGroup element of the LASRequest.
If the propertyGroup is missing it will be added.
If the property already exists its value will be replaced with the incoming value.
- Parameters:
group
- named propertyGroup (e.g.ferret, database_access)
property
- name of the property
- See:
addPropertyGroup
void addPropertyGroup(<string> group)
- Adds a
<properties><group></group></properties>
element to the LASRequest.
If the named PropertyGroup already exists, no action is taken.
- Parameters:
group
- named PropertyGroup (e.g.ferret, database_access)
- See:
addRange
void addRange(<string> xyzt,<string> lo,<string> hi,<int> region_ID)
- Adds a new Range element to
<region>
section of the LASRequest.
If no Region with this region_ID is found, one will be created.
If a Range along the desired axis already exists it will be replaced.
- Parameters:
xyzt
- axis with which this region is associated: 'x','y','z' or 't'
lo
- lower bound of region of interest (axis specific)
hi
- upper bound of region of interest
region_ID
- (optional) index of Region. Defaults to0
which is appropriate for single region requests.
- See:
addRegion
void addRegion()
- Adds a Region element to the
<args>
section of the LASRequest.
The region added will initially be empty. ThesetRange()
method is used to populate the 'region' with axis ranges
- See:
addTextConstraint
void addTextConstraint(<string> variable,<string> operator,<string> value)
- Adds a Constraint element of type 'text' to the
<args>
section of the LASRequest.
Constraints are also known as 'data options' and are used to modify or subset the data before the product is created.
- Parameters:
variable
- variable name as left hand side
operator
- operator (e.g. '< '< etc.)
value
- right hand side
addVariable
void addVariable(<string> dataset,<string> variable)
- Adds a
<link match=.../>
element to the<args>
section of the LASRequest.
This will add a new dataset-variable pair to the LASRequest.
Note that the order in which variables appear in an LASRequest is important as differencing products (as of 2007-10-24) always subtract the second variable from the first. The LASRequest syntax currently has no way of expressing this other than the order of the variables.
- Parameters:
dataset
- dataset name
variable
- variable name
- See:
addVariableConstraint
void addVariableConstraint(<string> dataset,<string> variable,<string> operator,<string> value)
- Adds a Constraint element of type 'variable' to the
<args>
section of the LASRequest.
Constraints of type 'variable' contain dataset-variable xpath information as the left hand side.
- Parameters:
dataset
- dataset name for the left hand side
variable
- variable name for the left hand side
operator
- operator (e.g. '< '< etc.)
value
- right hand side
- See:
getAnalysis
object getAnalysis(<int> index)
- Returns an Analysis object with the following attributes:
- Analysis.label - identifier for the analysis
- Analysis.axis - array of axis objects on which this analysis is defined
- Analysis.axis[#].type - one of [x|y|z|t]
- Analysis.axis[#].lo - lower bound of region of interest (axis specific)
- Analysis.axis[#].hi - upper bound of region of interest
- Analysis.axis[#].op - named Ferret transform (e.g. SUM, AVE, etc.)
- Parameters:
index
- position of the Link node (Variable) in the LASRequest
- Returns:
- Analysis Analysis object associated with the Variable at this position or null if no Analysis object is defined
- See:
getAxisType
Object getAxisType(<string> xyzt,<int> region_ID)
- Returns the axis type ('point' or 'range') if it is found,
null
otherwise.
- Parameters:
xyzt
- axis with which this Range is associated: 'x','y','z' or 't'
region_ID
- (optional) index of Region. Defaults to0
which is appropriate for single region requests.
- Returns:
- axis type ('point' or 'range') or
null
- axis type ('point' or 'range') or
- See:
getDataset
Object getDataset(<int> data_ID)
- Returns the dataset string from the
<link match=...>
element in the<args>
section of the LASRequest.
- Parameters:
data_ID
- (optional) index of the&link match=...>
element. Defaults to0
which is appropriate for single variable requests.
- Returns:
- dataset name or
null
if not found
- dataset name or
- See:
getOperation
Object getOperation(<string> style)
- Returns the Operation currently assigned in the top level
<link match=...>
element of the LASRequest. By default, the 'Armstrong' style of Operation XML is assumed, failing over to version6.x style if no operation is found.
- Parameters:
style
- (optional) style of XML for backwards compatibility: 'LAS6' for version 6.x style requests,
- Returns:
- named operation defined in
operations.xml
- named operation defined in
- See:
getProperty
Object getProperty(<string> group,<string> property)
- Returns the value named Property defined in the named PropertyGroup of the LASRequest.
Anull
value is returned if the Property is not found.
- Parameters:
group
- named propertyGroup (e.g.ferret, database_access)
property
- name of the property
- Returns:
- value or
null
if not found
- value or
- See:
getRangeHi
Object getRangeHi(<string> xyzt,<int> region_ID)
- Returns the value representing the 'hi' end of the Range if is of type 'range', or a
null
if it is of type 'point' or is not defined.
- Parameters:
xyzt
- axis with which this range is associated: 'x','y','z' or 't'
region_ID
- (optional) index of Region. Defaults to0
which is appropriate for single region requests.
- Returns:
- hi value of the Range or
null
- hi value of the Range or
- See:
getRangeLo
Object getRangeLo(<string> xyzt,<int> region_ID)
- Returns the value representing the 'lo' end of the Range if this axis is defined,
null
otherwise.
- Parameters:
xyzt
- axis with which this range is associated: 'x','y','z' or 't'
region_ID
- (optional) index of the Region. Defaults to0
which is appropriate for single region requests.
- Returns:
- lo value of the Range or
null
- lo value of the Range or
- See:
getVariable
Object getVariable(<int> data_ID)
- Returns the variable string from the
<link match=...>
element in the<args>
section of the LASRequest.
- Parameters:
data_ID
- (optional) index of the<link match=...>
element. Defaults to0
which is appropriate for single variable requests.
- Returns:
- variable name or
null
if not found
- variable name or
- See:
getXMLText
string getXMLText()
- Returns a XML string representation of the LASRequest object.
- Returns:
- XML version of LASRequest
removeAnalysis
void removeAnalysis(<int> index)
- Removes the Analysis element from an existing Variable defined in the
<args>
section of the LASRequest.
- Parameters:
index
- position of the Link node (Variable) in the LASRequest
- See:
removeConstraints
void removeConstraints()
- Removes all Constraint elements defined in the
<args>
section of the LASRequest.
No 'data options' will be applied before creating the product.
- See:
removeProperty
void removeProperty(<string> group,<string> property)
- Removes the named Property element defined in the named propertyGroup element of the LASRequest.
- Parameters:
group
- propertyGroup (e.g. 'database_access', 'ferret', ...)
property
- name of the property
- See:
removePropertyGroup
void removePropertyGroup(<string> group)
- Removes an entire
<properties><group></group></properties>
element from the LASRequest.
This will remove all properties within the namedgroup
from the LASRequest.
- Parameters:
group
- named propertyGroup (e.g.ferret, database_access)
- See:
removeRange
void removeRange(<string> xyzt,<int> region_ID)
- Removes a Range element tfrom the
<region>
section of the LASRequest.
- Parameters:
xyzt
- axis with which this region is associated: 'x','y','z' or 't'
region_ID
- (optional) index of Region. Defaults to0
which is appropriate for single region requests.
- See:
removeRegion
void removeRegion(<int> region_ID)
- Removes a Region element, optionally identified by
region_ID
, from the<args>
section of the LASRequest.
If noregion_ID
is specified, a value of0
is assumed resulting in the removal of the first (or only) Region in the request.
- Parameters:
region_ID
- (optional) index of Region. Defaults to0
which is appropriate for single region requests.
- See:
removeVariable
void removeVariable(<int> data_ID)
- Removes a single
<link match=...>
element defined in the<args>
section of the LASRequest.
- Parameters:
data_ID
- (optional) index of the<link match=...>
element. Defaults to0
which is appropriate for single variable requests.
If the Variables array is not as long as indicated by the data_ID index no action is taken.
- See:
removeVariables
void removeVariables()
- Removes all
<link match=...>
elements defined in the<args>
section of the LASRequest.
Clears out all dataset-variable pairs defined in the LASRequest.
- See:
replaceVariable
void replaceVariable(<string> dataset,<string> variable,<int> data_ID)
- Replaces a single
<link match=...>
element defined in the<args>
section of the LASRequest.
- Parameters:
dataset
- dataset name in the element to be created
variable
- variable name in the element to be created
data_ID
- (optional) index of the<link match=...>
element. Defaults to0
which is appropriate for single variable requests.
- See:
setAnalysis
void setAnalysis(<int> index,A)
- Adds an Analysis element to an existing Variable in the
<args>
section of the LASRequest.
Each analysis is applied to a single axis and will typically be a Ferret axis-compressing transform like SUM, AVE, etc. The analysis object has the following form:- Analysis.label - identifier for the analysis
- Analysis.axis - array of axis objects on which this analysis is defined
- Analysis.axis[#].type - one of [x|y|z|t]
- Analysis.axis[#].lo - lower bound of region of interest (axis specific)
- Analysis.axis[#].hi - upper bound of region of interest
- Analysis.axis[#].op - named Ferret transform (e.g. SUM, AVE, etc.)
Up to four axis objects may be included in the Analysis object.
- Parameters:
index
- position of the Link node (Variable) in the LASRequest
Analysis
- object containing analysis information
- See:
setOperation
void setOperation(<string> operation,<string> style)
- Replaces the top level
<link match=...>
element in the LASRequest. If no style is provided an 'Armstrong' style is assumed.
- Parameters:
operation
- named operation defined in operations.xml
style
- (optional) style of XML for backwards compatibility: 'LAS6' for version 6.x requests, anything else for 'Armstrong' requests.
- See:
setProperty
void setProperty(<string> group,<string> property,<string> value)
- Replaces the value of a Property element in the named PropertyGroup of the LASRequest.
If the property is not found a new Property element will be created.
- Parameters:
group
- named propertyGroup (e.g.ferret, database_access)
property
- name of the property
value
- value
- See:
setRange
void setRange(<string> xyzt,<string> lo,<string> hi,<int> region_ID)
- Adds a new Range element to the
<region>
section of the LASRequest.
If a Range along the desired axis already exists it will be replaced. Otherwise, the incoming range will be added to the existing<region>
.
- Parameters:
xyzt
- axis with which this region is associated: 'x','y','z' or 't'
lo
- lower bound of region of interest (axis specific)
hi
- upper bound of region of interest
region_ID
- (optional) index of Region. Defaults to0
which is appropriate for single region requests.
- See:
setVariable
void setVariable(<string> dataset,<string> variable)
- Replaces all existing dataset-variable Link elements defined in the
<args>
section of the LASRequest with the incoming pair.
NOTE: ThesetVariable(...)
method is deprecated. Multiple variables are possible and the ability to modify only a single variable would normally require that you identify an existing variable you wish to modify. The current implementation of thesetVariable(...)
method removes any additional variables that may be defined in the request.It is recommended, instead, that you clear out all variables explicitly with removeVariables() and then addVariable(...) for each variable you wish to add.
- Parameters:
dataset
- dataset name
variable
- variable name
- See: