OverviewSingleDeprecated

jsx3.xml

interface CDF

jsx3.xml.CDF

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.Grid, jsx3.gui.List, jsx3.gui.Matrix, jsx3.gui.Menu, jsx3.gui.Select, jsx3.gui.Table, jsx3.gui.Tree, jsx3.xml.CDF.Document

interface CDF
Mixin interface that provides methods for accessing and manipulating an XML document in CDF schema.

Classes that implement this interface must also define a getXML() method. This interface uses that method to access the XML document for which it provides a CDF interface.

Class Summary
jsx3.xml.CDF.Document
A subclass of jsx3.xml.Document that implements the CDF interface.
Field Summary
static String
ATTR_DISABLED
static String
ATTR_EXECUTE
static String
ATTR_ID
static String
ATTR_IMG
static String
ATTR_KEYCODE
static String
ATTR_SELECTED
static String
ATTR_TEXT
static String
ATTR_TIP
static String
ATTR_UNSELECTABLE
static int
DELETE
static String
ELEM_RECORD
static String
ELEM_ROOT
static int
INSERT
static int
INSERTBEFORE
static int
UPDATE
Method Summary
jsx3.xml.Entity
adoptRecord(strSourceId : String | jsx3.xml.CDF, strRecordId : String, strParentRecordId : String, bRedraw : boolean)
Transfers a CDF record from another object to this object.
jsx3.xml.Entity
adoptRecordBefore(strSourceId : String | jsx3.xml.CDF, strRecordId : String, strSiblingRecordId : String, bRedraw : boolean)
Equivalent to adoptRecord, except that the to-be relationship is as a previousSibling to the CDF record identified by the parameter, strSiblingRecordId This method fails quietly if any of the following conditions apply: there is no record with a jsxid equal to strSourceId there is no record in the source object with a jsxid equal to strRecordId strSiblingRecordId is specified and there is no record in this object with a jsxid equal to strParentRecordId this object already has a record with jsxid equal to the record to adopt
void
convertProperties(objProps : jsx3.app.Properties, arrProps : Array<String>, bUnion : boolean)
Converts all attributes in this CDF document that are property keys of the form {key} to the value of the property.
jsx3.xml.Entity
deleteRecord(strRecordId : String, bRedraw : boolean)
Removes a record from the XML data source of this object.
void
deleteRecordProperty(strRecordId : String, strPropName : String, bRedraw : boolean)
Removes a specific property from a record.
static String
Generates a unique jsxid attribute for a CDF record.
Object<String, String>
getRecord(strRecordId : String)
Returns an object containing the attributes of a particular CDF record as property/value pairs.
jsx3.xml.Entity
getRecordNode(strRecordId : String)
Returns a record from the XML data source of this object.
static String
Deprecated.
jsx3.xml.Entity
insertRecord(objRecord : Object<String, String>, strParentRecordId : String, bRedraw : boolean)
Inserts a new record into the XML data source of this object.
jsx3.xml.Entity
insertRecordBefore(objRecord : Object<String, String>, strSiblingRecordId : String, bRedraw : boolean)
Creates a new CDF record and inserts it into the CDF data source of this object, before the record identified by strSiblingRecordId.
void
insertRecordNode(objRecordNode : jsx3.xml.Entity, strParentRecordId : String, bRedraw : boolean)
Inserts a new record into the XML data source of this object.
jsx3.xml.CDF
insertRecordProperty(strRecordId : String, strPropName : String, strPropValue : String, bRedraw : boolean)
Inserts a new property into an existing record with jsxid equal to strRecordId.
static jsx3.xml.Document
Creates a new XML document that represents an empty CDF document.
abstract void
redrawRecord(strRecordId : String, intAction : int)
An abstract method that must be implemented by any class that implements this interface.
jsx3.xml.Document
Deprecated. use jsx3.xml.Cacheable.resetXmlCacheData() instead
void
resetData(bRepaint : boolean)
Deprecated. Use jsx3.xml.Cacheable.clearXmlData() instead.
Field Detail

ATTR_DISABLED

static final String ATTR_DISABLED

ATTR_EXECUTE

static final String ATTR_EXECUTE

ATTR_ID

static final String ATTR_ID

ATTR_IMG

static final String ATTR_IMG

ATTR_KEYCODE

static final String ATTR_KEYCODE

ATTR_SELECTED

static final String ATTR_SELECTED

ATTR_TEXT

static final String ATTR_TEXT

ATTR_TIP

static final String ATTR_TIP

ATTR_UNSELECTABLE

static final String ATTR_UNSELECTABLE

DELETE

static final int DELETE

ELEM_RECORD

static final String ELEM_RECORD

ELEM_ROOT

static final String ELEM_ROOT

INSERT

static final int INSERT

INSERTBEFORE

static final int INSERTBEFORE

UPDATE

static final int UPDATE
Method Detail

adoptRecord

jsx3.xml.Entity adoptRecord(strSourceId : String | jsx3.xml.CDF, strRecordId : String, strParentRecordId : String, bRedraw : boolean)
Transfers a CDF record from another object to this object. If no XML data source exists yet for this object, an empty one is created before adding the new record. This method always updates the on-screen view of both the source and destination objects.

This method fails quietly if any of the following conditions apply:

Parameters:

strSourceIdeither the id of the source object or the source object itself.
strRecordIdthe jsxid attribute of the data record in the source object to transfer.
strParentRecordIdthe unique jsxid of an existing record. If this optional parameter is provided, the adopted record will be added as a child of this record. Otherwise, the adopted record will be added to the root data element.
bRedrawforces suppression of the insert event

Returns:

the adopted record.  

adoptRecordBefore

jsx3.xml.Entity adoptRecordBefore(strSourceId : String | jsx3.xml.CDF, strRecordId : String, strSiblingRecordId : String, bRedraw : boolean)
Equivalent to adoptRecord, except that the to-be relationship is as a previousSibling to the CDF record identified by the parameter, strSiblingRecordId

This method fails quietly if any of the following conditions apply:

Parameters:

strSourceIdeither the id of the source object or the source object itself.
strRecordIdthe jsxid attribute of the data record in the source object to transfer.
strSiblingRecordIdthe unique jsxid of an existing record in front of which the record identified by strSourceId will be placed
bRedrawif true or null, the on-screen view of this object is immediately updated to reflect the deleted record.

Returns:

the adopted record.  

convertProperties

void convertProperties(objProps : jsx3.app.Properties, arrProps : Array<String>, bUnion : boolean)
Converts all attributes in this CDF document that are property keys of the form {key} to the value of the property.

Parameters:

objPropsthe properties repository to query.
arrPropsif provided, these attributes are converted rather than the default set of attributes.
bUnionif true, arrProps is combined with the default set of attributes and those attributes are converted.

deleteRecord

jsx3.xml.Entity deleteRecord(strRecordId : String, bRedraw : boolean)
Removes a record from the XML data source of this object.

Parameters:

strRecordIdthe jsxid attribute of the data record to remove.
bRedrawif true or null, the on-screen view of this object is immediately updated to reflect the deleted record.

Returns:

the record removed from the data source or null if no such record found.  

deleteRecordProperty

void deleteRecordProperty(strRecordId : String, strPropName : String, bRedraw : boolean)
Removes a specific property from a record. If no such record exists in the XML document, this method fails quietly.

Parameters:

strRecordIdthe jsxid attribute of the data record to modify.
strPropNamethe name of the property to remove from the record.
bRedrawif true or null, the on-screen view of this object is immediately updated to reflect the deleted property.

getKey

static String getKey()
Generates a unique jsxid attribute for a CDF record. This method can be used for new CDF records when there is no natural unique key to assign to them.

Returns:

 

getRecord

Object<String, String> getRecord(strRecordId : String)
Returns an object containing the attributes of a particular CDF record as property/value pairs. The object returned by this method is a copy of the underlying data. Therefore, updates to this object will not affect the underlying data.

The following two lines of code evaluate to the same value:
objCDF.getRecord(strId).propName;
objCDF.getRecordNode(strId).getAttribute("propName");

Parameters:

strRecordIdthe jsxid attribute of the data record to return.

Returns:

the object representation of a CDF node or null if no such record found. 

See Also:

getRecordNode()

getRecordNode

jsx3.xml.Entity getRecordNode(strRecordId : String)
Returns a record from the XML data source of this object. This returned value is a handle to the record and not a clone. Therefore, any updates made to the returned value with update the XML document of this object. To reflect such changes in the on-screen view of this object, call redrawRecord(strRecordId, jsx3.xml.CDF.UPDATE); on this object.

Parameters:

strRecordIdthe jsxid attribute of the data record to return.

Returns:

the record node or null if none exists with a jsxid attribute equal to strRecordId

See Also:

redrawRecord(), getRecord()

getVersion

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

Returns:

 

insertRecord

jsx3.xml.Entity insertRecord(objRecord : Object<String, String>, strParentRecordId : String, bRedraw : boolean)
Inserts a new record into the XML data source of this object. If no XML data source exists yet for this object, an empty one is created before adding the new record. If a record already exists with an id equal to the jsxid property of objRecord, the operation is treated as an update, meaning the existing record is completely removed and a new record with the given jsxid is inserted.

Parameters:

objRecorda JavaScript object containing property/value pairs that define the attributes of the XML entity to create. Note that most classes that implement this interface require that all records have an attribute named jsxid that is unique across all records in the XML document. All property values will be treated as strings. Additionally, the following 3 characters are escaped: " > <.
strParentRecordIdthe unique jsxid of an existing record. If this optional parameter is provided and a record exists with a matching jsxid attribute, the new record will be added as a child of this record. Otherwise, the new record will be added to the root data element. However, if a record already exists with a jsxid attribute equal to the jsxid property of objRecord, this parameter will be ignored. In this case adoptRecord() must be called to change the parent of the record.
bRedrawif true or null, the on-screen view of this object is immediately updated to reflect the additional record.

Returns:

the newly created or updated entity. 

See Also:

adoptRecord()

insertRecordBefore

jsx3.xml.Entity insertRecordBefore(objRecord : Object<String, String>, strSiblingRecordId : String, bRedraw : boolean)
Creates a new CDF record and inserts it into the CDF data source of this object, before the record identified by strSiblingRecordId.

This method fails quietly if any of the following conditions apply:

Parameters:

objRecorda JavaScript object containing property/value pairs that define the attributes of the XML entity to create. Note that most classes that implement this interface require that all records have an attribute named jsxid that is unique across all records in the XML document. All property values will be treated as strings. Additionally, the following 3 characters are escaped: " > <.
strSiblingRecordIdthe unique jsxid of an existing record before which the new record will be inserted.
bRedrawif true or null, the on-screen view of this object is immediately updated to reflect the additional record.

Returns:

the newly created entity. 

See Also:

adoptRecordBefore()

insertRecordNode

void insertRecordNode(objRecordNode : jsx3.xml.Entity, strParentRecordId : String, bRedraw : boolean)
Inserts a new record into the XML data source of this object. This method is the same as insertRecord() except that its first parameter is of type jsx3.xml.Entity rather than Object.

Parameters:

objRecordNodean XML element of name record. Note that most classes that implement this interface require that all records have an attribute named jsxid that is unique across all records in the XML document.
strParentRecordIdthe unique jsxid of an existing record. If this optional parameter is provided and a record exists with a matching jsxid attribute, the new record will be added as a child of this record. Otherwise, the new record will be added to the root data element.
bRedrawif true or null, the on-screen view of this object is immediately updated to reflect the additional record.

See Also:

insertRecord()

insertRecordProperty

jsx3.xml.CDF insertRecordProperty(strRecordId : String, strPropName : String, strPropValue : String, bRedraw : boolean)
Inserts a new property into an existing record with jsxid equal to strRecordId. If the property already exists, the existing property value will be updated. If no such record exists in the XML document, this method fails quietly.

Parameters:

strRecordIdthe jsxid attribute of the data record to modify.
strPropNamethe name of the property to insert into the record.
strPropValuethe value of the property to insert.
bRedrawif true or null, the on-screen view of this object is immediately updated to reflect the inserted property.

Returns:

this object.  

newDocument

static jsx3.xml.Document newDocument()
Creates a new XML document that represents an empty CDF document. The XML source of the new document is <data jsxid="jsxroot"/>.

Returns:

the newly created document.  

redrawRecord

abstract void redrawRecord(strRecordId : String, intAction : int)
An abstract method that must be implemented by any class that implements this interface. Implementations of this method should redraw the specified record in the on-screen view.

Parameters:

strRecordIdthe jsxid attribute of the data record to redraw.
intActionINSERT, UPDATE, or DELETE.

See Also:

INSERT, UPDATE, DELETE

reloadFromSource

jsx3.xml.Document reloadFromSource(bSystem : boolean)
Deprecated. use jsx3.xml.Cacheable.resetXmlCacheData() instead
Removes this object's existing document from the cache and reloads the document from its original source. This method is different from the method resetData() in that this method does not reset the XML document of this object to an empty CDF document.

Parameters:

bSystemif true, the document will be removed even if this is a system-owned document

Returns:

jsx3.xml.Document instance 

See Also:

resetData(), jsx3.xml.Cacheable.resetXmlCacheData()

resetData

void resetData(bRepaint : boolean)
Deprecated. Use jsx3.xml.Cacheable.clearXmlData() instead.
Resets the XML of this control to the value returned by CDF.newDocument() and places the document in the server cache.

Parameters:

bRepaintif true or null, the on-screen view of this object is immediately updated to reflect the inserted property.

See Also:

newDocument(), jsx3.xml.Cacheable.clearXmlData()

span>