Author: jmorliaguet
Date: Thu Apr 27 22:40:15 2006
New Revision: 2972

Added:
   cpsskins/branches/paris-sprint-2006/standard/io/portlet.zcml   (contents, 
props changed)
Modified:
   cpsskins/branches/paris-sprint-2006/setup/README.txt
   cpsskins/branches/paris-sprint-2006/setup/utils.py
   cpsskins/branches/paris-sprint-2006/standard/io/configure.zcml
Log:

- added a portlet exporter

- fixed the generic object exporter to make it use the fields of the
  content types schema.



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        Thu Apr 27 
22:40:15 2006
@@ -576,6 +576,21 @@
     to finish
 
 
+Export of portlets
+------------------
+
+    >>> portlet = Actions(title=u'Action portlet', category=u'zmi_views')
+
+    >>> exporter = getMultiAdapter((portlet, request), IDataExporter)
+    >>> print exporter()
+    <?xml version="1.0"?>
+    <portlet uri="canvas-portlet-standard.actions-12345">
+    <title value="Action portlet" />
+    <category value="zmi_views" />
+    </portlet>
+    <BLANKLINE>
+
+
 Refering to resources
 =====================
 

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  Thu Apr 27 22:40:15 2006
@@ -123,7 +123,7 @@
         context = self.context
 
         properties = []
-        schema = IType(context).getResourceType()
+        schema = IType(context).getContentType()
 
         content = []
         for name in getFieldNamesInOrder(schema):
@@ -138,7 +138,7 @@
 %(content)s
 </%(name)s>
         """ % {
-            'name': getTypeName(schema),
+            'name': IType(context).resourcename,
             'uri': IIdentifiable(context).getURI(),
             'content': u'\n'.join(content),
             }

Modified: cpsskins/branches/paris-sprint-2006/standard/io/configure.zcml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/io/configure.zcml      
(original)
+++ cpsskins/branches/paris-sprint-2006/standard/io/configure.zcml      Thu Apr 
27 22:40:15 2006
@@ -19,6 +19,8 @@
 
   <include file="perspective.zcml" />
 
+  <include file="portlet.zcml" />
+
   <include file="relation.zcml" />
 
   <include file="style.zcml" />

Added: cpsskins/branches/paris-sprint-2006/standard/io/portlet.zcml
==============================================================================
--- (empty file)
+++ cpsskins/branches/paris-sprint-2006/standard/io/portlet.zcml        Thu Apr 
27 22:40:15 2006
@@ -0,0 +1,22 @@
+<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.IPortlet"
+      class="cpsskins.setup.utils.ObjectExporter"
+      permission="zope.ManageContent"
+  />
+
+  <!-- XML import -->
+  <browser:view
+      provides="cpsskins.setup.interfaces.IDataImporter"
+      for="cpsskins.portlets.storage.IPortletStorage"
+      class="cpsskins.setup.utils.ObjectImporter"
+      permission="zope.ManageContent"
+      name="portlet"
+  />
+
+</configure>
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to