Author: jmorliaguet
Date: Fri Oct 21 18:39:01 2005
New Revision: 28510

Modified:
   z3lab/cpsskins/branches/jmo-perspectives/configuration/elements/__init__.py
   
z3lab/cpsskins/branches/jmo-perspectives/configuration/portlets/metaconfigure.py
   z3lab/cpsskins/branches/jmo-perspectives/elements/displays/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/elements/views.py
   z3lab/cpsskins/branches/jmo-perspectives/interfaces.py
   z3lab/cpsskins/branches/jmo-perspectives/portlets/actions/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/portlets/breadcrumbs/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/portlets/custom/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/portlets/dummy/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/portlets/image/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/portlets/macroslot/__init__.py
Log:

- some updates to make the examples in the cpsskins tutorial work



Modified: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/elements/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/configuration/elements/__init__.py 
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/configuration/elements/__init__.py 
Fri Oct 21 18:39:01 2005
@@ -28,6 +28,7 @@
 from cpsskins.portlets.image import IImagePortlet
 from cpsskins.portlets.breadcrumbs import IBreadcrumbsPortlet
 from cpsskins.portlets.custom import ICustomPortlet
+from cpsskins.interfaces import IPortlet
 
 factories = {
 
@@ -67,6 +68,14 @@
             }
         },
 
+    IPortlet: {
+        'display': 'box',
+        'formats': {
+            'widget': 'plain_html',
+            'style': '',
+            }
+        },
+
     IMacroSlotPortlet: {
         'display': 'box',
         'formats': {

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/portlets/metaconfigure.py
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/configuration/portlets/metaconfigure.py
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/configuration/portlets/metaconfigure.py
    Fri Oct 21 18:39:01 2005
@@ -30,10 +30,10 @@
 from zope.configuration.exceptions import ConfigurationError
 from zope.interface import classImplements, Interface, alsoProvides
 
-from cpsskins.browser.rendering.interfaces import IContextInfo, IDisplayData
+from cpsskins import browser
+from cpsskins.interfaces import IContextInfo, IDisplayData
 
-def getAbsolutePath(_context, file):
-    return os.path.abspath(str(_context.path(file)))
+browser_path = os.path.dirname(browser.__file__)
 
 def portlet(_context,
             name=None,
@@ -79,13 +79,12 @@
         schema = schema,
         name = 'edit.html',
         title = 'Edit',
-        template = getAbsolutePath(_context,
-            '../../browser/authoring/portlet_editor.pt'
-        ),
+        template = browser_path + '/authoring/portlet_editor.pt',
         permission="zope.ManageContent",
         menu=zmi_views,
         )()
 
+
     # browser:addMenuItem
     addMenuItem(_context=_context,
         menu=cpsskins_add_portlet,

Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/displays/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/displays/__init__.py      
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/displays/__init__.py      
Fri Oct 21 18:39:01 2005
@@ -212,7 +212,9 @@
         """
         from cpsskins.configuration.elements import factories, 
display_factories
         context = self.context
-        factory_info = factories[context.getContentType()]
+        factory_info = factories.get(context.getContentType())
+        if factory_info is None:
+            factory_info = factories.get(context.getElementType())
         display_name = factory_info['display']
         factory = display_factories[display_name]
         return apply(factory, ())

Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/views.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/views.py  (original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/views.py  Fri Oct 21 
18:39:01 2005
@@ -59,7 +59,9 @@
         display = displayable.addDisplay(perspective)
 
         formattable = IFormattable(display)
-        factory_info = factories[context.getContentType()]
+        factory_info = factories.get(context.getContentType())
+        if factory_info is None:
+            factory_info = factories.get(context.getElementType())
         for type, id in factory_info['formats'].items():
             formattable.addFormat(type, id)
 

Modified: z3lab/cpsskins/branches/jmo-perspectives/interfaces.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/interfaces.py      (original)
+++ z3lab/cpsskins/branches/jmo-perspectives/interfaces.py      Fri Oct 21 
18:39:01 2005
@@ -22,6 +22,7 @@
 from zope.i18nmessageid import MessageFactory
 
 from cpsskins.elements.interfaces import IPortlet
+from cpsskins.browser.rendering.interfaces import IContextInfo, IDisplayData
 
 _ = MessageFactory("cpsskins")
 

Modified: z3lab/cpsskins/branches/jmo-perspectives/portlets/actions/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/portlets/actions/__init__.py       
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/portlets/actions/__init__.py       
Fri Oct 21 18:39:01 2005
@@ -26,8 +26,7 @@
 from zope.i18nmessageid import MessageFactory
 
 from cpsskins import Portlet
-from cpsskins.browser.rendering.interfaces import IContextInfo, IDisplayData
-from cpsskins.interfaces import IPortlet
+from cpsskins.interfaces import IPortlet, IContextInfo, IDisplayData
 from cpsskins.model import Items, Item
 
 _ = MessageFactory("cpsskins")

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/portlets/breadcrumbs/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/portlets/breadcrumbs/__init__.py   
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/portlets/breadcrumbs/__init__.py   
Fri Oct 21 18:39:01 2005
@@ -23,8 +23,7 @@
 from zope.i18nmessageid import MessageFactory
 
 from cpsskins import Portlet
-from cpsskins.browser.rendering.interfaces import IContextInfo, IDisplayData
-from cpsskins.interfaces import IPortlet
+from cpsskins.interfaces import IPortlet, IContextInfo, IDisplayData
 from cpsskins.model import Items, Item
 
 _ = MessageFactory("cpsskins")

Modified: z3lab/cpsskins/branches/jmo-perspectives/portlets/custom/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/portlets/custom/__init__.py        
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/portlets/custom/__init__.py        
Fri Oct 21 18:39:01 2005
@@ -29,8 +29,7 @@
 from zope.schema.vocabulary import SimpleVocabulary
 
 from cpsskins import Portlet
-from cpsskins.browser.rendering.interfaces import IContextInfo, IDisplayData
-from cpsskins.interfaces import IPortlet
+from cpsskins.interfaces import IPortlet, IContextInfo, IDisplayData
 
 _ = MessageFactory("cpsskins")
 

Modified: z3lab/cpsskins/branches/jmo-perspectives/portlets/dummy/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/portlets/dummy/__init__.py 
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/portlets/dummy/__init__.py Fri Oct 
21 18:39:01 2005
@@ -22,9 +22,8 @@
 from zope.schema import Text
 from zope.i18nmessageid import MessageFactory
 
-from cpsskins.browser.rendering.interfaces import IContextInfo, IDisplayData
-from cpsskins.interfaces import IPortlet
 from cpsskins import Portlet
+from cpsskins.interfaces import IPortlet, IContextInfo, IDisplayData
 
 _ = MessageFactory("cpsskins")
 

Modified: z3lab/cpsskins/branches/jmo-perspectives/portlets/image/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/portlets/image/__init__.py 
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/portlets/image/__init__.py Fri Oct 
21 18:39:01 2005
@@ -26,8 +26,7 @@
 from zope.i18nmessageid import MessageFactory
 
 from cpsskins import Portlet
-from cpsskins.browser.rendering.interfaces import IContextInfo, IDisplayData
-from cpsskins.interfaces import IPortlet
+from cpsskins.interfaces import IPortlet, IContextInfo, IDisplayData
 from cpsskins.model import Image
 
 _ = MessageFactory("cpsskins")

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/portlets/macroslot/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/portlets/macroslot/__init__.py     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/portlets/macroslot/__init__.py     
Fri Oct 21 18:39:01 2005
@@ -25,9 +25,8 @@
 from zope.publisher.interfaces.browser import ILayer, IDefaultBrowserLayer
 from zope.publisher.interfaces.browser import IBrowserRequest
 
-from cpsskins.browser.rendering.interfaces import IContextInfo, IDisplayData
 from cpsskins.elements.portlet import Portlet
-from cpsskins.elements.interfaces import IPortlet
+from cpsskins.interfaces import IPortlet, IContextInfo, IDisplayData
 
 _ = MessageFactory("cpsskins")
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to