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

version 1.141, 2004/07/17 10:19:06 version 1.146, 2004/07/18 17:11:32
Line 46  import xml.dom.minidom Line 46  import xml.dom.minidom
 from ECHO_graphicalOverview import javaHandler,javaScriptMain  from ECHO_graphicalOverview import javaHandler,javaScriptMain
 import ECHO_helpers  import ECHO_helpers
   
   def getRDFDescription(self,linkURL,urn=None,nameDef=None):
           """rdf"""
           ret=""
           about="""<RDF:Description about="%s">"""
           name="""<ECHONAVIGATION:name>%s</ECHONAVIGATION:name>"""
           link="""<ECHONAVIGATION:link xlink:href="%s">%s</ECHONAVIGATION:link>"""
           #link="""<ECHONAVIGATION:link RDF:about="%s"/>"""
           type="""<ECHONAVIGATION:type>%s</ECHONAVIGATION:type>"""
               #xlink="""<ECHONAVIGATION:xlink xlink:href="%s"/>"""    
           if not urn:
               urn="urn:"+re.sub('/',':',self.absolute_url())
   
           about2=about%urn
           if not nameDef:
               if hasattr(self,'label') and not (self.label==""):
                   name2=name%self.label
               elif not self.title=="":
                   name2=name%self.title
               else:
                   name2=name%self.getId()
   
               name2=re.sub('&','&amp;',name2)
           else:
               name2=name%nameDef
   
           linkURL=re.sub('http:','',linkURL)
           linkURL2=re.sub('&','&amp;',linkURL)
           link2=link%(("http:"+linkURL2),("http:"+urllib.quote(linkURL)))
   
           type2=type%self.meta_type
           
           ret=about2+"\n"+name2+"\n"+link2+"\n"+type2+"\n"+"\n</RDF:Description>"
           return ret
       
 def getCopyrightsFromForm(self,argv):  def getCopyrightsFromForm(self,argv):
     medias={}      medias={}
     partners={}      partners={}
Line 477  def manage_addECHO_layoutTemplate(self, Line 511  def manage_addECHO_layoutTemplate(self,
     REQUEST.RESPONSE.redirect(u+'/manage_main')      REQUEST.RESPONSE.redirect(u+'/manage_main')
     return ''      return ''
   
   
   
 class ECHO_resource(Folder,Persistent):  class ECHO_resource(Folder,Persistent):
     """ECHO Ressource"""      """ECHO Ressource"""
     security=ClassSecurityInfo()      security=ClassSecurityInfo()
Line 487  class ECHO_resource(Folder,Persistent): Line 523  class ECHO_resource(Folder,Persistent):
     getSubCols = ECHO_helpers.getSubCols      getSubCols = ECHO_helpers.getSubCols
   
     security.declareProtected('View','index_html')      security.declareProtected('View','index_html')
     def getRDF(self):  
       def showRDF(self):
           """showrdf"""
               self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml')
           ret="""<?xml version="1.0" encoding="utf-8"?>\n<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(urn="echo:collectionroot")+"\n"
   
           ret+="""</RDF:RDF>"""
               return ret 
   
       def getRDF(self,urn=None):
         """rdf"""          """rdf"""
         ret=""          ret=getRDFDescription(self,self.link,urn=urn)
         about="""<RDF:Description about="%s">"""          return ret+self.createSubElementRDF() 
         name="""<ECHONAVIGATION:name>%s</ECHONAVIGATION:name>"""  
         link="""<ECHONAVIGATION:link>%s</ECHONAVIGATION:link>"""  
       def createSubElementRDF(self):
           """rdf list"""
         urn="urn:"+re.sub('/',':',self.absolute_url())          urn="urn:"+re.sub('/',':',self.absolute_url())
           ret=""
   
         about2=about%urn          rettemp="""<RDF:Seq about="%s">\n"""%urn
         name2=name%self.getId()          flag=0
         link2=link%urllib.quote(self.link)  
   
         ret=about2+"\n"+name2+"\n"+link2+"\n"+"</RDF:Description>"          li="""<RDF:li resource="%s" />\n"""
         return ret          if not ('<error>' in self.getFullTextXML(noredirect='Yes')):
               nurn="urn:"+re.sub('/',':',self.absolute_url()+'/getFullTextXML')
               rettemp+=li%nurn
               flag=1
           rettemp+="</RDF:Seq>"
                   
           if flag==1:
               ret+=rettemp
               
           if not ('<error>' in self.getFullTextXML(noredirect='Yes')):
               ret+=getRDFDescription(self,self.absolute_url()+'/getFullTextXML',urn=self.absolute_url()+'/getFullTextXML',nameDef="Fulltext")
   
           return ret
                   
     def getAccessRightSelectorHTML(self,outlook="select"):      def getAccessRightSelectorHTML(self,outlook="select"):
         """htmlselector"""          """htmlselector"""
Line 1492  class ECHO_collection(Folder, Persistent Line 1551  class ECHO_collection(Folder, Persistent
     def showRDF(self):      def showRDF(self):
         """showrdf"""          """showrdf"""
             self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml')              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="""<?xml version="1.0" encoding="utf-8"?>\n<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(urn="echo:collectionroot")+"\n"
   
         ret+="""</RDF:RDF>"""          ret+="""</RDF:RDF>"""
             return ret              return ret
   
     def getRDF(self):      def getRDF(self,urn=None):
         """rdf of the collection"""          """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>"""  
         link="""<ECHONAVIGATION:link>%s</ECHONAVIGATION:link>"""  
         urn="urn:"+re.sub('/',':',self.absolute_url())  
   
         about2=about%urn          contents=self.ZopeFind(self,obj_metatypes=['ECHO_group','ECHO_resource','ECHO_collection'])
         name2=name%self.getId()  
         link2=link%urllib.quote(self.absolute_url())  
   
         ret=about2+"\n"+name2+"\n"+link2+"\n"+"</RDF:Description>"  
   
           ret=getRDFDescription(self,self.absolute_url(),urn=urn)
   
           if not urn:
               urn="urn:"+re.sub('/',':',self.absolute_url())
   
         li="""<RDF:li resource="%s" />\n"""          li="""<RDF:li resource="%s" />\n"""
   
Line 2230  class ECHO_group(ECHO_collection): Line 2283  class ECHO_group(ECHO_collection):
           
     security.declareProtected('View','index_html')      security.declareProtected('View','index_html')
   
     def getRDF(self):      def getRDF(self,urn=None):
         """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>"  
   
           ret=getRDFDescription(self,self.absolute_url(),urn)
   
                   
   
Line 2482  class ECHO_root(Folder,Persistent,Implic Line 2523  class ECHO_root(Folder,Persistent,Implic
     def showRDF(self):      def showRDF(self):
         """showrdf"""          """showrdf"""
             self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml')              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="""<?xml version="1.0" encoding="utf-8"?>\n<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(urn="echo:collectionroot")+"\n"
   
         ret+="""</RDF:RDF>"""          ret+="""</RDF:RDF>"""
             return ret              return ret
   
     def getRDF(self):      def getRDF(self,urn=None):
         """rdf of the collection"""          """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()  
                   
           contents=self.ZopeFind(self,obj_metatypes=['ECHO_group','ECHO_resource','ECHO_collection'])
   
         ret=about2+"\n"+name2+"\n"+"</RDF:Description>"          ret=getRDFDescription(self,self.absolute_url(),urn=urn)
   
         li="""<RDF:li resource="%s" />\n"""          li="""<RDF:li resource="%s" />\n"""
   

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


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