Diff for /ECHO_content/ECHO_collection.py between versions 1.80 and 1.82

version 1.80, 2004/05/11 14:57:35 version 1.82, 2004/05/11 18:24:52
Line 1704  class ECHO_root(Folder,Persistent,Implic Line 1704  class ECHO_root(Folder,Persistent,Implic
             ret.append((collection[0].getId(),collection[1].getId(),collection[2]))              ret.append((collection[0].getId(),collection[1].getId(),collection[2]))
         return ret          return ret
   
       def getResourcesHTML(self,viewerType=None,filter=None):
           """gebe all ressourcen aus"""
   
           def sortHTML(x,y):
               return cmp(x[1].title,y[1].title)
           
           ret="""<html><body><h2>Resources in ECHO</h3>"""
           
           resources = self.ZopeFind(self,obj_metatypes=['ECHO_resource'],search_sub=1)
           ret+="""<h3>Found %i resources</h3>"""%len(resources)
           resources.sort(sortHTML)
           for resource in resources:
               echo_url=resource[1].absolute_url()
               
               if hasattr(resource[1],'title'):
                   title=resource[1].title
               else:
                   title="None"
               if filter:
                   if re.search(filter,title):
                       ret+="""\n<p><a href="%s">%s</a></p>"""%(echo_url,title)
               else:
                   ret+="""\n<p><a href="%s">%s</a></p>"""%(echo_url,title)
   
           ret +="""\n</body></html>"""
           
           #self.REQUEST.RESPONSE.setHeader("Content-Type", "text/html")
           #self.REQUEST.RESPONSE.write(ret)
               return ret
       
       def getResourcesXML(self,viewerType=None,filter=None):
           """gebe all ressourcen aus"""
           ret="""<?xml version="1.0" ?>
                    <index>"""
           for resource in self.ZopeFind(self,obj_metatypes=['ECHO_resource'],search_sub=1):
   
               echo_url=resource[1].absolute_url()
               if hasattr(resource[1],'link'):
                   viewer_url=resource[1].link
               else:
                   viewer_url="NO URL"
               if filter:
                   if re.search(filter,viewer_url):
                       ret+="""\n<resource echoLink="%s" viewerLink="%s"/>"""%(urllib.quote(echo_url,safe='/:?'),urllib.quote(viewer_url,safe='/:?'))
               else:
                   ret+="""\n<resource echoLink="%s" viewerLink="%s"/>"""%(urllib.quote(echo_url,safe='/:?'),urllib.quote(viewer_url,safe='/:?'))
           ret +="""\n</index>"""
           
           self.REQUEST.RESPONSE.setHeader("Content-Type", "text/xml")
           self.REQUEST.RESPONSE.write(ret)
                   
                   
 def manage_addECHO_root(self,id,title,RESPONSE=None):  def manage_addECHO_root(self,id,title,RESPONSE=None):

Removed from v.1.80  
changed lines
  Added in v.1.82


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