Diff for /ECHO_content/ECHO_collection.py between versions 1.168 and 1.171

version 1.168, 2004/09/01 14:32:32 version 1.171, 2004/09/28 15:00:08
Line 1135  class ECHO_resource(Folder,Persistent): Line 1135  class ECHO_resource(Folder,Persistent):
             texttools=dom.getElementsByTagName('texttool')              texttools=dom.getElementsByTagName('texttool')
             text=texttools[0].getElementsByTagName('text')              text=texttools[0].getElementsByTagName('text')
             texturl=getText(text[0].childNodes)              texturl=getText(text[0].childNodes)
                           if not (texturl.split(":")[0] in ['http','ftp','file']): 
                       texturl=re.sub("//","/",texturl)    
               #return texturl+"::"+texturl.split(":")[0]
             if not noredirect:              if not noredirect:
                             self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml')                                self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml')  
                 self.REQUEST.RESPONSE.redirect(texturl)                  self.REQUEST.RESPONSE.redirect(texturl)
Line 2278  class ECHO_collection(Folder, Persistent Line 2280  class ECHO_collection(Folder, Persistent
     def getCollectionTreeXML(self):      def getCollectionTreeXML(self):
         """Tree as XML"""          """Tree as XML"""
   
       def addPassWd(str):
           """adds a user/passwd to an url"""
           txt2=re.sub(r"(http://)(.*?)","\g<1>www:3333@\g<2>",str)
           return txt2
   
         def getCollection(object,depth=0):          def getCollection(object,depth=0):
             depth+=1              depth+=1
             collections=""              collections=""
Line 2285  class ECHO_collection(Folder, Persistent Line 2292  class ECHO_collection(Folder, Persistent
                 element=getattr(object,entry)                  element=getattr(object,entry)
                 try:                  try:
                     if element.meta_type in ["ECHO_collection","ECHO_group"]:                      if element.meta_type in ["ECHO_collection","ECHO_group"]:
                         collections+="<element name=\""+quote(element.title)+"\" url=\""+element.absolute_url()+"\">"                          collections+="<element name=\""+quote(element.title)+"\" url=\""+addPassWd(element.absolute_url())+"\">"
                         collections+=getCollection(element,depth)+"</element>\n"                          collections+=getCollection(element,depth)+"</element>\n"
                 except:                  except:
                     """nothing"""                      """nothing"""
Line 2571  class ECHO_collection(Folder, Persistent Line 2578  class ECHO_collection(Folder, Persistent
         if RESPONSE is not None:          if RESPONSE is not None:
             RESPONSE.redirect('manage_main')              RESPONSE.redirect('manage_main')
                           
       def setAlwaysClickable(self,flag="yes"):
           """set clickable"""
           if flag=="yes":
               self.isAlwaysClickable="yes"
           else:
               self.isAlwaysClickable=None
   
           return flag
   
     def showOverview(self):      def showOverview(self):
         """overview"""          """overview"""
Line 3667  class ECHO_root(Folder,Persistent,Implic Line 3682  class ECHO_root(Folder,Persistent,Implic
   
     def getMetaDatasXML(self,viewerType=None,filter=None):      def getMetaDatasXML(self,viewerType=None,filter=None):
         """gebe all ressourcen aus"""          """gebe all ressourcen aus"""
           # check if the request's host part was OK
           http_host = self.REQUEST['HTTP_HOST']
           host_port = self.REQUEST['SERVER_PORT']
           fix_host = None
           if http_host and http_host.rfind(host_port) == -1:
               print "HTTP_HOST needs fixing!"
               fix_host = http_host + ":" + host_port
   
         ret="""<?xml version="1.0" ?>          ret="""<?xml version="1.0" ?>
                  <index>"""                   <index>"""
         for resource in self.ZopeFind(self,obj_metatypes=['ECHO_resource'],search_sub=1):          for resource in self.ZopeFind(self,obj_metatypes=['ECHO_resource'],search_sub=1):
   
             echo_url=resource[1].absolute_url()              echo_url=resource[1].absolute_url()
               if fix_host:
                   #print "replacing ", http_host, " by ", fix_host
                   echo_url = string.replace(echo_url, http_host, fix_host, 1)
                           
             if hasattr(resource[1],'link'):              if hasattr(resource[1],'link'):
                 meta_url=echo_url+"/getMetaDataXML"                  meta_url=echo_url+"/getMetaDataXML"
Line 3690  class ECHO_root(Folder,Persistent,Implic Line 3716  class ECHO_root(Folder,Persistent,Implic
                                   
         ret +="""\n</index>"""          ret +="""\n</index>"""
                   
           
         self.REQUEST.RESPONSE.setHeader("Content-Type", "text/xml")          self.REQUEST.RESPONSE.setHeader("Content-Type", "text/xml")
         self.REQUEST.RESPONSE.write(ret)          self.REQUEST.RESPONSE.write(ret)
   

Removed from v.1.168  
changed lines
  Added in v.1.171


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