--- ECHO_content/ECHO_collection.py 2004/07/18 14:14:42 1.142
+++ ECHO_content/ECHO_collection.py 2004/07/18 16:13:57 1.145
@@ -51,25 +51,31 @@ def getRDFDescription(self,linkURL,urn=N
ret=""
about=""""""
name="""%s"""
- #link="""%s"""
- link=""""""
+ link="""%s"""
+ #link=""""""
type="""%s"""
-
+ #xlink=""""""
if not urn:
urn="urn:"+re.sub('/',':',self.absolute_url())
about2=about%urn
+
if hasattr(self,'label') and not (self.label==""):
- name2=name%urllib.quote(self.label)
+ name2=name%self.label
elif not self.title=="":
- name2=name%urllib.quote(self.title)
+ name2=name%self.title
else:
name2=name%self.getId()
-
- link2=link%urllib.quote(linkURL)
+
+ name2=re.sub('&','&',name2)
+
+ linkURL=re.sub('http:','',linkURL)
+ linkURL2=re.sub('&','&',linkURL)
+ link2=link%(("http:"+linkURL2),("http:"+urllib.quote(linkURL)))
+
type2=type%self.meta_type
- ret=about2+"\n"+name2+"\n"+link2+"\n"+type2+"\n"
+ ret=about2+"\n"+name2+"\n"+link2+"\n"+type2+"\n"+"\n"
return ret
def getCopyrightsFromForm(self,argv):
@@ -515,9 +521,9 @@ class ECHO_resource(Folder,Persistent):
getSubCols = ECHO_helpers.getSubCols
security.declareProtected('View','index_html')
- def getRDF(self):
+ def getRDF(self,urn=None):
"""rdf"""
- return getRDFDescription(self,self.link)
+ return getRDFDescription(self,self.link,urn=urn)
def getAccessRightSelectorHTML(self,outlook="select"):
@@ -1509,22 +1515,21 @@ class ECHO_collection(Folder, Persistent
def showRDF(self):
"""showrdf"""
self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml')
- ret="""\n\n"""
+ ret="""\n\n"""
ret+=self.getRDF(urn="echo:collectionroot")+"\n"
ret+=""""""
return ret
def getRDF(self,urn=None):
"""rdf of the collection"""
+
contents=self.ZopeFind(self,obj_metatypes=['ECHO_group','ECHO_resource','ECHO_collection'])
- ret=getRDFDescription(self,self.absolute_url(),urn)
+ ret=getRDFDescription(self,self.absolute_url(),urn=urn)
if not urn:
urn="urn:"+re.sub('/',':',self.absolute_url())
- else:
- urn="urn:"+urn
-
+
li="""\n"""
@@ -2241,11 +2246,11 @@ class ECHO_group(ECHO_collection):
security.declareProtected('View','index_html')
- def getRDF(self):
+ def getRDF(self,urn=None):
"""rdf of the collection"""
contents=self.ZopeFind(self,obj_metatypes=['ECHO_group','ECHO_resource','ECHO_collection'])
- ret=getRDFDescription(self,self.absolute_url())
+ ret=getRDFDescription(self,self.absolute_url(),urn)
@@ -2481,26 +2486,19 @@ class ECHO_root(Folder,Persistent,Implic
def showRDF(self):
"""showrdf"""
self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml')
- ret="""\n"""
- ret+=self.getRDF()+"\n"
+ ret="""\n\n"""
+ ret+=self.getRDF(urn="echo:collectionroot")+"\n"
+
ret+=""""""
return ret
- def getRDF(self):
+ def getRDF(self,urn=None):
"""rdf of the collection"""
- contents=self.ZopeFind(self,obj_metatypes=['ECHO_group','ECHO_resource','ECHO_collection'])
- about=""""""
- name="""%s"""
-
- urn="urn:"+re.sub('/',':',self.absolute_url())
+ contents=self.ZopeFind(self,obj_metatypes=['ECHO_group','ECHO_resource','ECHO_collection'])
- about2=about%urn
- name2=name%self.getId()
+ ret=getRDFDescription(self,self.absolute_url(),urn=urn)
-
- ret=about2+"\n"+name2+"\n"+""
-
li="""\n"""