Author: jmorliaguet
Date: Sat Apr 29 12:14:52 2006
New Revision: 2983

Modified:
   cpsskins/branches/paris-sprint-2006/elements/element.py
   cpsskins/branches/paris-sprint-2006/setup/README.txt
   cpsskins/branches/paris-sprint-2006/setup/manager.py
Log:

- more uniform URI syntax for describing resources:

  - cpsskins://typename:identifier for instances of resources
    (the identifier may change between exports and imports.)

  - cpsskins://[EMAIL PROTECTED] for resources registered as settings
    (the setting's name is used to look up a zope3 utility)



Modified: cpsskins/branches/paris-sprint-2006/elements/element.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/element.py     (original)
+++ cpsskins/branches/paris-sprint-2006/elements/element.py     Sat Apr 29 
12:14:52 2006
@@ -99,7 +99,7 @@
             relatable = IRelatable(getParent(element), u'')
         identifier = str(relatable)
 
-        return '%s-%s' % (type_name, identifier)
+        return 'cpsskins://%s:%s' % (type_name, identifier)
 
 class Node(Element):
     """A Node is an element in a tree structure.

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        Sat Apr 29 
12:14:52 2006
@@ -477,14 +477,14 @@
     >>> resource = Actions()
 
     >>> IIdentifiable(resource).getURI()
-    u'canvas-portlet-standard.actions-12345'
+    u'cpsskins://canvas-portlet-standard.actions:12345'
 
 If the resource type is the same as the content type, the name is written only
 once:
 
     >>> resource = Style()
     >>> IIdentifiable(resource).getURI()
-    u'format-style-12345'
+    u'cpsskins://format-style:12345'
 
 
 Export of resources
@@ -507,7 +507,7 @@
 
     >>> print exporter()
     <?xml version="1.0"?>
-    <style uri="format-style-12345">
+    <style uri="cpsskins://format-style:12345">
       <selector name="div.body">
         <property name="color" value="red"/>
         <property name="border" value="none"/>
@@ -530,7 +530,7 @@
     >>> print exporter()
     <?xml version="1.0"?>
     <relation predicate="_ A">
-      <relate uri="canvas-portlet-standard.actions-12345"/>
+      <relate uri="cpsskins://canvas-portlet-standard.actions:12345"/>
     </relation>
     <BLANKLINE>
 
@@ -547,8 +547,8 @@
     >>> print exporter()
     <?xml version="1.0"?>
     <relation predicate="_ B _">
-      <relate uri="canvas-portlet-standard.actions-12345"/>
-      <relate uri="canvas-portlet-standard.breadcrumbs-12345"/>
+      <relate uri="cpsskins://canvas-portlet-standard.actions:12345"/>
+      <relate uri="cpsskins://canvas-portlet-standard.breadcrumbs:12345"/>
     </relation>
     <BLANKLINE>
 
@@ -566,10 +566,10 @@
     >>> print exporter()
     <?xml version="1.0"?>
     <relation predicate="_ C _ D _">
-      <relate uri="canvas-portlet-standard.actions-12345"/>
+      <relate uri="cpsskins://canvas-portlet-standard.actions:12345"/>
       <relate
-          uri="canvas-portlet-standard.breadcrumbs-12345"/>
-      <relate uri="canvas-slot-slotA"/>
+          uri="cpsskins://canvas-portlet-standard.breadcrumbs:12345"/>
+      <relate uri="cpsskins://canvas-slot:slotA"/>
     </relation>
     <BLANKLINE>
 
@@ -597,19 +597,19 @@
     >>> print exporter()
     <?xml version="1.0"?>
     <element
-      uri="canvas-pageblock-12345"
+      uri="cpsskins://canvas-pageblock:12345"
       title="Some page block"
       parent=""/>
     <BLANKLINE>
     <element
-      uri="canvas-cell-12345"
+      uri="cpsskins://canvas-cell:12345"
       title="Some cell 1"
-      parent="canvas-pageblock-12345"/>
+      parent="cpsskins://canvas-pageblock:12345"/>
     <BLANKLINE>
     <element
-      uri="canvas-cell-12345"
+      uri="cpsskins://canvas-cell:12345"
       title="Some cell 2"
-      parent="canvas-pageblock-12345"/>
+      parent="cpsskins://canvas-pageblock:12345"/>
     <BLANKLINE>
 
 
@@ -633,7 +633,7 @@
     >>> exporter = getMultiAdapter((portlet, request), IDataExporter)
     >>> print exporter()
     <?xml version="1.0"?>
-    <portlet uri="canvas-portlet-standard.actions-12345">
+    <portlet uri="cpsskins://canvas-portlet-standard.actions:12345">
       <title value="Action portlet"/>
       <category value="zmi_views"/>
     </portlet>
@@ -649,7 +649,7 @@
     >>> exporter = getMultiAdapter((effect, request), IDataExporter)
     >>> print exporter()
     <?xml version="1.0"?>
-    <effect uri="format-effect-12345">
+    <effect uri="cpsskins://format-effect:12345">
       <types value=""/>
       <format value="PNG"/>
       <width value="100"/>
@@ -677,7 +677,7 @@
     >>> ITypeable(color).getTypeName()
     u'field-color'
 
-    >>> res = resources.find(u'cpsskins://field-color:red', context=root)
+    >>> res = resources.find(u'cpsskins://[EMAIL PROTECTED]', context=root)
 
     >>> res is color
     True
@@ -690,7 +690,7 @@
 
     >>> style = Style()
     >>> root[u'style'] = style
-    >>> style[u'div.body'] = {'color': u'cpsskins://field-color:red'}
+    >>> style[u'div.body'] = {'color': u'cpsskins://[EMAIL PROTECTED]'}
 
     >>> from cpsskins.standard.filters.style import ICSSRenderer
     >>> ICSSRenderer(style)()

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        Sat Apr 29 
12:14:52 2006
@@ -132,7 +132,7 @@
         if len(parts) != 2:
             return None
         name = parts[1]
-        type_name, resource_id = name.split(':')
+        type_name, resource_id = name.split('@')
         type = getContentType(type_name)
         return self.lookup(name=resource_id, type=type, context=context)
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to