OverviewSingleDeprecated

jsx3.xml

interface Cacheable

jsx3.xml.Cacheable

All Known Implementing Classes:

jsx3.chart.AreaChart, jsx3.chart.BCChart, jsx3.chart.BarChart, jsx3.chart.CartesianChart, jsx3.chart.Chart, jsx3.chart.ColumnChart, jsx3.chart.LineChart, jsx3.chart.PieChart, jsx3.chart.PlotChart, jsx3.chart.RadialChart, jsx3.gui.BlockX, jsx3.gui.CDF, jsx3.gui.Grid, jsx3.gui.List, jsx3.gui.Matrix, jsx3.gui.Menu, jsx3.gui.Select, jsx3.gui.Table, jsx3.gui.Tree

interface Cacheable
A mixin interface that provides the following capabilities to implementing classes: A class that implement this interface should usually be a subclass of jsx3.app.Model since this interface assumes that its instances have methods in that class (in particular getId() and getServer()).

As of version 3.2 using custom XSL templates for built-in GUI classes implementing this interface is deprecated. Therefore, several methods related to storing per-instance XSL documents are deprecated.

Since:

3.1

Field Summary
static int
CLEANUPRESOURCES
Value of the shareResources property for an object that removes its XML and XSL documents from the server XML cache when it is destroyed.
static String
DEFAULTSTYLESHEET
JSX/xsl/xml.xsl
static String
Deprecated.
static int
SHARERESOURCES
Value of the shareResources property for an object that leaves its XML and XSL documents in the server XML cache when it is destroyed.
Method Summary
void
Resets the XML source document stored in the server cache under the XML ID of this object to an empty CDF document.
jsx3.xml.Entity
Deprecated.
int
Returns whether this object removes its XML and XSL source documents from the cache of its server when it is destroyed.
static String
Deprecated.
jsx3.xml.Document
Returns the XML source document of this object.
String
Returns the XML ID of this object.
String
Returns the XML string of this object.
Array<String>
Returns the list of XML transformers of this object.
String
Returns the XML URL of this object.
jsx3.xml.Document
Returns the XSL source document of this object.
String
Returns the XSL ID of this object.
Object<String, String>
Returns a map containing all the parameters to pass to the XSL stylesheet during transformation.
String
Deprecated. Per-instance control of the XSL template is deprecated. Consider using the XML transformers functionality instead.
String
Deprecated. Per-instance control of the XSL template is deprecated. Consider using the XML transformers functionality instead.
int
Returns whether the XML data source of this object is loaded asynchronously.
int
Returns whether this object is bound to the XML document stored in the data cache.
protected void
onXmlBinding(objEvent : Object)
This method is called in two situations: When the datasource of this object finishes loading (success, error, or timeout), if the xmlAsync property of this object is true, its datasource is specified as an XML URL, and the first time doTransform() was called the datasource was still loading.
jsx3.xml.Cacheable
removeXSLParam(strName : String)
Removes a parameter from the list of parameters to pass to the XSL stylesheet during transformation.
jsx3.xml.Cacheable
Removes all parameters from the list of parameters to pass to the XSL stylesheet during transformation.
void
Removes the XML and XSL source documents from the server cache.
void
Deprecated. renamed to clearXmlData()
void
Removes the XML source document stored under the XML ID of this object from the server cache.
void
Deprecated. Per-instance control of the XSL template is deprecated. Consider using the XML transformers functionality instead.
void
setNodeSet(objNodeSet : jsx3.xml.Entity)
Deprecated.
jsx3.xml.Cacheable
setShareResources(intShare : int)
Sets whether this object removes its XML and XSL source documents from the cache of its server when it is destroyed.
jsx3.xml.Document
Sets the source document of this object as though objDoc were retrieved from the XML URL or XML string of this object.
jsx3.xml.Cacheable
setXMLId(strXMLId : String)
Sets the XML ID of this object.
jsx3.xml.Cacheable
setXMLString(strXML : String)
Sets the XML string of this object.
void
Sets the list of XML transformers of this object.
jsx3.xml.Cacheable
setXMLURL(strXMLURL : String)
Sets the XML URL of this object.
jsx3.xml.Cacheable
setXSLId(strXSLId : String)
Deprecated. Per-instance control of the XSL template is deprecated. Consider using the XML transformers functionality instead.
jsx3.xml.Cacheable
setXSLParam(strName : String, strValue : String)
Adds a name/value pair to the list of parameters to pass to the XSL stylesheet during transformation.
jsx3.xml.Cacheable
setXSLString(strXSL : String)
Deprecated. Per-instance control of the XSL template is deprecated. Consider using the XML transformers functionality instead.
jsx3.xml.Cacheable
setXSLURL(strXSLURL : String)
Deprecated. Per-instance control of the XSL template is deprecated. Consider using the XML transformers functionality instead.
jsx3.xml.Cacheable
setXmlAsync(bAsync : boolean)
Sets whether the XML data source of this object is loaded asynchronously.
int
setXmlBind(bBind : ?)
Sets whether this object is bound to the XML document stored in the data cache.
Field Detail

CLEANUPRESOURCES

static final int CLEANUPRESOURCES
Value of the shareResources property for an object that removes its XML and XSL documents from the server XML cache when it is destroyed.

DEFAULTSTYLESHEET

static String DEFAULTSTYLESHEET
JSX/xsl/xml.xsl

DEFAULTXSLCACHEID

static String DEFAULTXSLCACHEID
Deprecated.
JSX_XML_XSL

SHARERESOURCES

static final int SHARERESOURCES
Value of the shareResources property for an object that leaves its XML and XSL documents in the server XML cache when it is destroyed.
Method Detail

clearXmlData

void clearXmlData()
Resets the XML source document stored in the server cache under the XML ID of this object to an empty CDF document.

See Also:

jsx3.xml.CDF.newDocument()

getNodeSet

jsx3.xml.Entity getNodeSet()
Deprecated.
Returns the node set of this object.

Returns:

 

getShareResources

int getShareResources()
Returns whether this object removes its XML and XSL source documents from the cache of its server when it is destroyed.

Returns:

CLEANUPRESOURCES or SHARERESOURCES.  

getVersion

static String getVersion()
Deprecated.
gets the release/build for the class (i.e., "2.2.00")

Returns:

 

getXML

jsx3.xml.Document getXML()
Returns the XML source document of this object. The XML document is determined by the following steps:
  1. If an XML document exists in the server cache under an ID equal to the XML ID of this object, that document is returned.
  2. If the XML string of this object is not empty, a new document is created by parsing this string.
  3. If the XML URL of this object is not empty, a new document is created by parsing the file at the location specified by the URL resolved against the server owning this object.
  4. Otherwise, an empty CDF document is returned.
If a new document is created for this object (any of the steps listed above except for the first one), the following actions are also taken:
  1. If creating the document resulted in an error (XML parsing error, file not found error, etc) the offending document is returned immediately.
  2. Otherwise, setSourceXML is called on this object, passing in the created document.

Returns:

 

See Also:

setSourceXML()

getXMLId

String getXMLId()
Returns the XML ID of this object.

Returns:

the XML ID.  

getXMLString

String getXMLString()
Returns the XML string of this object.

Returns:

 

See Also:

getXML()

getXMLTransformers

Array<String> getXMLTransformers()
Returns the list of XML transformers of this object.

Returns:

 

Since:

3.2

See Also:

setXMLTransformers()

getXMLURL

String getXMLURL()
Returns the XML URL of this object.

Returns:

 

getXSL

jsx3.xml.Document getXSL()
Returns the XSL source document of this object. The XSL document is determined by the following steps:
  1. If an XSL document exists in the server cache under an ID equal to the XSL ID of this object, that document is returned.
  2. (Deprecated) If the XSL string of this object is not null, a new document is created by parsing this string.
  3. (Deprecated) If the XSL URL of this object is not null, a new document is created by parsing the file at the location specified by the URL resolved against the server owning this object.
  4. Otherwise, the default stylesheet (Cacheable.DEFAULTSTYLESHEET) is returned.

Returns:

the XSL source document.  

getXSLId

String getXSLId()
Returns the XSL ID of this object.

Returns:

 

See Also:

setXMLTransformers()

getXSLParams

Object<String, String> getXSLParams()
Returns a map containing all the parameters to pass to the XSL stylesheet during transformation.

Returns:

 

getXSLString

String getXSLString()
Deprecated. Per-instance control of the XSL template is deprecated. Consider using the XML transformers functionality instead.
Returns the XSL string of this object.

Returns:

 

See Also:

setXMLTransformers()

getXSLURL

String getXSLURL()
Deprecated. Per-instance control of the XSL template is deprecated. Consider using the XML transformers functionality instead.
Returns the XSL URL of this object.

Returns:

 

See Also:

setXMLTransformers()

getXmlAsync

int getXmlAsync()
Returns whether the XML data source of this object is loaded asynchronously.

Returns:

0 or 1

Since:

3.5

getXmlBind

int getXmlBind()
Returns whether this object is bound to the XML document stored in the data cache.

Returns:

0 or 1

Since:

3.5

onXmlBinding

protected void onXmlBinding(objEvent : Object)
This method is called in two situations:
  1. When the datasource of this object finishes loading (success, error, or timeout), if the xmlAsync property of this object is true, its datasource is specified as an XML URL, and the first time doTransform() was called the datasource was still loading.
  2. Any time the value stored in the server XML cache under the key equal to the XML Id of this object changes, if the xmlBind property of this object is true.
Any methods overriding this method should begin with a call to jsxsupermix().

Parameters:

objEventthe event published by the cache.

Since:

3.5

removeXSLParam

jsx3.xml.Cacheable removeXSLParam(strName : String)
Removes a parameter from the list of parameters to pass to the XSL stylesheet during transformation.

Parameters:

strNamethe name of the XSL parameter to remove.

Returns:

this object.  

removeXSLParams

jsx3.xml.Cacheable removeXSLParams()
Removes all parameters from the list of parameters to pass to the XSL stylesheet during transformation.

Returns:

this object.  

resetCacheData

void resetCacheData(objServer : jsx3.app.Server)
Removes the XML and XSL source documents from the server cache.

Parameters:

objServerthe server owning the cache to modify. This is a required argument only if this.getServer() does not returns a server instance.

resetData

void resetData()
Deprecated. renamed to clearXmlData()

resetXmlCacheData

void resetXmlCacheData(objServer : jsx3.app.Server)
Removes the XML source document stored under the XML ID of this object from the server cache.

Parameters:

objServerthe server owning the cache to modify. This is a required argument only if this.getServer() does not returns a server instance.

resetXslCacheData

void resetXslCacheData(objServer : jsx3.app.Server)
Deprecated. Per-instance control of the XSL template is deprecated. Consider using the XML transformers functionality instead.
Removes the XSL source document stored under the XSL ID of this object from the server cache.

Parameters:

objServerthe server owning the cache to modify. This is a required argument only if this.getServer() does not returns a server instance.

See Also:

setXMLTransformers()

setNodeSet

void setNodeSet(objNodeSet : jsx3.xml.Entity)
Deprecated.
Sets the node set of this object. If the node set of this object is set by calling this method, the default XSL transformation will use this node set instead of the return value of getXML() as the XML document to transform.

Parameters:

objNodeSet

setShareResources

jsx3.xml.Cacheable setShareResources(intShare : int)
Sets whether this object removes its XML and XSL source documents from the cache of its server when it is destroyed.

Parameters:

intShareCLEANUPRESOURCES or SHARERESOURCES. CLEANUPRESOURCES is the default value if the property is null.

Returns:

this object. 

See Also:

CLEANUPRESOURCES, SHARERESOURCES

setSourceXML

jsx3.xml.Document setSourceXML(objDoc : jsx3.xml.Document, objCache : jsx3.app.Cache)
Sets the source document of this object as though objDoc were retrieved from the XML URL or XML string of this object. This method executes the following steps:
  1. The document is transformed serially by each XML transformers of this object.
  2. The XML document is saved in the server cache under the XML ID of this object.
  3. If this object is an instance of jsx3.xml.CDF and the root node is a <data> element and its jsxassignids attribute is equal to 1, all <record> elements without a jsxid attribute are assigned a unique jsxid.
  4. If this object is an instance of jsx3.xml.CDF, convertProperties() is called on this object.

Parameters:

objDoc
objCache

Returns:

the document stored in the server cache as the data source of this object. If transformers were run, this value will not be equal to the objDoc parameter. 

See Also:

jsx3.xml.CDF, jsx3.xml.CDF.convertProperties(), setXMLTransformers()

setXMLId

jsx3.xml.Cacheable setXMLId(strXMLId : String)
Sets the XML ID of this object. This value is the key under which the XML source document of this object is saved in the cache of the server owning this object. The developer may specify either a unique or shared value. If no value is specified, a unique id is generated.

Parameters:

strXMLId

Returns:

this object. 

See Also:

getXML()

setXMLString

jsx3.xml.Cacheable setXMLString(strXML : String)
Sets the XML string of this object. Setting this value to the string serialization of an XML document is one way of specifying the source XML document of this object.

Parameters:

strXMLnull or a well-formed serialized XML element.

Returns:

this object. 

See Also:

getXML()

setXMLTransformers

void setXMLTransformers(arrTrans : Array<String>)
Sets the list of XML transformers of this object. The XML source document of this object is transformed serially by each of these transformers before it is placed in the XML cache.

Each transformer is either the URI of an XSLT document (which will be resolved against the the server of this object) or the cache id of a XSLT document in the XML cache of the server of this object. When any transformer is loaded from a URI it is placed in the server cache under the id equal to its resolved URI. Any transformer that does not correspond to a valid XSLT document will be skipped without throwing an error.

Parameters:

arrTrans

Since:

3.2

setXMLURL

jsx3.xml.Cacheable setXMLURL(strXMLURL : String)
Sets the XML URL of this object. Settings this value to the URI of an XML document is one way of specifying the source XML document of this object.

Parameters:

strXMLURLnull or a URI that when resolved against the server owning this object specifies a valid XML document.

Returns:

this object. 

See Also:

getXML()

setXSLId

jsx3.xml.Cacheable setXSLId(strXSLId : String)
Deprecated. Per-instance control of the XSL template is deprecated. Consider using the XML transformers functionality instead.
Sets the XSL ID of this object.

Parameters:

strXSLId

Returns:

this object. 

See Also:

getXSL(), setXMLTransformers()

setXSLParam

jsx3.xml.Cacheable setXSLParam(strName : String, strValue : String)
Adds a name/value pair to the list of parameters to pass to the XSL stylesheet during transformation. If strValue is null the parameter is removed.

Parameters:

strNamethe name of the XSL parameter to add.
strValuethe value of the XSL parameter to add.

Returns:

this object.  

setXSLString

jsx3.xml.Cacheable setXSLString(strXSL : String)
Deprecated. Per-instance control of the XSL template is deprecated. Consider using the XML transformers functionality instead.
Sets the XSL string of this object.

Parameters:

strXSL

Returns:

this object. 

See Also:

getXSL(), setXMLTransformers()

setXSLURL

jsx3.xml.Cacheable setXSLURL(strXSLURL : String)
Deprecated. Per-instance control of the XSL template is deprecated. Consider using the XML transformers functionality instead.
Sets the XSL URL of this object.

Parameters:

strXSLURL

Returns:

this object. 

See Also:

getXSL(), setXMLTransformers()

setXmlAsync

jsx3.xml.Cacheable setXmlAsync(bAsync : boolean)
Sets whether the XML data source of this object is loaded asynchronously. This setting only applies to data sources loaded from an XML URL.

Parameters:

bAsync

Returns:

this object. 

Since:

3.5

setXmlBind

int setXmlBind(bBind : ?)
Sets whether this object is bound to the XML document stored in the data cache. If this object is bound to the cache, then the onXmlBinding() method of this object is called any time the document stored in the cache under the XML Id of this object changes.

Parameters:

bBind

Returns:

0 or 1

Since:

3.5