--- ECHO_content/ECHO_collection.py 2004/10/14 09:48:50 1.178 +++ ECHO_content/ECHO_collection.py 2004/10/19 19:20:19 1.181 @@ -39,6 +39,7 @@ from Ft.Xml import EMPTY_NAMESPACE import Ft.Xml.XPath import cStringIO +import zLOG try: from psycopg import libpq @@ -1142,17 +1143,29 @@ class ECHO_resource(Folder,Persistent): def getFullTextXML(self,noredirect=None): """getFullTextXML; gives the FullText as an XML Document, and if somthing goes wrong.""" + try: + zLOG.LOG("ECHO Fulltext",zLOG.INFO,"open %s"%self.metalink) fh=ECHO_helpers.urlopen(self.metalink) + zLOG.LOG("ECHO Fulltext",zLOG.INFO,"opened %s"%self.metalink) dom=xml.dom.minidom.parse(fh) texttools=dom.getElementsByTagName('texttool') text=texttools[0].getElementsByTagName('text') texturl=getText(text[0].childNodes) + + zLOG.LOG("ECHO Fulltext",zLOG.INFO,"found %s"%texturl) + fh.close() + zLOG.LOG("ECHO Fulltext",zLOG.INFO,"closed fh") + #keine url if not (texturl.split(":")[0] in ['http','ftp','file']): - texturl=re.sub("//","/",texturl) - #return texturl+"::"+texturl.split(":")[0] + if not noredirect: + return file(texturl).read() + else: + return texturl + if not noredirect: self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml') + zLOG.LOG("ECHO Fulltext",zLOG.INFO,"redirect to:%s"%texturl) self.REQUEST.RESPONSE.redirect(texturl) else: return texturl @@ -1178,6 +1191,8 @@ class ECHO_resource(Folder,Persistent): archivepath=getText(text[0].childNodes) archivepath=re.sub('/mpiwg/online/','',archivepath) imageurl="http://echo.mpiwg-berlin.mpg.de/zogilib?fn="+archivepath+"/"+imagetemp + fh.close() + if not noredirect: self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml') self.REQUEST.RESPONSE.redirect(imageurl)