[Laszlo-checkins] r9040 - in openlaszlo/trunk: WEB-INF/lps/lfc/data WEB-INF/lps/lfc/helpers WEB-INF/lps/lfc/kernel/swf WEB-INF/lps/lfc/services docs/src/nav lps/components/lzunit lps/components/rpc lps/components/rpc/library lps/components/rpc/library/swf lps/components/utils/replicator
hqm@openlaszlo.org
hqm at openlaszlo.org
Thu May 8 07:29:51 PDT 2008
Author: hqm
Date: 2008-05-08 07:29:42 -0700 (Thu, 08 May 2008)
New Revision: 9040
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataElement.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataNode.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataText.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/helpers/LzCommand.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs
openlaszlo/trunk/WEB-INF/lps/lfc/services/LzBrowser.lzs
openlaszlo/trunk/docs/src/nav/toc.xml
openlaszlo/trunk/lps/components/lzunit/lzunit.lzx
openlaszlo/trunk/lps/components/rpc/ajax.lzx
openlaszlo/trunk/lps/components/rpc/library/rpc.js
openlaszlo/trunk/lps/components/rpc/library/swf/rpc.js
openlaszlo/trunk/lps/components/utils/replicator/replicator.lzx
Log:
Change 20080508-hqm-o by hqm at badtzmaru.home on 2008-05-08 09:28:35 EDT
in /Users/hqm/openlaszlo/trunk5
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: remove obsoleted LzDataNode class, update docs
New Features:
Bugs Fixed:
Technical Reviewer: ptw
QA Reviewer: pbr
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
The LzDataNode class had pretty much all it's functionality moved to lzDataNodeMixin, and there
were just a couple of static properties left on LzDataNode. I moved these to lzDataElement, and updated
the table of contents to not point to LzDataNode anymore.
Tests:
smokecheck
ant lztest
test/lfc/data/alldata.lzx
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataElement.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataElement.lzs 2008-05-08 13:39:17 UTC (rev 9039)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataElement.lzs 2008-05-08 14:29:42 UTC (rev 9040)
@@ -10,7 +10,7 @@
/**
* @shortdesc A node of hierarchical data.
- * @see LzDataNode LzDataText LzDataPointer
+ * @see LzDataNodeMixin LzDataText LzDataPointer
* @access public
*/
mixin LzDataElementMixin {
@@ -63,9 +63,9 @@
var attributes:* = null;
-/** Inserts the given LzDataNode before another node in this node's childNodes
- * @param LzDataNode newChild: the LzDataNode to insert
- * @param LzDataNode refChild: the LzDataNode to insert newChild before
+/** Inserts the given LzDataNodeMixin before another node in this node's childNodes
+ * @param LzDataNodeMixin newChild: the LzDataNodeMixin to insert
+ * @param LzDataNodeMixin refChild: the LzDataNodeMixin to insert newChild before
* @return LzDataElement: The new child, or null if the refChild wasn't found
*/
function insertBefore (newChild, refChild){
@@ -91,9 +91,9 @@
/**
- * Replaces a given LzDataNode in this node's childNodes with a new one.
- * @param LzDataNode newChild: the LzDataNode to add
- * @param LzDataNode oldChild: the LzDataNode to be replaced by the newChild
+ * Replaces a given LzDataNodeMixin in this node's childNodes with a new one.
+ * @param LzDataNodeMixin newChild: the LzDataNodeMixin to add
+ * @param LzDataNodeMixin oldChild: the LzDataNodeMixin to be replaced by the newChild
* @return LzDataElement: The new child, or null if the oldChild wasn't found
*/
function replaceChild (newChild, oldChild){
@@ -118,8 +118,8 @@
/**
* Removes a given node from this node's childNodes
- * @param LzDataNode oldChild: The LzDataNode to remove
- * @return LzDataNode: The removed child, or null if the oldChild was not found
+ * @param LzDataNodeMixin oldChild: The LzDataNodeMixin to remove
+ * @return LzDataNodeMixin: The removed child, or null if the oldChild was not found
*/
function removeChild (oldChild){
var reval = null;
@@ -138,8 +138,8 @@
/**
* Adds a child to this node's list of childNodes
- * @param LzDataNode newChild: The LzDataNode to add.
- * @return LzDataNode: The newChild.
+ * @param LzDataNodeMixin newChild: The LzDataNodeMixin to add.
+ * @return LzDataNodeMixin: The newChild.
*/
function appendChild (newChild){
if ( this.childNodes ){
@@ -173,7 +173,7 @@
* Returns a copy of this node.
* @param Boolean deep: If true, the children of this node will be part of the
* new node
- * @return LzDataNode: A copy of this node.
+ * @return LzDataNodeMixin: A copy of this node.
*/
function cloneNode ( deep ){
var n = new LzDataElement(this.nodeName);
@@ -256,7 +256,7 @@
/**
* Returns the first child of this node.
- * @return LzDataNode: The first child of this node
+ * @return LzDataNodeMixin: The first child of this node
*/
function getFirstChild (){
return this.childNodes[ 0 ];
@@ -268,7 +268,7 @@
/**
* Returns the last child of this node.
- * @return LzDataNode: The last child of this node
+ * @return LzDataNodeMixin: The last child of this node
*/
function getLastChild (){
return this.childNodes[ this.childNodes.length-1 ];
@@ -307,7 +307,7 @@
/**
* Sets the children of this node to the given array.
- * @param [LzDataNode] children: An array of LzDataNodes to be the new children
+ * @param [LzDataNodeMixin] children: An array of LzDataNodeMixins to be the new children
* of this node
*/
function setChildNodes ( children ){
@@ -356,7 +356,7 @@
var s= "";
for ( var i = 0; i < this.childNodes.length; i++ ){
var c = this.childNodes[ i ]
- if ( c.nodeType == LzDataNode.TEXT_NODE ){
+ if ( c.nodeType == LzDataElement.TEXT_NODE ){
s += c.data;
}
}
@@ -366,7 +366,7 @@
/**
* Returns a list of the childNodes of this node which have a given name
* @param String name: The name of the node to look for.
- * @return [LzDataNode]: A list of childNodes which have the given name.
+ * @return [LzDataNodeMixin]: A list of childNodes which have the given name.
*/
function getElementsByTagName (name) {
var r = [];
@@ -452,7 +452,7 @@
//Debug.info('k', this.attributes);
for ( var k in this.attributes ){
- s += " " + k + '="' + LzDataNode.__LZXMLescape( this.attributes[ k ] ) + '"';
+ s += " " + k + '="' + LzDataElement.__LZXMLescape( this.attributes[ k ] ) + '"';
if (s.length > len) { break; }
}
@@ -485,7 +485,7 @@
* way. This method sends the onDocumentChange event, which triggers
* datapointer updates
* @param String what: A description of what changed.
- * @param LzDataNode who: The node that changed.
+ * @param LzDataNodeMixin who: The node that changed.
* @param Number type: private
*/
function handleDocumentChange ( what , who , type, cobj=null ){
@@ -561,11 +561,11 @@
/**
* <p>
- * An LzDataElement represents a node a in a hierarchical dataset. An LzDataElement can contain other LzDataElements, or <classname>LzDataText</classname>, which represents a text node. See the example on <classname>LzDataNode</classname>.
+ * An LzDataElement represents a node a in a hierarchical dataset. An LzDataElement can contain other LzDataElements, or <classname>LzDataText</classname>, which represents a text node. See the example on <classname>LzDataNodeMixin</classname>.
* </p>
*
* @shortdesc A node of hierarchical data.
- * @see LzDataNode LzDataText LzDataPointer
+ * @see LzDataNodeMixin LzDataText LzDataPointer
* @access public
*/
class LzDataElement extends LzMiniNode with LzDataElementMixin, LzDataNodeMixin
@@ -575,7 +575,7 @@
function LzDataElement ( name , attributes = null, children = null) {
super(name, attributes, children);
this.nodeName = name;
- this.nodeType = LzDataNode.ELEMENT_NODE;
+ this.nodeType = LzDataElement.ELEMENT_NODE;
this.attributes = attributes;
this.ownerDocument = this;
if (children == null) {
@@ -664,4 +664,99 @@
return c;
}
+
+
+//@problem: how do I document these?
+static var ELEMENT_NODE = 1;
+static var TEXT_NODE = 3;
+static var DOCUMENT_NODE = 9;
+
+/** this is similar to the escape routine in LzText, but that one's shorter
+ * since flash it's just for escaping ><
+ * @access private
+ */
+static var __LZescapechars =
+{ '&': '&', '<': '<', '>': '>', '"': '"', "'": '''};
+
+
+/**
+ * @access private
+ */
+static function __LZXMLescape ( t ){
+ if ( typeof( t ) != "string" ) return t;
+
+ var olen = t.length;
+ var r = "";
+ for ( var i = 0; i < olen; i++ ){
+ //handle newlines
+ var code = t.charCodeAt( i );
+ if ( code < 32 ){
+ r += "&#x" + LzUtils.dectohex(code,0) + ";";
+ } else {
+ var c = t.charAt( i );
+ if ( LzDataElement.__LZescapechars[ c ] != null ){
+ r += LzDataElement.__LZescapechars[ c ];
+ } else {
+ r += c;
+ }
+ }
+ }
+
+ return r;
+}
+
+
+/**
+ * Converts string to XML data.
+ * @param String str: A valid string of XML. If the string is simple text, or
+ * that there isn't a single root element, this function returns null. In cases
+ * where the string is an invalid but well formatted snippet of XML, this
+ * function will close any tags to make for a valid XML document
+ * @param boolean trimwhitespace: if true, text nodes have whitespace trimmed from start and end.
+ * @param boolean nsprefix: if true, preserve namespace prefixes on node names and attribute names.
+ * @return LzDataElement: An LzDataElement which is the top of the hierarchy
+ * generated from the string
+ */
+static function stringToLzData( str, trimwhitespace=false, nsprefix=false ) {
+ // [todo hqm 2006-06] if we had try-catch, I'd try to catch errors in parseXML
+ // and return null in that case.
+ if (str != null && str != "") {
+ //Debug.info("stringToLzData: parsing: ", typeof(str), str);
+ var nativexml = LzXMLParser.parseXML(str, trimwhitespace, nsprefix);
+ var lfcnode = LzXMLTranslator.copyXML(nativexml, trimwhitespace, nsprefix);
+ return lfcnode;
+ } else {
+ return null;
+ }
+}
+
+static var whitespaceChars = {' ': true, '\r': true, '\n': true, '\t': true};
+
+
+/**
+ * trim whitespace from start and end of string
+ * @access private
+ */
+static function trim( str ) {
+ var whitech = LzDataElement.whitespaceChars;
+ var len = str.length;
+ var sindex = 0;
+ var eindex = str.length -1;
+ var ch;
+ while (sindex < len) {
+ ch = str.charAt(sindex);
+ if (whitech[ch] != true) break;
+ sindex++;
+ }
+
+ while (eindex > sindex) {
+ ch = str.charAt(eindex);
+ if (whitech[ch] != true) break;
+ eindex--;
+ }
+
+ return str.slice(sindex,eindex+1);
+}
+
+
} // End of LzDataElement
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataNode.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataNode.lzs 2008-05-08 13:39:17 UTC (rev 9039)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataNode.lzs 2008-05-08 14:29:42 UTC (rev 9040)
@@ -77,9 +77,8 @@
*/
var nodeType:*; // This is undefined. Set elsewhere
-/** @access private */
var parentNode:* = null;
-/** @access private */
+
var ownerDocument:*;
/** @access private */
var __LZo:* = -1;
@@ -87,7 +86,7 @@
var sel:Boolean = false;
/** An array of children of this node
- * @type LzDataNode
+ * @type LzDataNodeMixin
*/
var childNodes:* = null;
@@ -97,7 +96,7 @@
/**
* Returns the sibling before this one this node's parentNodes List of children
- * @return LzDataNode: The node preceeding this one in this node's childNodes
+ * @return LzDataNodeMixin: The node preceeding this one in this node's childNodes
*/
function getPreviousSibling (){
if (!this.parentNode) return null;
@@ -107,7 +106,7 @@
/**
* Returns the parent of this node
- * @return LzDataNode: the parent of this node
+ * @return LzDataNodeMixin: the parent of this node
*/
function getParent () {
return this.parentNode;
@@ -131,7 +130,7 @@
/**
* Returns the sibling after this one this node's parentNodes List of children
- * @return LzDataNode: The node succeeding this one in this node's childNodes
+ * @return LzDataNodeMixin: The node succeeding this one in this node's childNodes
*/
function getNextSibling (){
if (!this.parentNode) return null;
@@ -172,8 +171,8 @@
/**
- * Sets the LzDataNode which is the ownerDocument for this node.
- * @param LzDataNode ownerDoc: The LzDataNode to act as the ownerDocument for
+ * Sets the LzDataNodeMixin which is the ownerDocument for this node.
+ * @param LzDataNodeMixin ownerDoc: The LzDataNodeMixin to act as the ownerDocument for
* this node.
*/
function setOwnerDocument ( ownerDoc ){
@@ -208,49 +207,12 @@
// Only static methods and variables remain here
+/**
+ * @access private
+ */
class LzDataNode {
-//@problem: how do I document these?
-static var ELEMENT_NODE = 1;
-static var TEXT_NODE = 3;
-static var DOCUMENT_NODE = 9;
-
-/** this is similar to the escape routine in LzText, but that one's shorter
- * since flash it's just for escaping ><
- * @access private
- */
-static var __LZescapechars =
-{ '&': '&', '<': '<', '>': '>', '"': '"', "'": '''};
-
-
/**
- * @access private
- */
-static function __LZXMLescape ( t ){
- if ( typeof( t ) != "string" ) return t;
-
- var olen = t.length;
- var r = "";
- for ( var i = 0; i < olen; i++ ){
- //handle newlines
- var code = t.charCodeAt( i );
- if ( code < 32 ){
- r += "&#x" + LzUtils.dectohex(code,0) + ";";
- } else {
- var c = t.charAt( i );
- if ( LzDataNode.__LZescapechars[ c ] != null ){
- r += LzDataNode.__LZescapechars[ c ];
- } else {
- r += c;
- }
- }
- }
-
- return r;
-}
-
-
-/**
* Converts string to XML data.
* @param String str: A valid string of XML. If the string is simple text, or
* that there isn't a single root element, this function returns null. In cases
@@ -260,46 +222,16 @@
* @param boolean nsprefix: if true, preserve namespace prefixes on node names and attribute names.
* @return LzDataElement: An LzDataElement which is the top of the hierarchy
* generated from the string
+ * @deprecated Use <code>LzDataElement.stringToLzData</code>
*/
static function stringToLzData( str, trimwhitespace=false, nsprefix=false ) {
- // [todo hqm 2006-06] if we had try-catch, I'd try to catch errors in parseXML
- // and return null in that case.
- if (str != null && str != "") {
- //Debug.info("stringToLzData: parsing: ", typeof(str), str);
- var nativexml = LzXMLParser.parseXML(str, trimwhitespace, nsprefix);
- var lfcnode = LzXMLTranslator.copyXML(nativexml, trimwhitespace, nsprefix);
- return lfcnode;
- } else {
- return null;
+ if ( $debug ){
+ Debug.info("%s.%w is deprecated. Use `LzDataElement.stringToLzData` instead.",
+ this, arguments.callee);
}
-}
+ return LzDataElement.stringToLzData(str, trimwhitespace, nsprefix);
-static var whitespaceChars = {' ': true, '\r': true, '\n': true, '\t': true};
-
-
-/**
- * trim whitespace from start and end of string
- * @access private
- */
-static function trim( str ) {
- var whitech = LzDataNode.whitespaceChars;
- var len = str.length;
- var sindex = 0;
- var eindex = str.length -1;
- var ch;
- while (sindex < len) {
- ch = str.charAt(sindex);
- if (whitech[ch] != true) break;
- sindex++;
- }
-
- while (eindex > sindex) {
- ch = str.charAt(eindex);
- if (whitech[ch] != true) break;
- eindex--;
- }
-
- return str.slice(sindex,eindex+1);
}
+
} // End of LzDataNode
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataText.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataText.lzs 2008-05-08 13:39:17 UTC (rev 9039)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataText.lzs 2008-05-08 14:29:42 UTC (rev 9040)
@@ -9,10 +9,10 @@
*/
/**
- * An LzDataText represents a text node a in a hierarchical dataset. An LzDataText can only contain text data. It can be a child a of an <classname>LzDataElement</classname>. See the example on <classname>LzDataNode</classname>.
+ * An LzDataText represents a text node a in a hierarchical dataset. An LzDataText can only contain text data. It can be a child a of an <classname>LzDataElement</classname>. See the example on <classname>LzDataNodeMixin</classname>.
*
* @shortdesc Represents a text node in a set of data.
- * @see lzdatanode, lzdataelement, datapointer
+ * @see lzdatanodemixin, lzdataelement, datapointer
* @fixme [2006-07-26] (LPP-2412) The Instance reference is required for lzpix
* to run.
*/
@@ -23,7 +23,7 @@
*/
function LzDataText ( text ){
super();
- this.nodeType = LzDataNode.TEXT_NODE;
+ this.nodeType = LzDataElement.TEXT_NODE;
this.data = text;
}
@@ -45,7 +45,7 @@
/** This property is of type String, can raise a DOMException object on setting
* and can raise a DOMException object on retrieval. */
-//var nodeType = LzDataNode.TEXT_NODE;
+//var nodeType = LzDataElement.TEXT_NODE;
/** The name of this node.
* According to W3C-specs, nodeName for LzDataText should return
@@ -94,7 +94,7 @@
* @access private
*/
function serialize (len=null){
- return LzDataNode.__LZXMLescape( this.data );
+ return LzDataElement.__LZXMLescape( this.data );
}
/**
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs 2008-05-08 13:39:17 UTC (rev 9039)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDatapointer.lzs 2008-05-08 14:29:42 UTC (rev 9040)
@@ -99,10 +99,10 @@
/** @access private */
function $lzc$set_p (v) { this.setPointer(v); }
-/** The LzDataNode that the datapointer is pointing
+/** The LzDataNodeMixin that the datapointer is pointing
* to. Calling <method>setAttribute</method> on attribute calls
* <method>LzDatapointer.setPointer</method>.
- * @type LzDataNode
+ * @type LzDataNodeMixin
*/
var p = null;
// var data = null;
@@ -269,7 +269,7 @@
/**
* Points this datapointer at p.
- * @param LzDataNode p: The new target for this datapointer.
+ * @param LzDataNodeMixin p: The new target for this datapointer.
*/
function setPointer ( p ) {
this.setXPath( null );
@@ -638,7 +638,7 @@
if (p.childNodes) {
for ( var j = 0; j < p.childNodes.length;j++ ){
//remove nulls and text nodes
- if ( p.childNodes[ j ].nodeType==LzDataNode.ELEMENT_NODE){
+ if ( p.childNodes[ j ].nodeType==LzDataElement.ELEMENT_NODE){
cnt++;
if ( !range || cnt >= range[ 0 ] ){
np.push( p.childNodes[ j ] );
@@ -830,8 +830,8 @@
/**
* Gets the nodeType of the node that the datapointer is pointing to.
- * @return Integer: one of LzDataNode.ELEMENT_NODE, LzDataNode.TEXT_NODE,
- * LzDataNode.DOCUMENT_NODE or <code>undefined</code> if this datapointer
+ * @return Integer: one of LzDataElement.ELEMENT_NODE, LzDataElement.TEXT_NODE,
+ * LzDataElement.DOCUMENT_NODE or <code>undefined</code> if this datapointer
* does not point to a valid node
*/
function getNodeType (){
@@ -870,7 +870,7 @@
}
return;
}
- if (this.p.nodeType != LzDataNode.TEXT_NODE) {
+ if (this.p.nodeType != LzDataElement.TEXT_NODE) {
this.p.setNodeName( name );
}
}
@@ -889,7 +889,7 @@
}
return;
}
- if (this.p.nodeType != LzDataNode.TEXT_NODE) {
+ if (this.p.nodeType != LzDataElement.TEXT_NODE) {
return this.p.attributes;
}
}
@@ -906,7 +906,7 @@
}
return;
}
- if (this.p.nodeType != LzDataNode.TEXT_NODE) {
+ if (this.p.nodeType != LzDataElement.TEXT_NODE) {
return this.p.attributes[ name ];
}
}
@@ -924,7 +924,7 @@
}
return;
}
- if (this.p.nodeType != LzDataNode.TEXT_NODE) {
+ if (this.p.nodeType != LzDataElement.TEXT_NODE) {
this.p.setAttr( name, val );
}
}
@@ -940,7 +940,7 @@
}
return;
}
- if (this.p.nodeType != LzDataNode.TEXT_NODE) {
+ if (this.p.nodeType != LzDataElement.TEXT_NODE) {
this.p.removeAttr( name );
}
}
@@ -959,7 +959,7 @@
}
return;
}
- if (this.p.nodeType != LzDataNode.TEXT_NODE) {
+ if (this.p.nodeType != LzDataElement.TEXT_NODE) {
return this.p.__LZgetText();
}
}
@@ -981,11 +981,11 @@
return;
}
- if (this.p.nodeType != LzDataNode.TEXT_NODE) {
+ if (this.p.nodeType != LzDataElement.TEXT_NODE) {
// set the first text node you find; otherwise add one
var foundit = false;
for (var i = 0; i < this.p.childNodes.length; i++) {
- if ( this.p.childNodes[i].nodeType == LzDataNode.TEXT_NODE ) {
+ if ( this.p.childNodes[i].nodeType == LzDataElement.TEXT_NODE ) {
this.p.childNodes[i].setData( val );
foundit = true;
break;
@@ -1004,7 +1004,7 @@
* @return Integer: The number of child nodes for the current node
*/
function getNodeCount (){
- if (! this.p || this.p.nodeType == LzDataNode.TEXT_NODE) return 0;
+ if (! this.p || this.p.nodeType == LzDataElement.TEXT_NODE) return 0;
return this.p.childNodes.length || 0;
}
@@ -1031,7 +1031,7 @@
nn.appendChild( new LzDataText( text ) );
}
- if (this.p.nodeType != LzDataNode.TEXT_NODE) {
+ if (this.p.nodeType != LzDataElement.TEXT_NODE) {
this.p.appendChild( nn );
}
@@ -1101,7 +1101,7 @@
var n = dp.p.cloneNode( true );
- if (this.p.nodeType != LzDataNode.TEXT_NODE) {
+ if (this.p.nodeType != LzDataElement.TEXT_NODE) {
this.p.appendChild( n );
}
@@ -1310,7 +1310,7 @@
chgpkg.who == this.p
) ||
( chgpkg.who.parentNode == this.p &&
- chgpkg.who.nodeType == LzDataNode.TEXT_NODE
+ chgpkg.who.nodeType == LzDataElement.TEXT_NODE
)
)
:
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs 2008-05-08 13:39:17 UTC (rev 9039)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs 2008-05-08 14:29:42 UTC (rev 9040)
@@ -186,7 +186,7 @@
*/
var trimwhitespace = false;
-// var nodeType = LzDataNode.DOCUMENT_NODE;
+// var nodeType = LzDataElement.DOCUMENT_NODE;
/** When true, the server will attempt to cache
* response (defaults to false). There are security concerns
@@ -249,7 +249,7 @@
/** @access private */
override function construct ( parent , args ){
- this.nodeType = LzDataNode.DOCUMENT_NODE;
+ this.nodeType = LzDataElement.DOCUMENT_NODE;
this.queuerequests = false; // default to false, to emulate browser default
this.oncanvas = parent == canvas || parent == null;
@@ -857,7 +857,7 @@
/** @access private */
function setInitialData ( d ){
if (d != null) {
- var e = LzDataNode.stringToLzData(d, this.trimwhitespace, this.nsprefix);
+ var e = LzDataElement.stringToLzData(d, this.trimwhitespace, this.nsprefix);
if (e != null)
this.setData(e.childNodes);
}
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/helpers/LzCommand.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/helpers/LzCommand.lzs 2008-05-08 13:39:17 UTC (rev 9039)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/helpers/LzCommand.lzs 2008-05-08 14:29:42 UTC (rev 9040)
@@ -118,3 +118,5 @@
}
}; // End of LzCommand
+ConstructorMap[LzCommand.tagname] = LzCommand;
+
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs 2008-05-08 13:39:17 UTC (rev 9039)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzLoader.lzs 2008-05-08 14:29:42 UTC (rev 9040)
@@ -422,7 +422,7 @@
// text node?
if (node.nodeType == 3) {
if (trimwhitespace == true) {
- nv = LzDataNode.trim(nv);
+ nv = LzDataElement.trim(nv);
}
lfcnode = new LzDataText(nv);
} else {
@@ -472,7 +472,7 @@
var copyQueue = null;
// Task that is called periodically from Idle loop.
-// This does the work of copying the Flash XML tree into a LzDataNode tree.
+// This does the work of copying the Flash XML tree into a LzDataElement tree.
// Run the copy queue
/**
* @access private
@@ -513,7 +513,7 @@
var maxLoopTime = 2000; // 2 seconds
// Iterative implementation, using a queue, to translate a XMLNode tree into
-// a tree of LzDataNode.
+// a tree of LzDataElement.
//
// Queue contains list of XMLNodes to be copied
/**
@@ -548,10 +548,10 @@
// text node?
if (node.nodeType == 3) {
if (trimwhitespace == true) {
- nv = LzDataNode.trim(nv);
+ nv = LzDataElement.trim(nv);
}
// FIXME: [2008-3-31 pbr] This bypasses initialization
- lfcnode = {__proto__: LzDataText.prototype, data: nv, parentNode: lfcparent, nodeType: LzDataNode.TEXT_NODE};
+ lfcnode = {__proto__: LzDataText.prototype, data: nv, parentNode: lfcparent, nodeType: LzDataElement.TEXT_NODE};
} else {
// Do we need to copy attributes list as well?
// After this works, try bashing the __proto__
@@ -593,7 +593,7 @@
// FIXME: [2008-3-31 pbr] This bypasses initialization
lfcnode = { __proto__: LzDataElement.prototype,
- nodeType: LzDataNode.ELEMENT_NODE,
+ nodeType: LzDataElement.ELEMENT_NODE,
nodeName: nodename,
attributes: cattrs,
ownerDocument: lfcparent.ownerDocument,
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/services/LzBrowser.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/services/LzBrowser.lzs 2008-05-08 13:39:17 UTC (rev 9039)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/services/LzBrowser.lzs 2008-05-08 14:29:42 UTC (rev 9040)
@@ -297,7 +297,7 @@
* @param String str: The string to escape
*/
function xmlEscape (str) {
- return LzDataNode.__LZXMLescape( str );
+ return LzDataElement.__LZXMLescape( str );
}
/**
Modified: openlaszlo/trunk/docs/src/nav/toc.xml
===================================================================
--- openlaszlo/trunk/docs/src/nav/toc.xml 2008-05-08 13:39:17 UTC (rev 9039)
+++ openlaszlo/trunk/docs/src/nav/toc.xml 2008-05-08 14:29:42 UTC (rev 9040)
@@ -131,7 +131,6 @@
<item title="defaultdataprovider" href="defaultdataprovider.html" />
<item title="httpdataprovider" href="httpdataprovider.html" />
<item title="LzDataElement" href="LzDataElement.html" />
- <item title="LzDataNode" href="LzDataNode.html" />
<item title="LzDataProvider" href="LzDataProvider.html" />
<item title="LzDataRequest" href="LzDataRequest.html" />
<item title="LzDataText" href="LzDataText.html" />
Modified: openlaszlo/trunk/lps/components/lzunit/lzunit.lzx
===================================================================
--- openlaszlo/trunk/lps/components/lzunit/lzunit.lzx 2008-05-08 13:39:17 UTC (rev 9039)
+++ openlaszlo/trunk/lps/components/lzunit/lzunit.lzx 2008-05-08 14:29:42 UTC (rev 9040)
@@ -136,8 +136,8 @@
// this takes two string
function xmlstringequals (str1, str2) {
- var xml1 = LzDataNode.stringToLzData(str1)
- var xml2 = LzDataNode.stringToLzData(str2)
+ var xml1 = LzDataElement.stringToLzData(str1)
+ var xml2 = LzDataElement.stringToLzData(str2)
return xmlequals(xml1, xml2);
}
Modified: openlaszlo/trunk/lps/components/rpc/ajax.lzx
===================================================================
--- openlaszlo/trunk/lps/components/rpc/ajax.lzx 2008-05-08 13:39:17 UTC (rev 9039)
+++ openlaszlo/trunk/lps/components/rpc/ajax.lzx 2008-05-08 14:29:42 UTC (rev 9040)
@@ -187,7 +187,7 @@
</method>
<doc>
- <tag name="shortdesc"><text>An implementation of XMLHttpRequest (also called "AJAX")</text></tag>
+ <tag name="shortdesc"><text>An implementation of XMLHttpRequest (also called "AJAX") for compatibility in SWF runtimes</text></tag>
<text>
<p>This class implements the XMLHTTPRequest as <a href="http://developer.apple.com/internet/webcontent/xmlhttpreq.html" shape="rect">
specified</a> by the <a href="http://www.whatwg.org/specs/web-apps/current-work/#scripted-http" shape="rect">WHATWG</a> consortium.</p>
@@ -205,6 +205,12 @@
<li>Username/password Auth args to send() not supported</li>
</ul>
+
+ This implementation is simply a convenience wrapper
+ for the LzDataset API, which is the preferred way to
+ write runtime-portable code which loads XML data over
+ the network.
+
<programlisting>
<script>
function loadXMLDoc(url) {
Modified: openlaszlo/trunk/lps/components/rpc/library/rpc.js
===================================================================
--- openlaszlo/trunk/lps/components/rpc/library/rpc.js 2008-05-08 13:39:17 UTC (rev 9039)
+++ openlaszlo/trunk/lps/components/rpc/library/rpc.js 2008-05-08 14:29:42 UTC (rev 9040)
@@ -5,7 +5,7 @@
/* LZ_COPYRIGHT_BEGIN */
/****************************************************************************
- * Copyright (c) 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+ * Copyright (c) 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms *
****************************************************************************/
/* LZ_COPYRIGHT_END */
@@ -73,7 +73,7 @@
stub: stub, stubinfo: stubinfo,
seqnum: seqnum } );
- } else if ((data instanceof LzDataNode) && data.childNodes[0].nodeName == 'error') {
+ } else if ((data instanceof LzDataNodeMixin) && data.childNodes[0].nodeName == 'error') {
var error = data.childNodes[0].attributes['msg'];
Modified: openlaszlo/trunk/lps/components/rpc/library/swf/rpc.js
===================================================================
--- openlaszlo/trunk/lps/components/rpc/library/swf/rpc.js 2008-05-08 13:39:17 UTC (rev 9039)
+++ openlaszlo/trunk/lps/components/rpc/library/swf/rpc.js 2008-05-08 14:29:42 UTC (rev 9040)
@@ -75,7 +75,7 @@
stub: stub, stubinfo: stubinfo,
seqnum: seqnum } );
- } else if ((data instanceof LzDataNode) && data.childNodes[0].nodeName == 'error') {
+ } else if ((data instanceof LzDataNodeMixin) && data.childNodes[0].nodeName == 'error') {
var error = data.childNodes[0].attributes['msg'];
Modified: openlaszlo/trunk/lps/components/utils/replicator/replicator.lzx
===================================================================
--- openlaszlo/trunk/lps/components/utils/replicator/replicator.lzx 2008-05-08 13:39:17 UTC (rev 9039)
+++ openlaszlo/trunk/lps/components/utils/replicator/replicator.lzx 2008-05-08 14:29:42 UTC (rev 9040)
@@ -338,7 +338,7 @@
}
// Gets the clone for the given datanode
- // @param LzDataNode datanode: The datanode of the clone to get
+ // @param LzDataNodeMixin datanode: The datanode of the clone to get
function getCloneForNode (datanode) {
var l = this.clones.length;
for ( var i = 0; i < l; i++ ){
More information about the Laszlo-checkins
mailing list