Diff for /ECHO_content/ECHO_collection.py between versions 1.140 and 1.141

version 1.140, 2004/07/16 17:55:43 version 1.141, 2004/07/17 10:19:06
Line 29  from Products.PageTemplates.ZopePageTemp Line 29  from Products.PageTemplates.ZopePageTemp
 from Globals import Persistent, package_home  from Globals import Persistent, package_home
 from Acquisition import Implicit  from Acquisition import Implicit
 from ECHO_helpers import displayTypes  from ECHO_helpers import displayTypes
   import urllib
   
 try:  try:
     from psycopg import libpq      from psycopg import libpq
Line 497  class ECHO_resource(Folder,Persistent): Line 497  class ECHO_resource(Folder,Persistent):
   
         about2=about%urn          about2=about%urn
         name2=name%self.getId()          name2=name%self.getId()
         link2=link%self.link          link2=link%urllib.quote(self.link)
   
         ret=about2+"\n"+name2+"\n"+link2+"\n"+"</RDF:description>"          ret=about2+"\n"+name2+"\n"+link2+"\n"+"</RDF:Description>"
         return ret          return ret
                   
                   
Line 1490  class ECHO_collection(Folder, Persistent Line 1490  class ECHO_collection(Folder, Persistent
     path="/mpiwg/online/permanent/shipbuilding"      path="/mpiwg/online/permanent/shipbuilding"
   
     def showRDF(self):      def showRDF(self):
           """showrdf"""
               self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml')
         ret="""<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"  xmlns:ECHONAVIGATION="http://www.echo.eu/rdf#">\n"""          ret="""<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"  xmlns:ECHONAVIGATION="http://www.echo.eu/rdf#">\n"""
         ret+=self.getRDF()+"\n"          ret+=self.getRDF()+"\n"
         ret+="""</RDF:RDF>"""          ret+="""</RDF:RDF>"""
               return ret
           
     def getRDF(self):      def getRDF(self):
         """rdf of the collection"""          """rdf of the collection"""
Line 1500  class ECHO_collection(Folder, Persistent Line 1503  class ECHO_collection(Folder, Persistent
   
         about="""<RDF:Description about="%s">"""          about="""<RDF:Description about="%s">"""
         name="""<ECHONAVIGATION:name>%s</ECHONAVIGATION:name>"""          name="""<ECHONAVIGATION:name>%s</ECHONAVIGATION:name>"""
                   link="""<ECHONAVIGATION:link>%s</ECHONAVIGATION:link>"""
         urn="urn:"+re.sub('/',':',self.absolute_url())          urn="urn:"+re.sub('/',':',self.absolute_url())
   
         about2=about%urn          about2=about%urn
         name2=name%self.getId()          name2=name%self.getId()
           link2=link%urllib.quote(self.absolute_url())
   
           ret=about2+"\n"+name2+"\n"+link2+"\n"+"</RDF:Description>"
   
                   
   
         ret=about2+"\n"+name2+"\n"+"</RDF:description>"  
         urn="urn:"+re.sub('/',':',self.absolute_url())  
         li="""<RDF:li resource="%s" />\n"""          li="""<RDF:li resource="%s" />\n"""
   
                   
         for content in contents:          for content in contents:
             ret+=content[1].getRDF()+"\n"              ret+=content[1].getRDF()+"\n"
                           
         ret+="""<RDF:Seq about="%s"/>\n"""%urn          ret+="""<RDF:Seq about="%s">\n"""%urn
         for content in contents:          for content in contents:
             nurn="urn:"+re.sub('/',':',content[1].absolute_url())              nurn="urn:"+re.sub('/',':',content[1].absolute_url())
             ret+=li%nurn              ret+=li%nurn
         return ret+"</rdf:Seq>"          return ret+"</RDF:Seq>"
                   
                   
     def changeLabels(self):      def changeLabels(self):
Line 2228  class ECHO_group(ECHO_collection): Line 2233  class ECHO_group(ECHO_collection):
     def getRDF(self):      def getRDF(self):
         """rdf of the collection"""          """rdf of the collection"""
         contents=self.ZopeFind(self,obj_metatypes=['ECHO_group','ECHO_resource','ECHO_collection'])          contents=self.ZopeFind(self,obj_metatypes=['ECHO_group','ECHO_resource','ECHO_collection'])
           about="""<RDF:Description about="%s">"""
           name="""<ECHONAVIGATION:name>%s</ECHONAVIGATION:name>"""
           
           
           
           link="""<ECHONAVIGATION:link>%s</ECHONAVIGATION:link>"""
           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"+"</RDF:Description>"
   
   
           
                   
         urn="urn:"+re.sub('/',':',self.absolute_url())          urn="urn:"+re.sub('/',':',self.absolute_url())
         li="""<RDF:li resource="%s" />\n"""          li="""<RDF:li resource="%s" />\n"""
         ret=""          
                   
         for content in contents:          for content in contents:
             ret+=content[1].getRDF()+"\n"              ret+=content[1].getRDF()+"\n"
                           
         ret+="""<RDF:Seq about="%s"/>\n"""%urn          ret+="""<RDF:Seq about="%s">\n"""%urn
         for content in contents:          for content in contents:
             nurn="urn:"+re.sub('/',':',content[1].absolute_url())              nurn="urn:"+re.sub('/',':',content[1].absolute_url())
             ret+=li%nurn              ret+=li%nurn
         return ret+"</rdf:Seq>"          return ret+"</RDF:Seq>"
                   
     def index_html(self):      def index_html(self):
         """standard page"""          """standard page"""
Line 2458  class ECHO_root(Folder,Persistent,Implic Line 2479  class ECHO_root(Folder,Persistent,Implic
           
     meta_type="ECHO_root"      meta_type="ECHO_root"
   
       def showRDF(self):
           """showrdf"""
               self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml')
           ret="""<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"  xmlns:ECHONAVIGATION="http://www.echo.eu/rdf#">\n"""
           ret+=self.getRDF()+"\n"
           ret+="""</RDF:RDF>"""
               return ret
   
       def getRDF(self):
           """rdf of the collection"""
           contents=self.ZopeFind(self,obj_metatypes=['ECHO_group','ECHO_resource','ECHO_collection'])
   
           about="""<RDF:Description about="%s">"""
           name="""<ECHONAVIGATION:name>%s</ECHONAVIGATION:name>"""
           
           urn="urn:"+re.sub('/',':',self.absolute_url())
   
           about2=about%urn
           name2=name%self.getId()
           
   
           ret=about2+"\n"+name2+"\n"+"</RDF:Description>"
   
           li="""<RDF:li resource="%s" />\n"""
   
           
           for content in contents:
               ret+=content[1].getRDF()+"\n"
               
           ret+="""<RDF:Seq about="%s">\n"""%urn
           for content in contents:
               nurn="urn:"+re.sub('/',':',content[1].absolute_url())
               ret+=li%nurn
           return ret+"</RDF:Seq>"
           
   
     def showContent(self,path):      def showContent(self,path):
         """return content/html"""          """return content/html"""
                   

Removed from v.1.140  
changed lines
  Added in v.1.141


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>