[Zope-CVS] CVS: Packages/Moztop/idesupport/rdf - container.py:1.5

Paul Everitt paul@zope.com
Thu, 20 Feb 2003 17:17:50 -0500


Update of /cvs-repository/Packages/Moztop/idesupport/rdf
In directory cvs.zope.org:/tmp/cvs-serv7323

Modified Files:
	container.py 
Log Message:
Mostly refactored for new RDF model, but there's a bug in the python.


=== Packages/Moztop/idesupport/rdf/container.py 1.4 => 1.5 ===
--- Packages/Moztop/idesupport/rdf/container.py:1.4	Thu Jan 16 17:26:12 2003
+++ Packages/Moztop/idesupport/rdf/container.py	Thu Feb 20 17:17:49 2003
@@ -40,7 +40,7 @@
     def _getContentTypeOfObject(self, obj):
         # Handle RootFolder special, since it is not in Factory Service
         if obj.__class__ == RootFolder:
-            return 'Folder'
+            return 'folder'
         service = getService(None, 'Factories')
         for name in service._GlobalFactoryService__factories.keys():
             try:
@@ -53,9 +53,9 @@
         adding = Adding(self.context, self.request)
         info = adding.addingInfo()
         res = ""
-        for type in info:
-            res += ('  <rdf:Description ' +
-                    'ID="%(action)s" dc:title="%(title)s"/>\n' %type)
+##        for type in info:
+##            res += ('  <rdf:Description ' +
+##                    'ID="%(action)s" dc:title="%(title)s"/>\n' %type)
         return res
 
     def _make_subtree(self, id, base, prefix=''):
@@ -70,7 +70,7 @@
             subs = []
             for item in items:
                 subs.append(
-                    '      <rdf:li resource="urn:explorer:data%s:%s"/>' %(
+                    '      <rdf:li resource="urn:moztop:sites:localhost:content%s:%s"/>' %(
                     fillIn['rdf_url'], item[0]))
             if subs:
                 fillIn['sub_nodes'] = "\n" + _sub_nodes %'\n'.join(subs)
@@ -97,6 +97,7 @@
 
 <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
          xmlns:nc="http://home.netscape.com/NC-rdf#"
+         xmlns:site="http://www.zope.org/rdf#"
          xmlns:dc="http://www.purl.org/dc/1.1#">
 '''
 
@@ -106,10 +107,9 @@
 '''
 
 _node = '''
-<rdf:Description rdf:about="urn:explorer:data%(rdf_url)s">%(sub_nodes)s
+<rdf:Description rdf:about="urn:moztop:sites:localhost:content%(rdf_url)s">%(sub_nodes)s
   <dc:title>%(title)s</dc:title>
-  <nc:objecttype>%(type)s</nc:objecttype>
-  <nc:resourcetype resource="#%(type)s"/>
+  <site:resourcetype resource="urn:moztop:resourcetypes:%(type)s"/>
 </rdf:Description>
 '''