[Laszlo-checkins] r11194 - openlaszlo/trunk/WEB-INF/lps/lfc/data

bargull@openlaszlo.org bargull at openlaszlo.org
Wed Sep 24 09:25:27 PDT 2008


Author: bargull
Date: 2008-09-24 09:25:23 -0700 (Wed, 24 Sep 2008)
New Revision: 11194

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs
Log:
Change 20080924-bargull-6ue by bargull at dell--p4--2-53 on 2008-09-24 17:35:56
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: proxied flag on LzDataset

New Features:

Bugs Fixed: LPP-7049

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

Documentation:

Release Notes:

Details:
LzDataset#proxied is defined as 'inheritableBoolean' so valid values are "true", "false" or "inherit", where "true"/"false" are changed to the boolean counterparts and "inherit" is changed to null.
So update the proxied-setter to use the same matching, but accept "true"/true and "false"/false and "inherit"/null, 
deprecate "setProxyRequests" in favour of the new setter. 
Update "isProxied", now that we make sure "proxied" is only one of true/false/null. 
 
    

Tests:
at bugreport



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs	2008-09-24 16:15:53 UTC (rev 11193)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/data/LzDataset.lzs	2008-09-24 16:25:23 UTC (rev 11194)
@@ -284,12 +284,24 @@
 
 /** @access private */
 var headers :LzParam = null;
+
 /** Proxy data requests via the proxy server. Inherits value from canvas.proxied flag.
   * @type Boolean or null
   * @lzxdefault null
   */
 var proxied :* = null;
 /** @access private */
+function $lzc$set_proxied (val:*) :void {
+    // @devnote: Object lookup does an auto string-coercion
+    var nval:* = ({'true': true, 'false': false, 'null': null, inherit: null})[val];
+    if (nval !== void(0)) {
+        this.proxied = nval;
+    } else if ($debug) {
+        Debug.warn("%w.proxied must be one of 'inherit', 'true', or 'false', but was %w", this, val);
+    }
+}
+
+/** @access private */
 var responseheaders :LzParam = null;
 /** If true, the client should ensure that each request is made, rather than just 
   * making and reporting the last request.
@@ -554,25 +566,20 @@
   * @param String val: If 'true', the dataset will make its request when it is 
   * initialized, if 'false', request will be direct, if 'inherit', it will inherit
   * from its datasource.
+  * @deprecated Use setAttribute('proxied', ...) instead.
   */
-function setProxyRequests (val:String) :void {
-    if (typeof(val) != 'string') {
-        if ($debug) {
-            Debug.warn("arg '%w' to setProxyRequests must be a string with value 'inherit', 'true', or 'false'", val);
-        }
-    } else {
-        this.proxied = val;
-    }
+final function setProxyRequests (val:String) :void {
+    if ($debug) Debug.deprecated(this, arguments.callee, this.setAttribute);
+    this.$lzc$set_proxied(val);
 }
 
-
 /**
   * Sets whether or not the dataset makes its request upon initialization
   * @param Boolean b: If true, the dataset will make its request when it is 
   * initialized
   * @deprecated Use setAttribute('request', ...) instead.
   */
-final function setRequest(b:Boolean) :void {
+final function setRequest (b:Boolean) :void {
     if ($debug) Debug.deprecated(this, arguments.callee, this.setAttribute);
     this.$lzc$set_request(b);
 }
@@ -639,8 +646,8 @@
   */
 function isProxied () :Boolean {
     // Check if the dataset has a "proxied" attribute which overrides dataset's value
-    if (this.proxied != null && this.proxied != "inherit") {
-        return (this.proxied == true); // coerce to boolean
+    if (this.proxied != null) {
+        return this.proxied;
     } else {
         return canvas.proxied;
     }



More information about the Laszlo-checkins mailing list