Author: jmorliaguet
Date: Mon May  1 13:23:52 2006
New Revision: 3003

Added:
   cpsskins/branches/paris-sprint-2006/elements/adapters.py   (contents, props 
changed)
Modified:
   cpsskins/branches/paris-sprint-2006/browser/rendering/renderer.py
   
cpsskins/branches/paris-sprint-2006/configuration/presentations/metaconfigure.py
   cpsskins/branches/paris-sprint-2006/elements/__init__.py
   cpsskins/branches/paris-sprint-2006/elements/cell.py
   cpsskins/branches/paris-sprint-2006/elements/configure.zcml
   cpsskins/branches/paris-sprint-2006/elements/display.py
   cpsskins/branches/paris-sprint-2006/elements/element.py
   cpsskins/branches/paris-sprint-2006/elements/format.py
   cpsskins/branches/paris-sprint-2006/elements/interfaces.py
   cpsskins/branches/paris-sprint-2006/elements/pageblock.py
   cpsskins/branches/paris-sprint-2006/elements/presentation.py
   cpsskins/branches/paris-sprint-2006/elements/slot.py
   cpsskins/branches/paris-sprint-2006/elements/themepage.py
   cpsskins/branches/paris-sprint-2006/ftests/test_appsetup.py
   cpsskins/branches/paris-sprint-2006/relations/relations.py
   cpsskins/branches/paris-sprint-2006/setup/README.txt
   cpsskins/branches/paris-sprint-2006/setup/adapters.py
   cpsskins/branches/paris-sprint-2006/setup/configure.zcml
   cpsskins/branches/paris-sprint-2006/setup/interfaces.py
   cpsskins/branches/paris-sprint-2006/setup/io.py
   cpsskins/branches/paris-sprint-2006/setup/manager.py
   cpsskins/branches/paris-sprint-2006/setup/setting.py
   cpsskins/branches/paris-sprint-2006/setup/test/dummy.py
   cpsskins/branches/paris-sprint-2006/setup/utils.py
   cpsskins/branches/paris-sprint-2006/standard/fields/color.py
   cpsskins/branches/paris-sprint-2006/standard/filters/style/__init__.py
   cpsskins/branches/paris-sprint-2006/standard/io/relation.py
   cpsskins/branches/paris-sprint-2006/standard/io/setting.py
   cpsskins/branches/paris-sprint-2006/standard/io/style.py
   cpsskins/branches/paris-sprint-2006/tests/setup.py
   cpsskins/branches/paris-sprint-2006/ui/editing/views.py
   cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/views.py
Log:

- some cleanup



Modified: cpsskins/branches/paris-sprint-2006/browser/rendering/renderer.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/browser/rendering/renderer.py   
(original)
+++ cpsskins/branches/paris-sprint-2006/browser/rendering/renderer.py   Mon May 
 1 13:23:52 2006
@@ -26,8 +26,8 @@
 
 from cpsskins import configuration
 from cpsskins.browser.rendering.interfaces import IRendererView, IFilterView
-from cpsskins.elements.interfaces import IType, INode, IElement, ILeaf
-from cpsskins.setup.interfaces import IResource, ISetting
+from cpsskins.elements.interfaces import INode, IElement, ILeaf
+from cpsskins.setup.interfaces import IResource, ISetting, IType
 
 logger = logging.getLogger("cpsskins")
 

Modified: 
cpsskins/branches/paris-sprint-2006/configuration/presentations/metaconfigure.py
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/configuration/presentations/metaconfigure.py
    (original)
+++ 
cpsskins/branches/paris-sprint-2006/configuration/presentations/metaconfigure.py
    Mon May  1 13:23:52 2006
@@ -22,7 +22,7 @@
 from zope.i18nmessageid import MessageFactory
 
 from cpsskins import configuration
-from cpsskins.elements.interfaces import IType
+from cpsskins.setup.interfaces import IType
 
 _ = MessageFactory("cpsskins")
 

Modified: cpsskins/branches/paris-sprint-2006/elements/__init__.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/__init__.py    (original)
+++ cpsskins/branches/paris-sprint-2006/elements/__init__.py    Mon May  1 
13:23:52 2006
@@ -17,7 +17,3 @@
 """
 __docformat__ = "reStructuredText"
 
-from cpsskins.elements.element import (
-    Element, Relatable, ElementNameChooser, Type,
-    Node, InnerNode, Leaf, NodeTraverser,
-    )

Added: cpsskins/branches/paris-sprint-2006/elements/adapters.py
==============================================================================
--- (empty file)
+++ cpsskins/branches/paris-sprint-2006/elements/adapters.py    Mon May  1 
13:23:52 2006
@@ -0,0 +1,91 @@
+##############################################################################
+#
+# 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 zope.app.container.interfaces import INameChooser
+from zope.app.zapi import getParent
+from zope.component import adapts
+from zope.interface import implements
+
+from cpsskins.elements.interfaces import IElement, INode
+from cpsskins.elements.interfaces import ILeaf, INodeTraverser
+from cpsskins.relations.interfaces import IRelatable
+from cpsskins.setup.interfaces import IType, IIdentifiable
+
+class Relatable(object):
+    """This adapter makes elements relatable.
+    """
+    adapts(IElement)
+    implements(IRelatable)
+
+    def __init__(self, element):
+        self.element = element
+
+    def __str__(self):
+        """Unless stated otherwise elements are identified in a relation
+        by their 'identifier' attribute.
+        """
+        id = self.element.identifier or u''
+        return str(id)
+
+class Identifiable(object):
+    """This adapter makes elements uniquely identifiable.
+    """
+    adapts(IElement)
+    implements(IIdentifiable)
+
+    def __init__(self, element):
+        self.element = element
+
+    def getURI(self):
+        element = self.element
+        type_name = IType(element).getTypeName()
+
+        relatable = IRelatable(element, None)
+        if relatable is None:
+            relatable = IRelatable(getParent(element), u'')
+        identifier = str(relatable)
+
+        return 'cpsskins://%s:%s' % (type_name, identifier)
+
+class NodeTraverser(object):
+    """An adapter for traversing the tree.
+    """
+    adapts(INode)
+    implements(INodeTraverser)
+
+    def __init__(self, node):
+        self.node = node
+
+    def getChildNodes(self, display=None, perspective=None):
+        """Return the list of child nodes implementing the specified interface
+           Override this method if the element is a virtual container.
+        """
+        node = self.node
+        if ILeaf.providedBy(node):
+            return []
+        return node.values()
+
+class ElementNameChooser:
+    """An adapter to choose names for elements.
+    """
+    adapts(IElement)
+    implements(INameChooser)
+
+    __used_for__ = IElement
+

Modified: cpsskins/branches/paris-sprint-2006/elements/cell.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/cell.py        (original)
+++ cpsskins/branches/paris-sprint-2006/elements/cell.py        Mon May  1 
13:23:52 2006
@@ -19,7 +19,7 @@
 
 from zope.interface import implements
 
-from cpsskins.elements import InnerNode
+from cpsskins.elements.element import InnerNode
 from cpsskins.elements.interfaces import ICell
 
 class Cell(InnerNode):

Modified: cpsskins/branches/paris-sprint-2006/elements/configure.zcml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/configure.zcml (original)
+++ cpsskins/branches/paris-sprint-2006/elements/configure.zcml Mon May  1 
13:23:52 2006
@@ -8,37 +8,25 @@
   <!-- name chooser for elements -->
 
   <adapter
-      factory=".element.ElementNameChooser"
+      factory=".adapters.ElementNameChooser"
   />
 
   <!-- this adapter makes elements relatable -->
 
   <adapter
-      factory=".element.Relatable"
+      factory=".adapters.Relatable"
   />
 
   <!-- this adapter makes elements identifiable -->
   <adapter
-      factory=".element.Identifiable"
+      factory=".adapters.Identifiable"
   />
 
-  <!-- this adapter makes elements typeable -->
-  <adapter
-      for="*"
-      factory=".element.Type"
-  />
-
-  <adapter
-      name="type"
-      provides="zope.traversing.interfaces.IPathAdapter"
-      for=".interfaces.IElement"
-      factory=".element.Type"
-  />
 
   <!-- these adapters make nodes traversable -->
 
   <adapter
-      factory=".NodeTraverser"
+      factory=".adapters.NodeTraverser"
   />
 
   <adapter

Modified: cpsskins/branches/paris-sprint-2006/elements/display.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/display.py     (original)
+++ cpsskins/branches/paris-sprint-2006/elements/display.py     Mon May  1 
13:23:52 2006
@@ -25,13 +25,13 @@
 from zope.security.proxy import removeSecurityProxy
 
 from cpsskins import configuration
-from cpsskins.elements import Element
-from cpsskins.elements.interfaces import IType
+from cpsskins.elements.element import Element
 from cpsskins.elements.interfaces import IDisplayable, IDisplay
 from cpsskins.perspectives.interfaces import IPerspective
 from cpsskins.relations import DyadicRelation, TriadicRelation
 from cpsskins.relations.interfaces import IRelationTool
 from cpsskins.ontology import hasDisplay, hasDisplayFromPerspective
+from cpsskins.setup.interfaces import IType
 from cpsskins.standard.displays.storage import IDisplayStorage
 from cpsskins.utils import getThemeManager
 

Modified: cpsskins/branches/paris-sprint-2006/elements/element.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/element.py     (original)
+++ cpsskins/branches/paris-sprint-2006/elements/element.py     Mon May  1 
13:23:52 2006
@@ -20,23 +20,10 @@
 from persistent import Persistent
 from zope.app.container.contained import Contained
 from zope.app.container.ordered import OrderedContainer
-from zope.app.container.interfaces import INameChooser
-from zope.app.content.interfaces import IContentType
-from zope.app.interface import queryType
-from zope.app.zapi import getParent
-from zope.component import adapts
 from zope.interface import implements
 
-from cpsskins.elements.interfaces import IElement, IElementType, IType, INode
-from cpsskins.elements.interfaces import IInnerNode, ILeaf, INodeTraverser
-from cpsskins.elements.interfaces import IIdentifiable
-from cpsskins.relations.interfaces import IRelatable
-from cpsskins.setup.interfaces import IResourceType
-from cpsskins.setup.utils import getTypeName
-
-def uniq(seq):
-    set = {}
-    return [set.setdefault(e, e) for e in seq if e not in set and e is not 
None]
+from cpsskins.elements.interfaces import IElement, INode
+from cpsskins.elements.interfaces import IInnerNode, ILeaf
 
 class Element(Contained):
     """An element
@@ -45,42 +32,6 @@
 
     identifier = None
 
-class Relatable(object):
-    """This adapter makes elements relatable.
-    """
-    adapts(IElement)
-    implements(IRelatable)
-
-    def __init__(self, element):
-        self.element = element
-
-    def __str__(self):
-        """Unless stated otherwise elements are identified in a relation
-        by their 'identifier' attribute.
-        """
-        id = self.element.identifier or u''
-        return str(id)
-
-class Identifiable(object):
-    """This adapter makes elements uniquely identifiable.
-    """
-    adapts(IElement)
-    implements(IIdentifiable)
-
-    def __init__(self, element):
-        self.element = element
-
-    def getURI(self):
-        element = self.element
-        type_name = IType(element).getTypeName()
-
-        relatable = IRelatable(element, None)
-        if relatable is None:
-            relatable = IRelatable(getParent(element), u'')
-        identifier = str(relatable)
-
-        return 'cpsskins://%s:%s' % (type_name, identifier)
-
 class Node(Element):
     """A Node is an element in a tree structure.
     """
@@ -105,71 +56,3 @@
     def __init__(self):
         super(Leaf, self).__init__()
 
-class NodeTraverser(object):
-    """An adapter for traversing the tree.
-    """
-    adapts(INode)
-    implements(INodeTraverser)
-
-    def __init__(self, node):
-        self.node = node
-
-    def getChildNodes(self, display=None, perspective=None):
-        """Return the list of child nodes implementing the specified interface
-           Override this method if the element is a virtual container.
-        """
-        node = self.node
-        if ILeaf.providedBy(node):
-            return []
-        return node.values()
-
-class ElementNameChooser:
-    """An adapter to choose names for elements.
-    """
-    adapts(IElement)
-    implements(INameChooser)
-
-    __used_for__ = IElement
-
-class Type(object):
-    """Adapter that gets the type of an element.
-    """
-    implements(IType)
-
-    def __init__(self, element):
-        self.element = element
-
-    def getElementType(self):
-        return queryType(self.element, IElementType)
-
-    def getResourceType(self):
-        return queryType(self.element, IResourceType)
-
-    def getContentType(self):
-        return queryType(self.element, IContentType)
-
-    def getElementName(self):
-        return getTypeName(self.getElementType())
-
-    def getResourceName(self):
-        return getTypeName(self.getResourceType())
-
-    def getContentName(self):
-        return getTypeName(self.getContentType())
-
-    def getType(self):
-        return uniq([self.getElementType(), self.getResourceType(),
-                     self.getContentType()])
-
-    def getTypeName(self):
-        return '-'.join(uniq([self.elementname, self.resourcename,
-                              self.contentname]))
-
-    elementname = property(getElementName)
-
-    resourcename = property(getResourceName)
-
-    contentname = property(getContentName)
-
-    name = property(getTypeName)
-

Modified: cpsskins/branches/paris-sprint-2006/elements/format.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/format.py      (original)
+++ cpsskins/branches/paris-sprint-2006/elements/format.py      Mon May  1 
13:23:52 2006
@@ -23,13 +23,13 @@
 from zope.interface import implements
 from zope.security.proxy import removeSecurityProxy
 
-from cpsskins.elements import Element
-from cpsskins.elements.interfaces import IType, IFormat, IFormattable
-from cpsskins.standard.formats.storage import IFormatStorage
+from cpsskins.elements.element import Element
+from cpsskins.elements.interfaces import IFormat, IFormattable
 from cpsskins.ontology import hasFormat, IFormatPredicate
 from cpsskins.relations import DyadicRelation
 from cpsskins.relations.interfaces import IRelationTool
-from cpsskins.setup.interfaces import IResource, ISetting
+from cpsskins.setup.interfaces import IResource, ISetting, IType
+from cpsskins.standard.formats.storage import IFormatStorage
 from cpsskins.utils import getThemeManager
 
 class Format(Element):

Modified: cpsskins/branches/paris-sprint-2006/elements/interfaces.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/interfaces.py  (original)
+++ cpsskins/branches/paris-sprint-2006/elements/interfaces.py  Mon May  1 
13:23:52 2006
@@ -35,40 +35,6 @@
 
     identifier = Attribute("The element's unique identifier.")
 
-class IIdentifiable(Interface):
-
-    def getURI():
-        """Return the element's unique identifier.
-        """
-
-class IType(Interface):
-
-    def getElementType():
-        """ """
-
-    def getResourceType():
-        """ """
-
-    def getContentType():
-        """ """
-
-    def getElementName():
-        """ """
-
-    def getResourceName():
-        """ """
-
-    def getContentName():
-        """ """
-
-    def getType():
-        """Return the element's complete type as a tuple
-        """
-
-    def getTypeName():
-        """Return the element's complete type name
-        """
-
 class INode(IElement):
     """A generic tree node"""
 

Modified: cpsskins/branches/paris-sprint-2006/elements/pageblock.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/pageblock.py   (original)
+++ cpsskins/branches/paris-sprint-2006/elements/pageblock.py   Mon May  1 
13:23:52 2006
@@ -19,7 +19,7 @@
 
 from zope.interface import implements
 
-from cpsskins.elements import InnerNode
+from cpsskins.elements.element import InnerNode
 from cpsskins.elements.interfaces import IPageBlock
 
 class PageBlock(InnerNode):

Modified: cpsskins/branches/paris-sprint-2006/elements/presentation.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/presentation.py        
(original)
+++ cpsskins/branches/paris-sprint-2006/elements/presentation.py        Mon May 
 1 13:23:52 2006
@@ -22,10 +22,11 @@
 from zope.component import getUtility, queryUtility
 
 from cpsskins import configuration
-from cpsskins.elements.interfaces import (
-    IType, IDisplayable, IFormattable, IPresentable)
+from cpsskins.elements.interfaces import IDisplayable, IFormattable
+from cpsskins.elements.interfaces import  IPresentable
 from cpsskins.ontology import hasFormat, hasDisplay, hasDisplayFromPerspective
 from cpsskins.relations.interfaces import IRelationTool
+from cpsskins.setup.interfaces import IType
 from cpsskins.utils import getThemeManager
 from cpsskins.ontology import IFormatPredicate
 

Modified: cpsskins/branches/paris-sprint-2006/elements/slot.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/slot.py        (original)
+++ cpsskins/branches/paris-sprint-2006/elements/slot.py        Mon May  1 
13:23:52 2006
@@ -20,7 +20,7 @@
 from zope.interface import implements
 from zope.component import adapts, getUtility
 
-from cpsskins.elements import InnerNode
+from cpsskins.elements.element import InnerNode
 from cpsskins.elements.interfaces import ISlot, INode, INodeTraverser
 from cpsskins.ontology import hasPortlet, hasPortletFromPerspective
 from cpsskins.relations.interfaces import IRelatable, IRelationTool

Modified: cpsskins/branches/paris-sprint-2006/elements/themepage.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/themepage.py   (original)
+++ cpsskins/branches/paris-sprint-2006/elements/themepage.py   Mon May  1 
13:23:52 2006
@@ -20,7 +20,7 @@
 from zope.interface import implements
 from zope.component import getUtilitiesFor
 
-from cpsskins.elements import InnerNode
+from cpsskins.elements.element import InnerNode
 from cpsskins.elements.interfaces import IThemePage
 from cpsskins.utils import getThemeManager
 

Modified: cpsskins/branches/paris-sprint-2006/ftests/test_appsetup.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ftests/test_appsetup.py (original)
+++ cpsskins/branches/paris-sprint-2006/ftests/test_appsetup.py Mon May  1 
13:23:52 2006
@@ -28,9 +28,9 @@
 from zope.component.interfaces import IFactory
 
 from cpsskins import elements
-from cpsskins.elements.interfaces import IElement, IIdentifiable, IType
-from cpsskins.setup.interfaces import IResourceType
-from cpsskins.setup.interfaces import IDOMAdapter
+from cpsskins.elements.interfaces import IElement
+from cpsskins.setup.interfaces import IResourceType, IDOMAdapter
+from cpsskins.setup.interfaces import IIdentifiable, IType
 from cpsskins.setup.test.dummy import IDummyResource, DummyDOMAdapter
 from cpsskins.setup.test.dummy import DummyFactory, Identifiable, Type
 

Modified: cpsskins/branches/paris-sprint-2006/relations/relations.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/relations/relations.py  (original)
+++ cpsskins/branches/paris-sprint-2006/relations/relations.py  Mon May  1 
13:23:52 2006
@@ -24,8 +24,6 @@
 from zope.interface import implements
 from zope.security.proxy import removeSecurityProxy as trusted
 
-from cpsskins.elements.interfaces import IType
-
 from cpsskins.relations.interfaces import IRelation
 from cpsskins.relations.interfaces import IMonadicRelation, IDyadicRelation
 from cpsskins.relations.interfaces import ITriadicRelation, IRelatable

Modified: cpsskins/branches/paris-sprint-2006/setup/README.txt
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/README.txt        (original)
+++ cpsskins/branches/paris-sprint-2006/setup/README.txt        Mon May  1 
13:23:52 2006
@@ -35,8 +35,7 @@
     >>> from zope.component import getUtility
     >>> from zope.interface import implements, Interface
 
-    >>> from cpsskins.elements.interfaces import IIdentifiable
-    >>> from cpsskins.setup.interfaces import IResourceManager
+    >>> from cpsskins.setup.interfaces import IResourceManager, IIdentifiable
     >>> from cpsskins.setup.settings import ISettings
     >>> from cpsskins.setup.test.dummy import IDummyResource, DummyResource
 
@@ -340,7 +339,7 @@
 
 or more succintly:
 
-    >>> from cpsskins.elements.interfaces import IType
+    >>> from cpsskins.setup.interfaces import IType
     >>> IType(resource).elementname
     u'canvas'
 
@@ -415,7 +414,7 @@
 
 either as a list of interfaces:
 
-    >>> from cpsskins.elements.interfaces import IType
+    >>> from cpsskins.setup.interfaces import IType
 
     >>> pprint(IType(resource).getType())
     [<InterfaceClass cpsskins.elements.interfaces.ICanvas>,
@@ -472,7 +471,6 @@
 
 For instance a portlet will be uniformally identified as:
 
-    >>> from cpsskins.elements.interfaces import IIdentifiable
     >>> resource = Actions()
 
     >>> IIdentifiable(resource).getURI()

Modified: cpsskins/branches/paris-sprint-2006/setup/adapters.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/adapters.py       (original)
+++ cpsskins/branches/paris-sprint-2006/setup/adapters.py       Mon May  1 
13:23:52 2006
@@ -17,12 +17,20 @@
 """
 __docformat__ = "reStructuredText"
 
+from zope.app.content.interfaces import IContentType
+from zope.app.interface import queryType
 from zope.component import adapts
 from zope.interface import implements
 
-from cpsskins.elements.interfaces import IIdentifiable, IType
+from cpsskins.elements.interfaces import IElementType
 from cpsskins.relations.interfaces import IRelatable
-from cpsskins.setup.interfaces import IResource, ISetting
+from cpsskins.setup.interfaces import IResource, ISetting, IIdentifiable, IType
+from cpsskins.setup.interfaces import IResourceType
+from cpsskins.setup.utils import getTypeName
+
+def uniq(seq):
+    set = {}
+    return [set.setdefault(e, e) for e in seq if e not in set and e is not 
None]
 
 class Resource(object):
     """This adapts settings to resources
@@ -63,3 +71,45 @@
         return u'cpsskins://[EMAIL PROTECTED]' % 
(IType(resource).getTypeName(),
                                       context.name)
 
+class Type(object):
+    """Adapter that gets the type of an element.
+    """
+    implements(IType)
+
+    def __init__(self, context):
+        self.context = context
+
+    def getElementType(self):
+        return queryType(self.context, IElementType)
+
+    def getResourceType(self):
+        return queryType(self.context, IResourceType)
+
+    def getContentType(self):
+        return queryType(self.context, IContentType)
+
+    def getElementName(self):
+        return getTypeName(self.getElementType())
+
+    def getResourceName(self):
+        return getTypeName(self.getResourceType())
+
+    def getContentName(self):
+        return getTypeName(self.getContentType())
+
+    def getType(self):
+        return uniq([self.getElementType(), self.getResourceType(),
+                     self.getContentType()])
+
+    def getTypeName(self):
+        return '-'.join(uniq([self.elementname, self.resourcename,
+                              self.contentname]))
+
+    elementname = property(getElementName)
+
+    resourcename = property(getResourceName)
+
+    contentname = property(getContentName)
+
+    name = property(getTypeName)
+

Modified: cpsskins/branches/paris-sprint-2006/setup/configure.zcml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/configure.zcml    (original)
+++ cpsskins/branches/paris-sprint-2006/setup/configure.zcml    Mon May  1 
13:23:52 2006
@@ -11,6 +11,19 @@
       factory="cpsskins.setup.manager.ResourceManager"
   />
 
+  <!-- this adapter makes resources typeable -->
+  <adapter
+      for="*"
+      factory="cpsskins.setup.adapters.Type"
+  />
+
+  <adapter
+      name="type"
+      provides="zope.traversing.interfaces.IPathAdapter"
+      for="*"
+      factory="cpsskins.setup.adapters.Type"
+  />
+
   <!-- this adapter makes settings relatable -->
   <adapter
       factory="cpsskins.setup.adapters.Relatable"

Modified: cpsskins/branches/paris-sprint-2006/setup/interfaces.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/interfaces.py     (original)
+++ cpsskins/branches/paris-sprint-2006/setup/interfaces.py     Mon May  1 
13:23:52 2006
@@ -21,12 +21,50 @@
 from zope.interface.interfaces import IInterface
 from zope.schema import TextLine
 
+##### Typing  #########################################################
+
 class INameType(IInterface):
     """Interface type for associating interfaces to names."""
 
 class IResourceType(IInterface):
     """Resource tyoe"""
 
+class IIdentifiable(Interface):
+
+    def getURI():
+        """Return the element's unique identifier.
+        """
+
+class IType(Interface):
+
+    def getElementType():
+        """ """
+
+    def getResourceType():
+        """ """
+
+    def getContentType():
+        """ """
+
+    def getElementName():
+        """ """
+
+    def getResourceName():
+        """ """
+
+    def getContentName():
+        """ """
+
+    def getType():
+        """Return the element's complete type as a tuple
+        """
+
+    def getTypeName():
+        """Return the element's complete type name
+        """
+
+##### Settings  #######################################################
+
 class ISetting(Interface):
     """Setting"""
 

Modified: cpsskins/branches/paris-sprint-2006/setup/io.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/io.py     (original)
+++ cpsskins/branches/paris-sprint-2006/setup/io.py     Mon May  1 13:23:52 2006
@@ -25,9 +25,8 @@
 from zope.interface import implements, Interface
 from zope.app.container.interfaces import IItemContainer
 
-from cpsskins.elements.interfaces import IIdentifiable, IType
 from cpsskins.relations.interfaces import IRelatable
-from cpsskins.setup.interfaces import IDOMAdapter
+from cpsskins.setup.interfaces import IDOMAdapter, IIdentifiable, IType
 
 logger = logging.getLogger("cpsskins")
 

Modified: cpsskins/branches/paris-sprint-2006/setup/manager.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/manager.py        (original)
+++ cpsskins/branches/paris-sprint-2006/setup/manager.py        Mon May  1 
13:23:52 2006
@@ -24,7 +24,7 @@
 from zope.component import getGlobalSiteManager
 from zope.component import providedBy
 
-from cpsskins.elements.interfaces import IIdentifiable, IType
+from cpsskins.setup.interfaces import IIdentifiable, IType
 from cpsskins.setup.interfaces import IResourceManager, IResource
 from cpsskins.setup.interfaces import ISetting, IGlobalSetting, ILocalSetting
 from cpsskins.setup.setting import GlobalSetting, LocalSetting

Modified: cpsskins/branches/paris-sprint-2006/setup/setting.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/setting.py        (original)
+++ cpsskins/branches/paris-sprint-2006/setup/setting.py        Mon May  1 
13:23:52 2006
@@ -21,7 +21,7 @@
 from zope.app.container.contained import Contained
 from zope.interface import implements
 
-from cpsskins.elements.interfaces import IIdentifiable
+from cpsskins.setup.interfaces import IIdentifiable
 from cpsskins.setup.interfaces import IGlobalSetting, ILocalSetting
 
 class Setting(object):

Modified: cpsskins/branches/paris-sprint-2006/setup/test/dummy.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/test/dummy.py     (original)
+++ cpsskins/branches/paris-sprint-2006/setup/test/dummy.py     Mon May  1 
13:23:52 2006
@@ -23,9 +23,8 @@
 from zope.component.factory import Factory
 from zope.interface import Interface, implements
 
-from cpsskins.elements.interfaces import IIdentifiable, IType
 from cpsskins.setup.io import BaseDOMAdapter
-from cpsskins.setup.interfaces import IDOMAdapter
+from cpsskins.setup.interfaces import IDOMAdapter, IIdentifiable, IType
 
 class IDummyResource(Interface):
     """Dummy resource interface"""

Modified: cpsskins/branches/paris-sprint-2006/setup/utils.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/utils.py  (original)
+++ cpsskins/branches/paris-sprint-2006/setup/utils.py  Mon May  1 13:23:52 2006
@@ -54,7 +54,6 @@
     # TODO: could be cached
     names = []
     name_types = list(getUtilitiesFor(INameType))
-    print name_types
     if not isinstance(type, (list , tuple)):
         type = [type]
     for iface in type:

Modified: cpsskins/branches/paris-sprint-2006/standard/fields/color.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/fields/color.py        
(original)
+++ cpsskins/branches/paris-sprint-2006/standard/fields/color.py        Mon May 
 1 13:23:52 2006
@@ -22,7 +22,7 @@
 from zope.component.factory import Factory
 from zope.interface import implements, Interface
 
-from cpsskins.elements import Element
+from cpsskins.elements.element import Element
 from cpsskins.elements.interfaces import IField
 
 class IColor(IField):

Modified: cpsskins/branches/paris-sprint-2006/standard/filters/style/__init__.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/filters/style/__init__.py      
(original)
+++ cpsskins/branches/paris-sprint-2006/standard/filters/style/__init__.py      
Mon May  1 13:23:52 2006
@@ -24,9 +24,8 @@
 
 from cpsskins.standard.formats.style import IStyle
 from cpsskins.browser.rendering.interfaces import IFilterView
-from cpsskins.elements.interfaces import IIdentifiable
 from cpsskins.relations.interfaces import IRelatable
-from cpsskins.setup.interfaces import IResourceManager
+from cpsskins.setup.interfaces import IResourceManager, IIdentifiable
 
 
 startTag = re.compile('<.*?>')

Modified: cpsskins/branches/paris-sprint-2006/standard/io/relation.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/io/relation.py (original)
+++ cpsskins/branches/paris-sprint-2006/standard/io/relation.py Mon May  1 
13:23:52 2006
@@ -19,8 +19,7 @@
 
 from zope.interface import implements
 
-from cpsskins.elements.interfaces import IIdentifiable
-from cpsskins.setup.interfaces import IDOMAdapter
+from cpsskins.setup.interfaces import IDOMAdapter, IIdentifiable
 from cpsskins.setup.io import BaseDOMAdapter
 
 factories = {

Modified: cpsskins/branches/paris-sprint-2006/standard/io/setting.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/io/setting.py  (original)
+++ cpsskins/branches/paris-sprint-2006/standard/io/setting.py  Mon May  1 
13:23:52 2006
@@ -20,8 +20,8 @@
 from zope.component import getMultiAdapter
 from zope.interface import implements
 
-from cpsskins.elements.interfaces import IIdentifiable, IType
-from cpsskins.setup.interfaces import IResource, IDOMAdapter
+from cpsskins.setup.interfaces import IResource, IDOMAdapter, IIdentifiable
+from cpsskins.setup.interfaces import IType
 from cpsskins.setup.io import BaseDOMAdapter
 from cpsskins.relations.interfaces import IRelatable
 

Modified: cpsskins/branches/paris-sprint-2006/standard/io/style.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/io/style.py    (original)
+++ cpsskins/branches/paris-sprint-2006/standard/io/style.py    Mon May  1 
13:23:52 2006
@@ -19,8 +19,7 @@
 
 from zope.interface import implements
 
-from cpsskins.elements.interfaces import IIdentifiable
-from cpsskins.setup.interfaces import IDOMAdapter
+from cpsskins.setup.interfaces import IDOMAdapter, IIdentifiable
 from cpsskins.setup.io import BaseDOMAdapter
 from cpsskins.relations.interfaces import IRelatable
 

Modified: cpsskins/branches/paris-sprint-2006/tests/setup.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/tests/setup.py  (original)
+++ cpsskins/branches/paris-sprint-2006/tests/setup.py  Mon May  1 13:23:52 2006
@@ -24,30 +24,29 @@
 from zope.lifecycleevent.interfaces import IObjectModifiedEvent
 from zope.app.container.interfaces import IObjectAddedEvent, 
IObjectRemovedEvent
 
-from cpsskins.thememanager import ThemeManagementFolder
-from cpsskins import controllers
-from cpsskins import elements
+from cpsskins import controllers, elements
 from cpsskins.elements.display import Displayable
 from cpsskins.elements.format import Formattable
-from cpsskins.elements.interfaces import IElement, IDisplay, IIdentifiable
-from cpsskins.elements.interfaces import IType
+from cpsskins.elements.adapters import Relatable
+from cpsskins.elements.interfaces import IElement, IDisplay
 from cpsskins.perspectives import perspective
 from cpsskins.perspectives.interfaces import IPerspective
 from cpsskins.relations.interfaces import IRelationTool, IRelationStorage
 from cpsskins.relations.interfaces import IRelatable
 from cpsskins.relations.tool import RelationTool
 from cpsskins.relations.storage import RelationStorage
-from cpsskins.thememanager import IThemeManagementFolder
+from cpsskins.setup.adapters import Type, Identifiable
+from cpsskins.setup.interfaces import IType, IIdentifiable
+from cpsskins.thememanager import IThemeManagementFolder, ThemeManagementFolder
 
 def setUp(test):
     gsm = zapi.getGlobalSiteManager()
     gsm.registerAdapter(Formattable, (IDisplay,), IPathAdapter, 'formattable')
     gsm.registerAdapter(Displayable, (IElement,), IPathAdapter, 'displayable')
     gsm.registerAdapter(RelationTool, (IElement,), IRelationTool)
-    gsm.registerAdapter(elements.element.Identifiable, (IElement,), 
-                        IIdentifiable)
-    gsm.registerAdapter(elements.element.Type, (IElement,), IType)
-    gsm.registerAdapter(elements.element.Relatable, (IElement,), IRelatable)
+    gsm.registerAdapter(Relatable, (IElement,), IRelatable)
+    gsm.registerAdapter(Identifiable, (IElement,), IIdentifiable)
+    gsm.registerAdapter(Type, (IElement,), IType)
     gsm.registerAdapter(perspective.Relatable, (IPerspective,), IRelatable)
 
     gsm.registerAdapter(RelationStorage, (None,), IRelationStorage)

Modified: cpsskins/branches/paris-sprint-2006/ui/editing/views.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/editing/views.py     (original)
+++ cpsskins/branches/paris-sprint-2006/ui/editing/views.py     Mon May  1 
13:23:52 2006
@@ -26,11 +26,12 @@
 from zope.security.proxy import removeSecurityProxy
 
 from cpsskins.browser.negotiation.interfaces import INegotiation
+from cpsskins.elements.interfaces import IDisplay, IFormat
 from cpsskins.elements.interfaces import IDisplayable, IFormattable
-from cpsskins.elements.interfaces import IType, IDisplay, IFormat
 from cpsskins.relations.interfaces import IRelationTool
 from cpsskins.relations.relations import DyadicRelation
 from cpsskins.setup.interfaces import IResourceManager, IResource, ISetting
+from cpsskins.setup.interfaces import IType
 from cpsskins.storage.interfaces import IStorage
 from cpsskins.utils import getThemeManager
 
@@ -110,8 +111,7 @@
 
         changed = form.applyChanges(self.context, self.form_fields, data)
 
-        print changed
-        return ''
+        return u''
 
 
 class EditPanel:

Modified: cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/views.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/views.py 
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/sitemanager/views.py Mon May 
 1 13:23:52 2006
@@ -26,8 +26,8 @@
 from zope.component import createObject
 
 from cpsskins import minjson as json
-from cpsskins.elements.interfaces import IType
 from cpsskins.setup.interfaces import ISetting, IGlobalSetting, IDOMAdapter
+from cpsskins.setup.interfaces import IType
 from cpsskins.setup.interfaces import IResourceType, IResourceManager, 
IResource
 from cpsskins.setup.registration import reloadSetting, refreshSettings
 from cpsskins.setup.settings import ISettings
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to