Author: pbr
Date: 2008-03-19 09:00:58 -0700 (Wed, 19 Mar 2008)
New Revision: 8320

Added:
   openlaszlo/branches/devildog/test/swf9/data-6.lzx
   openlaszlo/branches/devildog/test/swf9/data-6a.lzx
Modified:
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzDataset.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzHTTPDataProvider.js
   openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzHTTPLoader.as
   openlaszlo/branches/devildog/test/swf9/data-5.lzx
Log:
Change 20080319-Philip-2 by [EMAIL PROTECTED] on 2008-03-19 11:33:35 EDT
     in /cygdrive/f/laszlo/svn/src/svn/openlaszlo/branches/devildog
     for http://svn.openlaszlo.org/openlaszlo/branches/devildog

Summary: Updates for HTTP data loading in swf9

New Features:

Bugs Fixed:

Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
data loading was working if the dataset was embedded in the app. 
These changes allow them to come from a file, or the web. The examples in 
/test/swf9 work on all platforms.


Tests:
/test/swf9/data-{1-6}.lzx in swf/swf9/dhtml.

Files:
M      test/swf9/data-5.lzx
A      test/swf9/data-6.lzx
A      test/swf9/data-6a.lzx
M      WEB-INF/lps/lfc/kernel/swf9/LzHTTPLoader.as
M      WEB-INF/lps/lfc/data/LzHTTPDataProvider.js
M      WEB-INF/lps/lfc/data/LzDataset.js

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080319-Philip-2.tar



Modified: openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzDataset.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzDataset.js      
2008-03-19 15:47:45 UTC (rev 8319)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzDataset.js      
2008-03-19 16:00:58 UTC (rev 8320)
@@ -91,8 +91,10 @@
   * @initarg src
   * @initarg timeout
   */
-class LzDataset extends LFCNode with LzDataElementMixin, LzDataNodeMixin {
 
+// [2008-03-18 pbr] dynamic is a temp fix to allow runtime property creation
+dynamic class LzDataset extends LFCNode with LzDataElementMixin, 
LzDataNodeMixin {
+
   static var setters = new LzInheritedHash(LFCNode.setters);
   static var getters = new LzInheritedHash(LFCNode.getters);
   static var defaultattrs = new LzInheritedHash(LFCNode.defaultattrs);
@@ -665,7 +667,7 @@
   * Does a request immediately using the current values.  If autorequest is 
true,
   * this method is called automatically when values change.
   */
-function doRequest() {
+function doRequest(ignore=null) {
 
     // We try to reuse the old datarequest object, unless
     // multirequest is true. If multirequest is true, we need
@@ -678,7 +680,7 @@
 
     dreq.src     = this.src;
     dreq.timeout = this.timeout;
-    dreq.status  = dreq.READY;
+    dreq.status  = LzDataRequest.READY;
     dreq.method = this.querytype;
 
     // If this.querystring is set, use it as the source of param

Modified: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzHTTPDataProvider.js
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzHTTPDataProvider.js     
2008-03-19 15:47:45 UTC (rev 8319)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/data/LzHTTPDataProvider.js     
2008-03-19 16:00:58 UTC (rev 8320)
@@ -22,6 +22,10 @@
 
 class LzHTTPDataProvider extends LzDataProvider {
 
+    function LzHTTPDataProvider ( parent:* = null, attrs:* = null, children:* 
= null, instcall:*  = null) {
+        super(parent,attrs,children,instcall);
+    }  
+
     /** @access private
      * @param LzHTTPDataRequest dreq: The data request
      */
@@ -277,6 +281,12 @@
 
 
 class LzHTTPDataRequest extends LzDataRequest {
+
+    function LzHTTPDataRequest ( parent:* = null, attrs:* = null, children:* = 
null, instcall:*  = null) {
+        super(parent,attrs,children,instcall);
+        this.requestor = parent;
+    }  
+
     var method = "GET"; //  : String; // GET, POST, PUT, DELETE
     var postbody; // : String
     var proxied;  // : boolean
@@ -288,7 +298,7 @@
 
     var requestheaders = null; // : LzParam object
 
-    var getresponsheaders = false;
+    var getresponseheaders = false;
     var responseheaders = null; // : LzParam object, returned by dataprovider
 
 

Modified: 
openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzHTTPLoader.as
===================================================================
--- openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzHTTPLoader.as    
2008-03-19 15:47:45 UTC (rev 8319)
+++ openlaszlo/branches/devildog/WEB-INF/lps/lfc/kernel/swf9/LzHTTPLoader.as    
2008-03-19 16:00:58 UTC (rev 8320)
@@ -30,6 +30,7 @@
     var responseText;
     var secure;
     var responseXML:XML;
+    var dataRequest;
 
     // The URLLoader object
     var loader:URLLoader;
@@ -314,6 +315,7 @@
     }
 
     private function completeHandler(event:Event):void {
+        // trace("completeHandler: " + event + ", target = " + event.target);
         if (event.target is URLLoader) {
             //            trace("completeHandler: " , this, loader);
             //trace("completeHandler: bytesLoaded" , loader.bytesLoaded, 
'bytesTotal', loader.bytesTotal);
@@ -327,8 +329,11 @@
             // Parse data into flash native XML and then convert to LFC 
LzDataElement tree
             try {
                 if (responseText != null && options.parsexml) {
+                    // This is almost identical to LzXMLParser.parseXML()
+                    // except ignoreWhitespace comes from options
                     XML.ignoreWhitespace = options.trimwhitespace;
-                    this.responseXML = new XML(responseText);
+                    this.responseXML = XML(responseText);
+                    this.responseXML.normalize();
                     lzxdata = LzXMLTranslator.copyXML(this.responseXML,
                                                       options.trimwhitespace,
                                                       options.nsprefix);
@@ -353,7 +358,7 @@
 
     private function securityErrorHandler(event:SecurityErrorEvent):void {
         trace("securityErrorHandler: " + event);
-        removeTimeout(loader);
+        removeTimeout(this);
         loadError(this, null);
     }
 
@@ -363,7 +368,7 @@
 
     private function ioErrorHandler(event:IOErrorEvent):void {
         trace("ioErrorHandler: " + event);
-        removeTimeout(loader);
+        removeTimeout(this);
         loadError(this, null);
     }
 

Modified: openlaszlo/branches/devildog/test/swf9/data-5.lzx
===================================================================
--- openlaszlo/branches/devildog/test/swf9/data-5.lzx   2008-03-19 15:47:45 UTC 
(rev 8319)
+++ openlaszlo/branches/devildog/test/swf9/data-5.lzx   2008-03-19 16:00:58 UTC 
(rev 8320)
@@ -1,11 +1,6 @@
 <canvas height="80" width="500" >
 
-<!--
-  <dataset name="myData" type="http" src="data.xml"/>
--->
-
-  <dataset name="myData" src="http:data.xml"/>
-
+  <dataset name="myData" request="true" type="http" src="data.xml"/>
   <attribute name="yvalue" value="0"/>
 
   <view name="myTable">

Added: openlaszlo/branches/devildog/test/swf9/data-6.lzx


Property changes on: openlaszlo/branches/devildog/test/swf9/data-6.lzx
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: openlaszlo/branches/devildog/test/swf9/data-6a.lzx


Property changes on: openlaszlo/branches/devildog/test/swf9/data-6a.lzx
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to