Author: jmorliaguet
Date: Tue Apr  4 12:21:37 2006
New Revision: 2778

Added:
   cpsskins/branches/jmo-perspectives/interfaces.py   (contents, props changed)
   cpsskins/branches/jmo-perspectives/standard/engines/
   cpsskins/branches/jmo-perspectives/standard/engines/__init__.py   (contents, 
props changed)
   cpsskins/branches/jmo-perspectives/standard/engines/configure.zcml
   cpsskins/branches/jmo-perspectives/standard/engines/default.zcml   
(contents, props changed)
   cpsskins/branches/jmo-perspectives/standard/engines/interfaces.py
      - copied unchanged from r2776, 
cpsskins/branches/jmo-perspectives/standard/interfaces.py
Removed:
   cpsskins/branches/jmo-perspectives/configuration/engines/interfaces.py
   cpsskins/branches/jmo-perspectives/configuration/widgets/interfaces.py
   cpsskins/branches/jmo-perspectives/portlets/interfaces.py
   cpsskins/branches/jmo-perspectives/standard/engine.zcml
   cpsskins/branches/jmo-perspectives/standard/interfaces.py
   cpsskins/branches/jmo-perspectives/ui/manager/interfaces.py
Modified:
   cpsskins/branches/jmo-perspectives/browser/configure.zcml
   cpsskins/branches/jmo-perspectives/caching.py
   cpsskins/branches/jmo-perspectives/configuration/engines/engine.py
   cpsskins/branches/jmo-perspectives/configuration/negotiation/metaconfigure.py
   cpsskins/branches/jmo-perspectives/configuration/widgets/widget.py
   cpsskins/branches/jmo-perspectives/configure.zcml
   cpsskins/branches/jmo-perspectives/portlets/__init__.py
   cpsskins/branches/jmo-perspectives/portlets/storage.py
   cpsskins/branches/jmo-perspectives/standard/configure.zcml
   cpsskins/branches/jmo-perspectives/standard/displays/storage.py
   cpsskins/branches/jmo-perspectives/standard/io/perspective.zcml
   cpsskins/branches/jmo-perspectives/standard/io/relation.zcml
   cpsskins/branches/jmo-perspectives/standard/io/style.zcml
   cpsskins/branches/jmo-perspectives/tests/setup.py
   cpsskins/branches/jmo-perspectives/thememanager.py
   cpsskins/branches/jmo-perspectives/ui/manager/configure.zcml
   cpsskins/branches/jmo-perspectives/ui/manager/views.py
   cpsskins/branches/jmo-perspectives/ui/screens/sitemanager/views.py
   cpsskins/branches/jmo-perspectives/utils.py
Log:

- more cleanup (interfaces.py files now only contain public interfaces)



Modified: cpsskins/branches/jmo-perspectives/browser/configure.zcml
==============================================================================
--- cpsskins/branches/jmo-perspectives/browser/configure.zcml   (original)
+++ cpsskins/branches/jmo-perspectives/browser/configure.zcml   Tue Apr  4 
12:21:37 2006
@@ -38,7 +38,7 @@
   />
 
   <containerViews
-      for="..interfaces.IThemeManagementFolder"
+      for="..thememanager.IThemeManagementFolder"
       contents="zope.ManageContent"
       index="zope.View"
       add="zope.ManageContent"

Modified: cpsskins/branches/jmo-perspectives/caching.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/caching.py       (original)
+++ cpsskins/branches/jmo-perspectives/caching.py       Tue Apr  4 12:21:37 2006
@@ -17,14 +17,21 @@
 """
 __docformat__ = "reStructuredText"
 
+from zope.app.cache.interfaces.ram import IRAMCache
 from zope.app.cache.ram import RAMCache
 from zope.interface import implements
 
-from cpsskins.interfaces import IImageCache
-
 cache = RAMCache()
 IMAGE_CACHE_ID = 'images'
 
+class IImageCache(IRAMCache):
+
+    def __getitem__(key):
+        """ """
+
+    def __setitem__(key, value):
+        """ """
+
 class ImageCache(RAMCache):
 
     implements(IImageCache)

Modified: cpsskins/branches/jmo-perspectives/configuration/engines/engine.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/configuration/engines/engine.py  
(original)
+++ cpsskins/branches/jmo-perspectives/configuration/engines/engine.py  Tue Apr 
 4 12:21:37 2006
@@ -18,9 +18,10 @@
 
 __docformat__ = "reStructuredText"
 
-from zope.interface import implements
+from zope.interface import implements, Interface
 
-from cpsskins.configuration.engines.interfaces import IEngine
+class IEngine(Interface):
+    """A rendering engine."""
 
 class Engine(object):
 

Modified: 
cpsskins/branches/jmo-perspectives/configuration/negotiation/metaconfigure.py
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/configuration/negotiation/metaconfigure.py   
    (original)
+++ 
cpsskins/branches/jmo-perspectives/configuration/negotiation/metaconfigure.py   
    Tue Apr  4 12:21:37 2006
@@ -23,11 +23,11 @@
 from zope.component import provideUtility, queryUtility
 
 from cpsskins.browser.negotiation.interfaces import INegotiationScheme
-from cpsskins.interfaces import IThemeManagementFolder
 from cpsskins.browser.negotiation.interfaces import INegotiationChain
 from cpsskins.browser.negotiation.interfaces import INegotiationStrategy
 from cpsskins.browser.negotiation.chain import NegotiationChain
 from cpsskins.browser.negotiation.strategy import NegotiationStrategy
+from cpsskins.thememanager import IThemeManagementFolder
 
 class negotiationchain(object):
 

Modified: cpsskins/branches/jmo-perspectives/configuration/widgets/widget.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/configuration/widgets/widget.py  
(original)
+++ cpsskins/branches/jmo-perspectives/configuration/widgets/widget.py  Tue Apr 
 4 12:21:37 2006
@@ -17,9 +17,28 @@
 """
 __docformat__ = "reStructuredText"
 
-from zope.interface import implements
+from zope.interface import implements, Interface, Attribute
+from zope.i18nmessageid import MessageFactory
+from zope.schema import Choice, TextLine
 
-from cpsskins.configuration.widgets.interfaces import IWidget
+_ = MessageFactory("cpsskins")
+
+class IWidget(Interface):
+    """A presentation widget"""
+
+    id = Choice(
+        title=_(u"Widget"),
+        description=_(u"A widget for displaying content"),
+        vocabulary="Widgets",
+        )
+
+    title = TextLine(
+        title=_(u"Widget title"),
+        )
+
+    type = Attribute(u"Widget type")
+
+    factory = Attribute(u"Widget factory")
 
 class Widget(object):
     """A widget.

Modified: cpsskins/branches/jmo-perspectives/configure.zcml
==============================================================================
--- cpsskins/branches/jmo-perspectives/configure.zcml   (original)
+++ cpsskins/branches/jmo-perspectives/configure.zcml   Tue Apr  4 12:21:37 2006
@@ -18,8 +18,8 @@
 
     <require
         permission="zope.ManageSite"
-        interface=".interfaces.IThemeManagementFolder"
-        set_schema=".interfaces.IThemeManagementFolder"
+        interface=".thememanager.IThemeManagementFolder"
+        set_schema=".thememanager.IThemeManagementFolder"
         />
 
     <require
@@ -30,7 +30,7 @@
   </localUtility>
 
   <subscriber
-      for=".interfaces.IThemeManagementFolder
+      for=".thememanager.IThemeManagementFolder
            zope.app.container.interfaces.IObjectAddedEvent"
       handler=".thememanager.added"
       />
@@ -40,7 +40,7 @@
   <class class=".caching.ImageCache">
 
     <implements
-        interface=".interfaces.IImageCache"
+        interface=".caching.IImageCache"
         />
 
     <factory
@@ -50,7 +50,7 @@
 
     <require
         permission="zope.View"
-        interface=".interfaces.IImageCache"
+        interface=".caching.IImageCache"
         />
 
   </class>

Added: cpsskins/branches/jmo-perspectives/interfaces.py
==============================================================================
--- (empty file)
+++ cpsskins/branches/jmo-perspectives/interfaces.py    Tue Apr  4 12:21:37 2006
@@ -0,0 +1,21 @@
+##############################################################################
+#
+# Copyright (c) 2005-2006 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id:$
+"""
+__docformat__ = "reStructuredText"
+
+from cpsskins.elements.interfaces import IElement, IPortlet, IDisplay, IFormat
+

Modified: cpsskins/branches/jmo-perspectives/portlets/__init__.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/portlets/__init__.py     (original)
+++ cpsskins/branches/jmo-perspectives/portlets/__init__.py     Tue Apr  4 
12:21:37 2006
@@ -16,6 +16,4 @@
 $Id$
 """
 __docformat__ = "reStructuredText"
-# Make this directory a package
-pass
 

Modified: cpsskins/branches/jmo-perspectives/portlets/storage.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/portlets/storage.py      (original)
+++ cpsskins/branches/jmo-perspectives/portlets/storage.py      Tue Apr  4 
12:21:37 2006
@@ -17,10 +17,16 @@
 """
 __docformat__ = "reStructuredText"
 
+from zope.app.container.constraints import contains
 from zope.interface import implements
 
+from cpsskins.elements.interfaces import IPortlet
 from cpsskins.storage import Storage
-from cpsskins.portlets.interfaces import IPortletStorage
+from cpsskins.storage.interfaces import IStorage
+
+class IPortletStorage(IStorage):
+
+    contains(IPortlet)
 
 class PortletStorage(Storage):
     """A BTree-based display container"""

Modified: cpsskins/branches/jmo-perspectives/standard/configure.zcml
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/configure.zcml  (original)
+++ cpsskins/branches/jmo-perspectives/standard/configure.zcml  Tue Apr  4 
12:21:37 2006
@@ -23,7 +23,7 @@
 
   <!-- Standard engine definition -->
 
-  <include file="engine.zcml" />
+  <include package=".engines" />
  
 
   <!-- Standard negotiation schemes -->

Modified: cpsskins/branches/jmo-perspectives/standard/displays/storage.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/displays/storage.py     
(original)
+++ cpsskins/branches/jmo-perspectives/standard/displays/storage.py     Tue Apr 
 4 12:21:37 2006
@@ -21,7 +21,6 @@
 from zope.interface import implements
 
 from cpsskins.elements.interfaces import IDisplay
-from cpsskins.standard.displays.interfaces import IDisplayStorage
 from cpsskins.storage import Storage
 from cpsskins.storage.interfaces import IStorage
 

Added: cpsskins/branches/jmo-perspectives/standard/engines/__init__.py
==============================================================================
--- (empty file)
+++ cpsskins/branches/jmo-perspectives/standard/engines/__init__.py     Tue Apr 
 4 12:21:37 2006
@@ -0,0 +1,18 @@
+##############################################################################
+#
+# Copyright (c) 2005-2006 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"

Added: cpsskins/branches/jmo-perspectives/standard/engines/configure.zcml
==============================================================================
--- (empty file)
+++ cpsskins/branches/jmo-perspectives/standard/engines/configure.zcml  Tue Apr 
 4 12:21:37 2006
@@ -0,0 +1,8 @@
+<configure
+    xmlns="http://namespaces.zope.org/cpsskins";>
+
+    <!-- default engine -->
+
+    <include file="default.zcml" />
+
+</configure>

Added: cpsskins/branches/jmo-perspectives/standard/engines/default.zcml
==============================================================================
--- (empty file)
+++ cpsskins/branches/jmo-perspectives/standard/engines/default.zcml    Tue Apr 
 4 12:21:37 2006
@@ -0,0 +1,85 @@
+<configure
+    xmlns="http://namespaces.zope.org/cpsskins";>
+
+  <engine
+      name="default"
+      accesskeys="default"
+  />
+
+  <renderer
+      engine="default"
+      for="cpsskins.elements.interfaces.ITheme"
+  />
+
+  <renderer
+      for="cpsskins.elements.interfaces.IThemePage"
+      engine="default"
+      >
+
+    <filter
+        name="widget"
+    />
+
+    <filter
+        name="layout"
+    />
+
+    <filter
+        name="style"
+    />
+
+    <filter
+        name="accesskeys"
+    />
+
+  </renderer>
+
+  <renderer
+      for="cpsskins.elements.interfaces.IPageBlock
+           cpsskins.elements.interfaces.ICell"
+      engine="default"
+      >
+
+    <filter
+        name="widget"
+    />
+
+    <filter
+        name="layout"
+    />
+
+    <filter
+        name="style"
+    />
+
+  </renderer>
+
+  <renderer
+      for="cpsskins.elements.interfaces.ISlot"
+      engine="default"
+  />
+
+  <renderer
+      for="cpsskins.elements.interfaces.IPortlet"
+      engine="default"
+      >
+
+    <filter
+        name="effect"
+    />
+
+    <filter
+        name="widget"
+    />
+
+    <filter
+        name="style"
+    />
+
+    <filter
+        name="htmlcleaner"
+    />
+
+  </renderer>
+
+</configure>

Modified: cpsskins/branches/jmo-perspectives/standard/io/perspective.zcml
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/io/perspective.zcml     
(original)
+++ cpsskins/branches/jmo-perspectives/standard/io/perspective.zcml     Tue Apr 
 4 12:21:37 2006
@@ -4,7 +4,7 @@
 
   <!-- XML export -->
   <browser:view
-      provides="cpsskins.standard.io.interfaces.IDataExporter"
+      provides="cpsskins.setup.interfaces.IDataExporter"
       for="cpsskins.perspectives.interfaces.IPerspective"
       class=".perspective.Exporter"
       permission="zope.ManageContent"

Modified: cpsskins/branches/jmo-perspectives/standard/io/relation.zcml
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/io/relation.zcml        
(original)
+++ cpsskins/branches/jmo-perspectives/standard/io/relation.zcml        Tue Apr 
 4 12:21:37 2006
@@ -4,7 +4,7 @@
 
   <!-- Relations -->
   <browser:view
-      provides="cpsskins.standard.io.interfaces.IDataExporter"
+      provides="cpsskins.setup.interfaces.IDataExporter"
       for="cpsskins.relations.interfaces.IRelation"
       class=".relation.Exporter"
       permission="zope.ManageContent"

Modified: cpsskins/branches/jmo-perspectives/standard/io/style.zcml
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/io/style.zcml   (original)
+++ cpsskins/branches/jmo-perspectives/standard/io/style.zcml   Tue Apr  4 
12:21:37 2006
@@ -4,7 +4,7 @@
 
   <!-- XML export -->
   <browser:view
-      provides="cpsskins.standard.io.interfaces.IDataExporter"
+      provides="cpsskins.setup.interfaces.IDataExporter"
       for="cpsskins.standard.formats.style.IStyle"
       class=".style.Exporter"
       permission="zope.ManageContent"

Modified: cpsskins/branches/jmo-perspectives/tests/setup.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/tests/setup.py   (original)
+++ cpsskins/branches/jmo-perspectives/tests/setup.py   Tue Apr  4 12:21:37 2006
@@ -35,7 +35,7 @@
 from cpsskins.relations.interfaces import IRelatable
 from cpsskins.relations.tool import RelationTool
 from cpsskins.relations.storage import RelationStorage
-from cpsskins.interfaces import IThemeManagementFolder
+from cpsskins.thememanager import IThemeManagementFolder
 
 def setUp(test):
     ztapi.provideAdapter(IDisplay, IPathAdapter, Formattable, 'formattable')

Modified: cpsskins/branches/jmo-perspectives/thememanager.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/thememanager.py  (original)
+++ cpsskins/branches/jmo-perspectives/thememanager.py  Tue Apr  4 12:21:37 2006
@@ -27,19 +27,19 @@
 from zope.app.intid.interfaces import IIntIds
 from zope.app.traversing.api import getParent
 from zope.component import getUtilitiesFor, getUtility
-from zope.interface import implements
+from zope.interface import implements, Interface
+from zope.i18nmessageid import MessageFactory
+from zope.schema import TextLine
 
-from cpsskins.caching import ImageCache
-from cpsskins.elements.interfaces import ITheme, IThemeContainer
+from cpsskins.caching import ImageCache, IImageCache
 from cpsskins.elements.interfaces import IFormattable
+from cpsskins.elements.interfaces import ITheme, IThemePage, IThemeContainer
 from cpsskins.standard.displays.storage import DisplayStorage, IDisplayStorage
 from cpsskins.standard.formats.storage import FormatStorage, IFormatStorage
-from cpsskins.interfaces import IThemeManagementFolder, IImageCache
 from cpsskins.ontology import isDefault, hasFormat, hasDisplay
 from cpsskins.perspectives import Perspective
 from cpsskins.perspectives.interfaces import IPerspective
-from cpsskins.portlets.interfaces import IPortletStorage
-from cpsskins.portlets.storage import PortletStorage
+from cpsskins.portlets.storage import PortletStorage, IPortletStorage
 from cpsskins.relations import MonadicRelation
 from cpsskins.relations.interfaces import IRelationStorage, IRelationTool
 from cpsskins.relations.storage import RelationStorage
@@ -48,9 +48,75 @@
 
 logger = logging.getLogger("cpsskins")
 
+_ = MessageFactory("cpsskins")
+
 def added(object, event):
     object.registerUtilities()
 
+class IThemeManagementFolder(Interface):
+    """Interface for theme management.
+
+    The methods may be moved to other classes.
+    """
+
+    negotiation = TextLine(
+        title=_(u"The negotiation strategy"),
+        description=_(u"The name of the negotiation strategy."),
+        required=False,
+        )
+
+    def getIdRegistry():
+        """Return the unique id registry."""
+
+    def getImageCache():
+        """Return the image cache."""
+
+    def getRelationStorage():
+        """Return the relation storage."""
+
+    def registerElement(element):
+        """Add an element to the unique id registry."""
+
+    def unregisterElement(element):
+        """Remove an element from the unique id registry."""
+
+    def getElementById(id):
+        """Return an element by its unique id. """
+
+    def addTheme(theme):
+        """Add a theme."""
+
+    def getThemes():
+        """Return the list of available themes."""
+
+    def getThemeByName(name):
+        """Return a theme by its name."""
+
+    def getDefaultTheme():
+        """Return the default theme."""
+
+    def getDefaultPage():
+        """Return the default page."""
+
+    def removeDisplays(object):
+        """Remove the display of an element
+        """
+
+    def removeFormats(object):
+        """Remove the display of an element
+        """
+
+    def getPerspectiveByName(name):
+        """Return a perspective by name
+        """
+
+    def addPerspective(perspective, id):
+        """Add a perspective to the storage
+        """
+
+    def listPerspectives():
+        """ """
+
 class ThemeManagementFolder(SiteManagementFolder):
     """A theme management utility that can contain multiple .
     themes
@@ -62,7 +128,7 @@
     >>> from zope.app.testing import ztapi
     >>> from cpsskins.thememanager import ThemeManagementFolder
     >>> thememanager = ThemeManagementFolder()
-    >>> from cpsskins.interfaces import IThemeManagementFolder
+    >>> from cpsskins.thememanager import IThemeManagementFolder
     >>> ztapi.provideUtility(IThemeManagementFolder, thememanager, 
name=u'themes')
     """
 

Modified: cpsskins/branches/jmo-perspectives/ui/manager/configure.zcml
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/manager/configure.zcml        
(original)
+++ cpsskins/branches/jmo-perspectives/ui/manager/configure.zcml        Tue Apr 
 4 12:21:37 2006
@@ -3,7 +3,7 @@
     xmlns:zope="http://namespaces.zope.org/zope";>
 
   <page
-      for="cpsskins.interfaces.IThemeManagementFolder"
+      for="cpsskins.thememanager.IThemeManagementFolder"
       name="themes-manager.html"
       menu="zmi_views"
       title="Themes"
@@ -13,7 +13,7 @@
   />
 
   <pages
-      for="cpsskins.interfaces.IThemeManagementFolder"
+      for="cpsskins.thememanager.IThemeManagementFolder"
       permission="zope.ManageContent"
       class=".ThemeManagerView">
 

Modified: cpsskins/branches/jmo-perspectives/ui/manager/views.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/manager/views.py      (original)
+++ cpsskins/branches/jmo-perspectives/ui/manager/views.py      Tue Apr  4 
12:21:37 2006
@@ -21,7 +21,7 @@
 
 from zope.app import zapi
 from zope.app.publisher.browser import BrowserView
-from zope.interface import implements
+from zope.interface import implements, Interface
 
 from cpsskins.browser.negotiation.interfaces import INegotiation
 from cpsskins.elements.interfaces import IDisplayable, IFormattable
@@ -32,7 +32,16 @@
 from cpsskins.elements.slot import Slot
 from cpsskins.ui.authoring.views import IAuthoring
 from cpsskins.utils import getThemeManager
-from interfaces import IThemeManagerView
+
+class IThemeManagerView(Interface):
+
+    def getThemes():
+        """Return the list of themes."""
+
+    def listThemeInfo():
+        """Return a dictionary with some information about the themes 
+        (id, title, url)
+        """
 
 class ThemeManagerView(BrowserView):
     """Themes manager view.

Modified: cpsskins/branches/jmo-perspectives/ui/screens/sitemanager/views.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/screens/sitemanager/views.py  
(original)
+++ cpsskins/branches/jmo-perspectives/ui/screens/sitemanager/views.py  Tue Apr 
 4 12:21:37 2006
@@ -24,9 +24,8 @@
 
 from cpsskins import minjson as json
 from cpsskins.elements.interfaces import IType
-from cpsskins.setup.interfaces import ISetting, IGlobalSetting
+from cpsskins.setup.interfaces import ISetting, IGlobalSetting, IDataExporter
 from cpsskins.setup.interfaces import IResourceType, IResourceManager, 
IResource
-from cpsskins.standard.io.interfaces import IDataExporter
 from cpsskins.setup.registration import reloadSetting, refreshSettings
 
 setting_xml = """<?xml version="1.0"?>

Modified: cpsskins/branches/jmo-perspectives/utils.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/utils.py (original)
+++ cpsskins/branches/jmo-perspectives/utils.py Tue Apr  4 12:21:37 2006
@@ -19,7 +19,7 @@
 
 from zope.component import queryUtility
 
-from cpsskins.interfaces import IThemeManagementFolder
+from cpsskins.thememanager import IThemeManagementFolder
 
 THEMES_MANAGER_NAME = 'themes'
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to