Diff for /ECHO_content/ECHO_collection.py between versions 1.13 and 1.14

version 1.13, 2004/02/09 11:45:46 version 1.14, 2004/02/11 17:45:29
Line 10  class ECHO_externalLink contains informa Line 10  class ECHO_externalLink contains informa
   
 """  """
 import string  import string
   import re
 import OFS.Image  import OFS.Image
 from types import *  from types import *
 from OFS.Image import Image  from OFS.Image import Image
Line 24  from Products.PageTemplates.PageTemplate Line 25  from Products.PageTemplates.PageTemplate
 from Globals import Persistent  from Globals import Persistent
 from Acquisition import Implicit  from Acquisition import Implicit
 from pyPgSQL import libpq  from pyPgSQL import libpq
   import xml.dom.minidom
   
 import urllib  import urllib
 import xml.dom.minidom  import xml.dom.minidom
Line 652  class ECHO_root(Folder,Persistent,Implic Line 654  class ECHO_root(Folder,Persistent,Implic
         self.id = id          self.id = id
         self.title=title          self.title=title
   
       def deleteSpace(self,str):
           """delete space at the end of a line"""
           if str[len(str)-1]==" ":
               return str[0:len(str)-1]
           else:
               return str
           
       
   
       # zusaetliche methoden fuer das vlp muessen in ein eigenes produkt
   
       def formatAscii(self,str,url=None):
           """ersetze ascii umbrueche durch <br>"""
           #url=None
           if url:
               
               retStr=""
               words=str.split("\n")
               
               for word in words:
                   strUrl=url%word
                   print "str",strUrl
                   retStr+="""<a href="%s">%s</a><br/>"""%(strUrl,word)
               str=retStr
           if str:
               return re.sub(r"[\n]","<br/>",str)
           else:
               return ""
           
       def link2html(self,str):
           """link2html fuer VLP muss hier noch raus"""
           if str:
               print str
               str=re.sub("\&","&amp;",str)
               dom=xml.dom.minidom.parseString("<?xml version='1.0' ?><txt>"+str+"</txt>")
               links=dom.getElementsByTagName("link")
               
               print "link",links
               for link in links:
                   link.tagName="a"
                   ref=link.getAttribute("ref")
                   if self.checkRef(ref):
                       link.setAttribute("href",self.aq_parent.absolute_url()+"/vlp_coll?id="+ref)
   
               return dom.toxml('utf-8')
           return ""
   
   
       def checkRef(self,ref):
           dbs={'vl_literature':'AND CD LIKE \'%lise%\'','vl_technology':'','vl_people':''}
           res=None
           for db in dbs.keys():
               #print ref,"select reference from %s where reference =\'%s\' %s"%(db,ref,dbs[db])
   
               res=res or self.search(var=str("select reference from %s where reference =\'%s\' %s"%(db,ref,dbs[db])))
           return res
                                       
       #Ende Methode fuer vlp
   
     def PgQuoteString(self,string):      def PgQuoteString(self,string):
         """Quote string"""          """Quote string"""
         print "PG",string          #print "PG",string
         return libpq.PgQuoteString(string)          return libpq.PgQuoteString(string)
                   
     def getPartners(self):      def getPartners(self):

Removed from v.1.13  
changed lines
  Added in v.1.14


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