Author: jmorliaguet
Date: Tue May  9 22:45:43 2006
New Revision: 3092

Modified:
   cpsskins/branches/paris-sprint-2006/standard/filters/style/views.py

Log:

- using a RAM cache for storing session data (will store data in a cookie
  later), since zope3 considers Ajax.request and HTTP request as coming
  from different browsers. Hence there is no obvious way of sharing session
  data.



Modified: cpsskins/branches/paris-sprint-2006/standard/filters/style/views.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/filters/style/views.py 
(original)
+++ cpsskins/branches/paris-sprint-2006/standard/filters/style/views.py Tue May 
 9 22:45:43 2006
@@ -19,6 +19,7 @@
 
 from zope.component import getUtility
 from zope.app import zapi
+from zope.app.cache.ram import RAMCache
 from zope.app.session.interfaces import ISession
 
 from cpsskins import configuration
@@ -27,6 +28,8 @@
 from cpsskins.standard.formats.style import IStyle
 from cpsskins.utils import getThemeManager
 
+cache = RAMCache()
+
 class StyleEditor:
     """Style editor view"""
 
@@ -139,13 +142,9 @@
     ### Session  ######################################################
 
     def getSessionData(self):
-        try:
-            return self.session[u'style-editor-data']
-        except KeyError:
-            self.session[u'style-editor-data'] = {}
-        return {}
+        return cache.query('style-editor-data', {}, {})
 
     def setSessionData(self, data):
-        self.session[u'style-editor-data'] = data
+        cache.set(data, 'style-editor-data', {})
 
     data = property(getSessionData, setSessionData)
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to