Author: jmorliaguet
Date: Sat Oct 29 01:59:13 2005
New Revision: 28795

Added:
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example5/__init__.py   (contents, props 
changed)
Modified:
   z3lab/z3ecm/trunk/src/ecm/cpsskins/README.txt
   z3lab/z3ecm/trunk/src/ecm/cpsskins/configure.zcml
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/README.txt
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/actions.py
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/counter.py
Log:

- API update



Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/README.txt
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/README.txt       (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/README.txt       Sat Oct 29 01:59:13 2005
@@ -5,7 +5,7 @@
 ===========================
 
 :Author: Jean-Marc Orliaguet
-:Version: $Revision: 3 $
+:Version: $Revision: 4 $
 :Copyright: 2005 Nuxeo and Contributors.
 
 .. contents::
@@ -231,6 +231,20 @@
 TODO
 
 
+example6/
+~~~~~~~~~
+
+The Counter portlet increments a counter stored in the request.
+Then it displays the following message:
+
+  "There are *n* portlets on this page."
+
+Obviously all the portlets located on a same page and that are rendered under
+a same request need to be updated before any of them is rendered.
+
+* See the example: `<example6/README.html>`_
+
+
 B) How to write a widget
 ------------------------
 

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/configure.zcml
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/configure.zcml   (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/configure.zcml   Sat Oct 29 01:59:13 2005
@@ -10,4 +10,6 @@
 
   <include package=".example4" />
 
+  <include package=".example6" />
+
 </configure>

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/README.txt
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/README.txt      (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/README.txt      Sat Oct 29 
01:59:13 2005
@@ -59,7 +59,7 @@
 
     >>> from cpsskins.interfaces import IPortlet
 
-Then define the interface for your portlet: 
+Then define the portlet interface::
 
     >>> class IHelloPortlet(IPortlet):
     >>>     """The Hello portlet interface."""

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/actions.py
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/actions.py      (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/actions.py      Sat Oct 29 
01:59:13 2005
@@ -23,7 +23,7 @@
 from zope.interface import implements
 from zope.schema import TextLine
 
-from cpsskins import Portlet, getContexts
+from cpsskins import Portlet
 
 from cpsskins.interfaces import IPortlet
 from cpsskins.model import Items, Item
@@ -46,10 +46,8 @@
         self.category = category
 
     def __call__(self, info):
-        request = info.request
-        contexts = getContexts(request)
-
-        location = contexts['location']
+        location = info.globals.location
+        request = info.globals.request
 
         try:
            menu = getMenu(self.category, location, request)

Added: z3lab/z3ecm/trunk/src/ecm/cpsskins/example5/__init__.py
==============================================================================
--- (empty file)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example5/__init__.py     Sat Oct 29 
01:59:13 2005
@@ -0,0 +1 @@
+# This is a package

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/counter.py
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/counter.py      (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example6/counter.py      Sat Oct 29 
01:59:13 2005
@@ -38,7 +38,7 @@
         self.title = title
 
     def __call__(self, info):
-        request = info.request
+        request = info.globals.request
         count = request.annotations.get(COUNTER_NAME, 0)
         return u"There are <b>%s</b> portlet(s) on this page." % str(count)
 
@@ -54,7 +54,7 @@
         self.context = context
 
     def __call__(self, info):
-        request = info.request
+        request = info.globals.request
 
         if COUNTER_NAME not in request.annotations:
             request.annotations[COUNTER_NAME] = 0
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to