[Laszlo-checkins] r9545 - in openlaszlo/trunk/WEB-INF/lps: lfc/data lfc/views schema

hqm@openlaszlo.org hqm at openlaszlo.org
Tue Jun 10 18:12:26 PDT 2008


Author: hqm
Date: 2008-06-10 18:12:23 -0700 (Tue, 10 Jun 2008)
New Revision: 9545

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs
   openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
   openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
   openlaszlo/trunk/WEB-INF/lps/schema/lfc.lzx
Log:
Change 20080610-hqm-i by hqm at badtzmaru.home on 2008-06-10 21:11:59 EDT
    in /Users/hqm/openlaszlo/trunk3
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary:  move global defaultdataprovider var to canvas

New Features:

Bugs Fixed: LPP-6139

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

Documentation:

Release Notes:

Details:

move defaultdataprovider and httpdataprovider globals to be canvas instance vars

 + add "dataprovider" as a documented attribtue of LzDataset

+ add dataset. dataprovider to the schema

Tests:

ant lztest
lfc/data/alldata.lzx



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs	2008-06-11 01:03:31 UTC (rev 9544)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs	2008-06-11 01:12:23 UTC (rev 9545)
@@ -106,7 +106,8 @@
 static var slashPat = "/";
 
 /** @access private */
-var dataprovider = defaultdataprovider;
+var dataprovider;
+
 /**  Create a new data request object for each request. Defaults to false.
  * @type Boolean
  */
@@ -282,6 +283,12 @@
         this.timeout = canvas.dataloadtimeout;
     }
 
+    if ('dataprovider' in  args && args.dataprovider) {
+        this.dataprovider = args.dataprovider;
+    } else {
+        this.dataprovider = canvas.defaultdataprovider;
+    }
+
     super.construct.apply(this, arguments);
 }
 

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs	2008-06-11 01:03:31 UTC (rev 9544)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzHTTPDataProvider.lzs	2008-06-11 01:12:23 UTC (rev 9545)
@@ -397,28 +397,3 @@
     var loader = null;
 
 }
-
-/**
-  * <p>
-  * <varname>httpdataprovider</varname> is a global variable bound to the system default HTTP DataProvider.   
-  * </p>  
-  * This will be an instance of <classname>LzHTTPDataProvider</classname>, which implements HTTP request
-  * transport. The default  value of the global <varname>defaultdataprovider</varname> is initially set to point
-  * to this same object. 
-  * @access public
-  */
-
-var httpdataprovider = new LzHTTPDataProvider();
-
-
-/**
-  * <p>
-  * <varname>defaultdataprovider</varname> is a global variable bound to the system default DataProvider.   
-  * </p>  
-  * By default, this will be an instance of <classname>LzHTTPDataProvider</classname>, which will also be pointed to by
-  * the global <varname>httpdataprovider</varname>.
-  * @access public
-  */
-
-var defaultdataprovider = httpdataprovider;
-

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs	2008-06-11 01:03:31 UTC (rev 9544)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/views/LaszloCanvas.lzs	2008-06-11 01:12:23 UTC (rev 9545)
@@ -126,7 +126,33 @@
       */
     var __LZmousemoveDel:LzDelegate;    
 
+
+
     /**
+     * <p>
+     * <varname>httpdataprovider</varname> is bound to the system default HTTP DataProvider.   
+     * </p>  
+     * This will be an instance of <classname>LzHTTPDataProvider</classname>, which implements HTTP request
+     * transport. The default  value of the <varname>canvas.defaultdataprovider</varname> is initially set to point
+     * to this same object. 
+     * @access public
+     */
+
+    var httpdataprovider = null;
+
+
+    /**
+     * <p>
+     * <varname>defaultdataprovider</varname> is bound to the system default DataProvider.
+     * </p>  
+     * By default, this will be an instance of <classname>LzHTTPDataProvider</classname>, which will also be pointed to by
+     * the <varname>canvas.httpdataprovider</varname>.
+     * @access public
+     */
+
+    var defaultdataprovider = null;
+
+    /**
       * @access private
       * LzCanvas 
       * 
@@ -300,6 +326,10 @@
         this.__LZmousedownDel = new LzDelegate( this , "__LZmousedown", LzGlobalMouse, 'onmousedown');// called on global mousedown
         this.__LZmousemoveDel = new LzDelegate( this , "__LZmousemove", LzGlobalMouse, 'onmousemove');// called on global mousemove
 
+        // Create the default dataprovider
+        this.defaultdataprovider = this.httpdataprovider = new LzHTTPDataProvider();
+
+
         LzPlatform.initCanvas(this);
 
         this.id = lz.Browser.getInitArg('id');

Modified: openlaszlo/trunk/WEB-INF/lps/schema/lfc.lzx
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/schema/lfc.lzx	2008-06-11 01:03:31 UTC (rev 9544)
+++ openlaszlo/trunk/WEB-INF/lps/schema/lfc.lzx	2008-06-11 01:12:23 UTC (rev 9545)
@@ -750,6 +750,9 @@
   <!-- The ontimeout event is recevied when a request times out -->
   <event name="ontimeout" />
  
+  <!-- An instance of LzDataprovider, which handles data requests -->
+  <attribute name="dataprovider" type="expression"/>
+
   <!-- HTTP request method = post | get -->
   <attribute name="querytype" type="string" value="GET" enum="post|get|put|delete|POST|GET|PUT|DELETE" />
 



More information about the Laszlo-checkins mailing list