Author: jmorliaguet
Date: Tue Apr  4 13:57:53 2006
New Revision: 2779

Added:
   cpsskins/branches/jmo-perspectives/standard/io/element.py   (contents, props 
changed)
   cpsskins/branches/jmo-perspectives/standard/io/element.xml   (contents, 
props changed)
   cpsskins/branches/jmo-perspectives/standard/io/element.zcml   (contents, 
props changed)
Modified:
   cpsskins/branches/jmo-perspectives/doc/portlet-rendering.txt
   cpsskins/branches/jmo-perspectives/ftests/test_io.py
   cpsskins/branches/jmo-perspectives/standard/displays/boxgroup.py
   cpsskins/branches/jmo-perspectives/standard/ds/image.py
   cpsskins/branches/jmo-perspectives/standard/ds/item.py
   cpsskins/branches/jmo-perspectives/standard/ds/items.py
   cpsskins/branches/jmo-perspectives/standard/ds/metadata.py
   cpsskins/branches/jmo-perspectives/standard/io/README.txt
Log:

- test fix 

- added missing files



Modified: cpsskins/branches/jmo-perspectives/doc/portlet-rendering.txt
==============================================================================
--- cpsskins/branches/jmo-perspectives/doc/portlet-rendering.txt        
(original)
+++ cpsskins/branches/jmo-perspectives/doc/portlet-rendering.txt        Tue Apr 
 4 13:57:53 2006
@@ -13,7 +13,8 @@
 
 The dummy portlet is an example implementation of a portlet.
 
-    >>> from cpsskins.portlets.dummy.portlet import Dummy as DummyPortlet
+    >>> from cpsskins.standard.portlets.dummy.portlet import Dummy \
+    ...                                               as DummyPortlet
     >>> portlet = DummyPortlet(title=u'Example portlet',
     ...                        text=u'Dummy text.')
 
@@ -63,7 +64,7 @@
 
     >>> from zope.interface.verify import verifyClass
     >>> from cpsskins.standard.displays.box import Box
-    >>> from cpsskins.standard.displays.interfaces import IDisplay
+    >>> from cpsskins.elements.interfaces import IDisplay
     >>> verifyClass(IDisplay, Box)
     True
 

Modified: cpsskins/branches/jmo-perspectives/ftests/test_io.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ftests/test_io.py        (original)
+++ cpsskins/branches/jmo-perspectives/ftests/test_io.py        Tue Apr  4 
13:57:53 2006
@@ -32,7 +32,7 @@
 
 def test_suite():
     return unittest.TestSuite((
-        FunctionalDocFileSuite('../io/README.txt', setUp=setUp),
+        FunctionalDocFileSuite('../standard/io/README.txt', setUp=setUp),
         ))
 
 if __name__ == '__main__':

Modified: cpsskins/branches/jmo-perspectives/standard/displays/boxgroup.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/displays/boxgroup.py    
(original)
+++ cpsskins/branches/jmo-perspectives/standard/displays/boxgroup.py    Tue Apr 
 4 13:57:53 2006
@@ -48,7 +48,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')
 
     >>> from cpsskins.elements.portlet import TestPortlet as Portlet

Modified: cpsskins/branches/jmo-perspectives/standard/ds/image.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/ds/image.py     (original)
+++ cpsskins/branches/jmo-perspectives/standard/ds/image.py     Tue Apr  4 
13:57:53 2006
@@ -20,8 +20,11 @@
 from pprint import pprint
 
 from zope.interface import implements, Interface
+from zope.i18nmessageid import MessageFactory
 from zope.schema import TextLine
 
+_ = MessageFactory("cpsskins")
+
 class IImage(Interface):
     """An image.
     """

Modified: cpsskins/branches/jmo-perspectives/standard/ds/item.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/ds/item.py      (original)
+++ cpsskins/branches/jmo-perspectives/standard/ds/item.py      Tue Apr  4 
13:57:53 2006
@@ -20,8 +20,11 @@
 from pprint import pprint
 
 from zope.interface import implements, Interface
+from zope.i18nmessageid import MessageFactory
 from zope.schema import TextLine, Bool
 
+_ = MessageFactory("cpsskins")
+
 class IItem(Interface):
     """Item.
     """

Modified: cpsskins/branches/jmo-perspectives/standard/ds/items.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/ds/items.py     (original)
+++ cpsskins/branches/jmo-perspectives/standard/ds/items.py     Tue Apr  4 
13:57:53 2006
@@ -20,8 +20,11 @@
 from pprint import pprint
 
 from zope.interface import implements, Interface
+from zope.i18nmessageid import MessageFactory
 from zope.configuration.fields import Tokens
 
+_ = MessageFactory("cpsskins")
+
 class IItems(Interface):
     """Menu items.
     """
@@ -37,6 +40,7 @@
 class Items(object):
     """A list of menu items
 
+    >>> from cpsskins.standard.ds.item import Item
     >>> item = Item(title=u'item')
     >>> items = Items([item])
     >>> [i for i in items]

Modified: cpsskins/branches/jmo-perspectives/standard/ds/metadata.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/ds/metadata.py  (original)
+++ cpsskins/branches/jmo-perspectives/standard/ds/metadata.py  Tue Apr  4 
13:57:53 2006
@@ -20,8 +20,11 @@
 from pprint import pprint
 
 from zope.interface import implements, Interface
+from zope.i18nmessageid import MessageFactory
 from zope.schema import TextLine
 
+_ = MessageFactory("cpsskins")
+
 class IMetaData(Interface):
     """Meta-data
     """

Modified: cpsskins/branches/jmo-perspectives/standard/io/README.txt
==============================================================================
--- cpsskins/branches/jmo-perspectives/standard/io/README.txt   (original)
+++ cpsskins/branches/jmo-perspectives/standard/io/README.txt   Tue Apr  4 
13:57:53 2006
@@ -106,7 +106,7 @@
 IContentType.
 
     >>> from zope.app.content.interfaces import IContentType
-    >>> from cpsskins.portlets.actions.portlet import Actions
+    >>> from cpsskins.standard.portlets.actions.portlet import Actions
 
     >>> resource = Actions()
     >>> content_type = queryType(resource, IContentType)

Added: cpsskins/branches/jmo-perspectives/standard/io/element.py
==============================================================================
--- (empty file)
+++ cpsskins/branches/jmo-perspectives/standard/io/element.py   Tue Apr  4 
13:57:53 2006
@@ -0,0 +1,70 @@
+############################################################################
+#
+# 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 xml.dom.minidom import parseString
+
+from zope.app import pagetemplate
+from zope.component import adapts
+from zope.interface import implements
+
+from cpsskins.elements.interfaces import IElement, IIdentifiable
+from cpsskins.setup.interfaces import IDataExporter, IDataImporter
+
+class Exporter(object):
+    """Export an element.
+    """
+    implements(IDataExporter)
+
+    template = pagetemplate.ViewPageTemplateFile('element.xml')
+
+    def __init__(self, context, request):
+        self.context = context
+        self.request = request
+
+    def __call__(self):
+        return self.to_xml(self.context)
+
+    def to_xml(self, node, xml=u''):
+        for child in list(node):
+            xml += self.to_xml(node[child], xml=xml)
+        return self.template(info=self.getInfo(node))
+
+    def getInfo(self, node):
+        return {
+            'title': node.title,
+            'uri': IIdentifiable(node).getURI(),
+        }
+
+    def getChildNodes(self):
+        return list(self.context)
+
+class Importer(object):
+    """Import an element.
+    """
+    adapts(IElement)
+    implements(IDataImporter)
+
+    def __init__(self, context):
+        self.context = context
+
+    def load(self, xml=u''):
+        context = self.context
+        dom = parseString(xml)
+        print dom
+

Added: cpsskins/branches/jmo-perspectives/standard/io/element.xml
==============================================================================
--- (empty file)
+++ cpsskins/branches/jmo-perspectives/standard/io/element.xml  Tue Apr  4 
13:57:53 2006
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<element xmlns:tal="http://xml.zope.org/namespaces/tal";
+         tal:define="info options/info"
+         tal:attributes="uri info/uri; title context/title"
+/>

Added: cpsskins/branches/jmo-perspectives/standard/io/element.zcml
==============================================================================
--- (empty file)
+++ cpsskins/branches/jmo-perspectives/standard/io/element.zcml Tue Apr  4 
13:57:53 2006
@@ -0,0 +1,18 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope";
+    xmlns:browser="http://namespaces.zope.org/browser";>
+
+  <!-- XML export -->
+  <browser:view
+      provides="cpsskins.setup.interfaces.IDataExporter"
+      for="cpsskins.elements.interfaces.IElement"
+      class=".element.Exporter"
+      permission="zope.ManageContent"
+  />
+
+  <!-- XML import -->
+  <adapter
+      factory=".element.Importer"
+  />
+
+</configure>
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to