Author: jmorliaguet
Date: Mon Oct 24 23:38:54 2005
New Revision: 28587

Modified:
   z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/browser/elements/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/browser/elements/slot.py
   z3lab/cpsskins/branches/jmo-perspectives/browser/manager/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/elements/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/elements/interfaces.py
   z3lab/cpsskins/branches/jmo-perspectives/elements/portlet.py
   z3lab/cpsskins/branches/jmo-perspectives/storage/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/thememanager.py
Log:

- moved element.name() out of the way. we call zapi.name(...) instead



Modified: z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/__init__.py      
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/__init__.py      
Mon Oct 24 23:38:54 2005
@@ -208,7 +208,7 @@
         request = self.request
         element = self._getElementById(id)
         container = getParent(element)
-        request.form['ids'] = [element.name()]
+        request.form['ids'] = [zapi.name(element)]
         view = Contents(container, request)
         view.copyObjects()
 

Modified: z3lab/cpsskins/branches/jmo-perspectives/browser/elements/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/elements/__init__.py       
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/elements/__init__.py       
Mon Oct 24 23:38:54 2005
@@ -17,11 +17,11 @@
 """
 __docformat__ = "reStructuredText"
 
+from zope.app import zapi
 from zope.app.publisher.browser import BrowserView
 from zope.app.container.browser.adding import Adding
 from zope.app.copypastemove.interfaces import IObjectCopier, IObjectMover
 from zope.app.traversing.api import getParent
-from zope.app.zapi import getMultiAdapter
 from zope.interface import implements
 
 from interfaces import INodeAdding, INodeRemoving, INodeOrdering, INodeMoving
@@ -52,7 +52,7 @@
 
     def remove(self, content):
         container = self.context
-        del container[content.name()]
+        del container[zapi.name(content)]
 
 class NodeOrdering(BrowserView):
     """A view for reordering elements in nodes
@@ -62,7 +62,7 @@
     def reorder(self, node, order):
         container = self.context
         contents = list(container.keys())
-        item = node.name()
+        item = zapi.name(node)
         contents.remove(item)
         contents.insert(order, item)
         container.updateOrder(contents)
@@ -77,13 +77,13 @@
         container = self.context
         # save the element's order
         order = list(container.keys())
-        content_order = order.index(content.name())
+        content_order = order.index(zapi.name(content))
         # duplicate the element
         copier = IObjectCopier(content)
         copied_name = copier.copyTo(container)
         copied = container[copied_name]
         # move the copied element just below the original element
-        reordering = getMultiAdapter((container, request), INodeOrdering)
+        reordering = zapi.getMultiAdapter((container, request), INodeOrdering)
         reordering.reorder(copied, int(content_order)+1)
         return copied.identifier
 

Modified: z3lab/cpsskins/branches/jmo-perspectives/browser/elements/slot.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/elements/slot.py   
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/elements/slot.py   Mon Oct 
24 23:38:54 2005
@@ -17,10 +17,10 @@
 """
 __docformat__ = "reStructuredText"
 
+from zope.app import zapi
 from zope.app.container.browser.adding import Adding
 from zope.app.publisher.browser import BrowserView
 from zope.app.traversing.api import getParent
-from zope.app.zapi import getMultiAdapter
 from zope.interface import implements
 
 from cpsskins.browser.negociation.interfaces import INegociation
@@ -48,7 +48,7 @@
         if not IPortlet.providedBy(content):
             raise TypeError("Only portlet can be added into slots")
 
-        perspective = getMultiAdapter(
+        perspective = zapi.getMultiAdapter(
             objects=(container, request),
             interface=INegociation,
             ).getPerspective()
@@ -179,7 +179,7 @@
                 )
 
         reltool.remove(ids)
-        del portlets[content.name()]
+        del portlets[zapi.name(content)]
 
         # store the portlet's order in the slot's "BoxGroup" display
         display = IDisplayable(container).getEffectiveDisplay(perspective)

Modified: z3lab/cpsskins/branches/jmo-perspectives/browser/manager/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/manager/__init__.py        
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/manager/__init__.py        
Mon Oct 24 23:38:54 2005
@@ -51,7 +51,7 @@
         for theme in self.getThemes():
             path = zapi.getPath(theme)
             info.append({
-                'id': theme.name(),
+                'id': zapi.name(theme),
                 'title': theme.title,
                 'url': urllib.quote(path),
                 })

Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/__init__.py       
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/__init__.py       Mon Oct 
24 23:38:54 2005
@@ -43,9 +43,6 @@
         id = getattr(self, 'identifier', '')
         return str(id)
 
-    def name(self):
-        return zapi.name(self)
-
     def getElementType(self):
         return queryType(self, IElementType)
 

Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/interfaces.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/interfaces.py     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/interfaces.py     Mon Oct 
24 23:38:54 2005
@@ -40,9 +40,6 @@
     def __str__():
         """The string representation is used as an identifier in a relation."""
 
-    def name():
-        """ """
-
     # this will go away
 
     def getContentType():

Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/portlet.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/portlet.py        
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/portlet.py        Mon Oct 
24 23:38:54 2005
@@ -17,6 +17,7 @@
 """
 __docformat__ = "reStructuredText"
 
+from zope.app import zapi
 from zope.app.copypastemove import ObjectMover
 from zope.app.copypastemove.interfaces import IObjectMover
 from zope.app.traversing.api import getParent
@@ -106,7 +107,7 @@
             dest_display = 
IDisplayable(target).getEffectiveDisplay(perspective)
             dest_display.append(portlet)
 
-            return portlet.name()
+            return zapi.name(portlet)
         else:
             # Use copypastemove's object mover explicitly
             mover = ObjectMover(portlet)

Modified: z3lab/cpsskins/branches/jmo-perspectives/storage/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/storage/__init__.py        
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/storage/__init__.py        Mon Oct 
24 23:38:54 2005
@@ -17,6 +17,7 @@
 """
 __docformat__ = "reStructuredText"
 
+from zope.app import zapi
 from zope.app.container.btree import BTreeContainer
 from zope.app.container.contained import Contained
 from zope.app.container.contained import ObjectAddedEvent, ObjectRemovedEvent
@@ -50,7 +51,7 @@
             objects = [objects]
         for obj in objects:
             if IElement.providedBy(obj):
-                obj = obj.name()
+                obj = zapi.name(obj)
             if obj not in self:
                 raise KeyError("%s not in the storage." % obj)
             del self[obj]
@@ -60,8 +61,8 @@
 
         Return the object of the duplication.
         """
-        name = object.name()
-        if object.name() not in self:
+        name = zapi.name(object)
+        if name not in self:
             raise KeyError("%s not in the storage." % object)
 
         chooser = INameChooser(self)

Modified: z3lab/cpsskins/branches/jmo-perspectives/thememanager.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/thememanager.py    (original)
+++ z3lab/cpsskins/branches/jmo-perspectives/thememanager.py    Mon Oct 24 
23:38:54 2005
@@ -17,6 +17,7 @@
 """
 __docformat__ = "reStructuredText"
 
+from zope.app import zapi
 from zope.app.container.btree import BTreeContainer
 from zope.app.intid import IntIds
 from zope.app.traversing.api import getParent
@@ -179,7 +180,7 @@
         for rel in display_relations:
             display = reltool.get(rel).second
             container = getParent(display)
-            del container[display.name()]
+            del container[zapi.name(display)]
 
         # Remove the relation
         reltool.remove(display_relations)
@@ -190,7 +191,7 @@
         # Physically remove the formats
         for format in IFormattable(object).getFormats():
             container = getParent(format)
-            del container[format.name()]
+            del container[zapi.name(format)]
 
         # Remove the relation
         reltool = RelationTool(object)
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to