Author: jmorliaguet
Date: Sat Feb  4 18:44:55 2006
New Revision: 2290

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
   cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/browser.py
   cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/configure.zcml
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/configure.zcml
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/cpsskins_storage_adapters.pt
Log:

- rename "volatile" storage as "RAM" storage since 'volatile' is a reserved word

- added an example chat application that uses compound storages



Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Sat Feb  4 
18:44:55 2006
@@ -674,7 +674,7 @@
   _setStorageAdapter: function() {
     var storage_def = this.def.storage;
     if (!storage_def) {
-      storage_def = {"type": "volatile"};
+      storage_def = {"type": "ram"};
     }
     var model = this;
     var storage = Storages[storage_def.type](this);
@@ -734,7 +734,7 @@
     var current_data = this.read();
     var new_data = $H(current_data).merge(data);
     this.write(new_data);
-  },
+  }
 
 }
 
@@ -745,8 +745,8 @@
     return new CPSSkins.CompoundStorage(model);
   },
 
-  volatile: function(model) {
-    return new CPSSkins.VolatileStorage(model);
+  ram: function(model) {
+    return new CPSSkins.RAMStorage(model);
   },
 
   remote: function(model) {
@@ -796,8 +796,8 @@
   }
 });
 
-CPSSkins.VolatileStorage = Class.create();
-CPSSkins.VolatileStorage.prototype = Object.extend(
+CPSSkins.RAMStorage = Class.create();
+CPSSkins.RAMStorage.prototype = Object.extend(
   new CPSSkins.StorageAdapter(), {
 
   requestData: function() {

Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/browser.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/browser.py      
(original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/browser.py      
Sat Feb  4 18:44:55 2006
@@ -16,8 +16,6 @@
         self.session = ISession(self.request)['cpsskins']
 
     def getData1(self):
-        """Get the data from the 
-        """
         # sleep one second to simulate a delay
         time.sleep(1.5)
 
@@ -49,3 +47,20 @@
 
         # return the results
         return json.write(data)
+
+    def getData2(self):
+        data = self.session.get('data2', {})
+        return json.write(data)
+
+    def setData2(self, data):
+        data = json.read(data)
+
+        current_data = self.session.get('data2', {})
+        messages = current_data.get('messages', [])
+        messages.append({'message': data['message']});
+
+        data['messages'] = messages
+        self.session['data2'] = data
+
+        return json.write(data)
+

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/configure.zcml
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/configure.zcml  
(original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/configure.zcml  
Sat Feb  4 18:44:55 2006
@@ -17,6 +17,16 @@
         attribute="setData1"
     />
 
+    <browser:page
+        name="getData2"
+        attribute="getData2"
+    />
+
+    <browser:page
+        name="setData2"
+        attribute="setData2"
+    />
+
   </browser:pages>
 
   <include package=".functional" />

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/configure.zcml
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/configure.zcml
       (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/configure.zcml
       Sat Feb  4 18:44:55 2006
@@ -9,4 +9,12 @@
       template="cpsskins_storage_adapters.pt"
   />
 
+  <browser:page
+      for="*"
+      layer="cpsskins"
+      name="cpsskins_chat.html"
+      permission="zope.Public"
+      template="cpsskins_chat.pt"
+  />
+
 </configure>

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/cpsskins_storage_adapters.pt
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/cpsskins_storage_adapters.pt
 (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/zope3/functional/cpsskins_storage_adapters.pt
 Sat Feb  4 18:44:55 2006
@@ -137,10 +137,11 @@
   </ins>
 
 
-  <h2>Volatile storage</h2>
+  <h2>RAM storage</h2>
 
-  <p>In a <strong>volatile storage</strong> the data is entirely stored on the
-     client. The server is never accessed. There is no data persistence.</p>
+  <p>In a <strong>RAM storage</strong> the data is entirely stored in the
+     client's memory. The server is never accessed.
+     There is no data persistence.</p>
 
   <div id="area1">
 
@@ -151,7 +152,7 @@
       "content": ""
      },
      "storage": {
-       "type": "volatile"
+       "type": "ram"
        }
      }
     }
@@ -236,7 +237,7 @@
       "message": "Please wait ..."
      },
      "storage": {
-       "type": "volatile"
+       "type": "ram"
        }
     }}
     </ins>
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to