Author: jmorliaguet
Date: Mon May  1 16:56:19 2006
New Revision: 3007

Modified:
   cpsskins/branches/paris-sprint-2006/setup/README.txt
   cpsskins/branches/paris-sprint-2006/standard/io/relation.py
Log:

- fixed the export of relations



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 
16:56:19 2006
@@ -545,6 +545,11 @@
     ...                            first=Actions(u'Actions portlet'))
 
     >>> print toXML(relation, u'relations')
+    <?xml version="1.0" encoding="utf-8"?>
+    <relations>
+      <monad first="cpsskins://canvas-portlet-standard.actions:12345" 
predicate="_ A"/>
+    </relations>
+    <BLANKLINE>
 
 
 Dyadic relations:
@@ -557,6 +562,11 @@
     ...                           second=Breadcrumbs(u'Breadcrumbs portlet'))
 
     >>> print toXML(relation, u'relations')
+    <?xml version="1.0" encoding="utf-8"?>
+    <relations>
+      <dyad first="cpsskins://canvas-portlet-standard.actions:12345" 
predicate="_ B _" 
second="cpsskins://canvas-portlet-standard.breadcrumbs:12345"/>
+    </relations>
+    <BLANKLINE>
 
 
 Triadic relations:
@@ -570,6 +580,11 @@
     ...                            third=Slot(slot=u'slotA'))
 
     >>> print toXML(relation, u'relations')
+    <?xml version="1.0" encoding="utf-8"?>
+    <relations>
+      <triad first="cpsskins://canvas-portlet-standard.actions:12345" 
predicate="_ C _ D _" 
second="cpsskins://canvas-portlet-standard.breadcrumbs:12345" 
third="cpsskins://canvas-slot:slotA"/>
+    </relations>
+    <BLANKLINE>
 
 
 

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 
16:56:19 2006
@@ -19,15 +19,9 @@
 
 from zope.interface import implements
 
-from cpsskins.setup.interfaces import IDOMAdapter, IIdentifiable
+from cpsskins.setup.interfaces import IDOMAdapter, IIdentifiable, IType
 from cpsskins.setup.io import BaseDOMAdapter
 
-factories = {
-    1: u'monad',
-    2: u'dyad',
-    3: u'triad',
-}
-
 relates = {
     1: u'first',
     2: u'second',
@@ -45,8 +39,7 @@
 
         document = self.getDocument()
 
-        arity = len(context)
-        relation_el = document.createElement(u'relation')
+        relation_el = document.createElement(IType(context).contentname)
         relation_el.setAttribute(u'predicate', str(context))
 
         i = 1
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to