--- ECHO_content/ECHO_collection.py 2004/07/16 17:55:43 1.140 +++ ECHO_content/ECHO_collection.py 2004/07/17 10:19:06 1.141 @@ -29,7 +29,7 @@ from Products.PageTemplates.ZopePageTemp from Globals import Persistent, package_home from Acquisition import Implicit from ECHO_helpers import displayTypes - +import urllib try: from psycopg import libpq @@ -497,9 +497,9 @@ class ECHO_resource(Folder,Persistent): about2=about%urn name2=name%self.getId() - link2=link%self.link + link2=link%urllib.quote(self.link) - ret=about2+"\n"+name2+"\n"+link2+"\n"+"" + ret=about2+"\n"+name2+"\n"+link2+"\n"+"" return ret @@ -1490,36 +1490,41 @@ class ECHO_collection(Folder, Persistent path="/mpiwg/online/permanent/shipbuilding" def showRDF(self): + """showrdf""" + self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml') ret="""\n""" ret+=self.getRDF()+"\n" ret+="""""" - + return ret + def getRDF(self): """rdf of the collection""" contents=self.ZopeFind(self,obj_metatypes=['ECHO_group','ECHO_resource','ECHO_collection']) about="""""" name="""%s""" - + link="""%s""" urn="urn:"+re.sub('/',':',self.absolute_url()) about2=about%urn name2=name%self.getId() - + link2=link%urllib.quote(self.absolute_url()) + + ret=about2+"\n"+name2+"\n"+link2+"\n"+"" + + - ret=about2+"\n"+name2+"\n"+"" - urn="urn:"+re.sub('/',':',self.absolute_url()) li="""\n""" for content in contents: ret+=content[1].getRDF()+"\n" - ret+="""\n"""%urn + ret+="""\n"""%urn for content in contents: nurn="urn:"+re.sub('/',':',content[1].absolute_url()) ret+=li%nurn - return ret+"" + return ret+"" def changeLabels(self): @@ -2228,19 +2233,35 @@ class ECHO_group(ECHO_collection): def getRDF(self): """rdf of the collection""" contents=self.ZopeFind(self,obj_metatypes=['ECHO_group','ECHO_resource','ECHO_collection']) + about="""""" + name="""%s""" + + + link="""%s""" + urn="urn:"+re.sub('/',':',self.absolute_url()) + + about2=about%urn + name2=name%self.getId() + link2=link%urllib.quote(self.absolute_url()) + + ret=about2+"\n"+name2+"\n"+link2+"\n"+"" + + + + urn="urn:"+re.sub('/',':',self.absolute_url()) li="""\n""" - ret="" + for content in contents: ret+=content[1].getRDF()+"\n" - ret+="""\n"""%urn + ret+="""\n"""%urn for content in contents: nurn="urn:"+re.sub('/',':',content[1].absolute_url()) ret+=li%nurn - return ret+"" + return ret+"" def index_html(self): """standard page""" @@ -2457,6 +2478,42 @@ class ECHO_root(Folder,Persistent,Implic security=ClassSecurityInfo() meta_type="ECHO_root" + + def showRDF(self): + """showrdf""" + self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml') + ret="""\n""" + ret+=self.getRDF()+"\n" + ret+="""""" + return ret + + def getRDF(self): + """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()) + + about2=about%urn + name2=name%self.getId() + + + ret=about2+"\n"+name2+"\n"+"" + + li="""\n""" + + + for content in contents: + ret+=content[1].getRDF()+"\n" + + ret+="""\n"""%urn + for content in contents: + nurn="urn:"+re.sub('/',':',content[1].absolute_url()) + ret+=li%nurn + return ret+"" + def showContent(self,path): """return content/html"""