Author: jmorliaguet
Date: Mon May 15 20:39:25 2006
New Revision: 3137

Modified:
   cpsskins/branches/paris-sprint-2006/setup/interfaces.py
   cpsskins/branches/paris-sprint-2006/setup/io/utils.py
   cpsskins/branches/paris-sprint-2006/setup/manager.py
   cpsskins/branches/paris-sprint-2006/standard/io/setting.py

Log:

- fixed the import of settings.



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 15 
20:39:25 2006
@@ -117,7 +117,7 @@
     """
 
     def register(name, resource, context):
-        """Register a resource."""
+        """Register a resource. Return the setting."""
 
     def unregister(uri, context):
         """Unregister a resource."""

Modified: cpsskins/branches/paris-sprint-2006/setup/io/utils.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/io/utils.py       (original)
+++ cpsskins/branches/paris-sprint-2006/setup/io/utils.py       Mon May 15 
20:39:25 2006
@@ -261,10 +261,10 @@
 
         factory_name = u'cpsskins.%s' % typename.replace('-', '.')
         resource = createObject(factory_name)
-        resources.register(name=name, title=title, resource=resource,
-                           context=context, custom=custom)
+        setting = resources.register(name=name, title=title, resource=resource,
+                                     context=context, custom=custom)
 
-        importer = getMultiAdapter((resource, el), IDOMAdapter)
+        importer = getMultiAdapter((setting, el), IDOMAdapter)
         importer.archive = archive
         importer.document = document
         importer.object_type = typename

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 15 
20:39:25 2006
@@ -63,6 +63,7 @@
             uri = IIdentifiable(setting).getURI()
             settings[uri] = setting
             settings.registerUtility(setting, ISetting, uri)
+        return setting
 
     def unregister(self, uri=u'', context=None):
         """Unregister the setting.

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 15 
20:39:25 2006
@@ -29,6 +29,13 @@
     """
     implements(IDOMAdapter)
 
+    def updateURIMapping(self):
+        context = self.context
+        resource = IResource(context).getResource()
+        uri = u'cpsskins://[EMAIL PROTECTED]' % (IType(resource).name,
+                                     self.node.getAttribute(u'name'))
+        self.mapping.update({uri: context})
+
     def save(self):
         context = self.context
         node = self.node
@@ -50,6 +57,11 @@
         exporter.save()
 
     def load(self):
-        # nothing to do
-        pass
+        context = self.context
+        node = self.node
+
+        resource = IResource(context).getResource()
+        importer = getMultiAdapter((resource, node), IDOMAdapter)
+        importer.load()
+
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to