version 1.177, 2004/10/13 14:55:15
|
version 1.181, 2004/10/19 19:20:19
|
Line 39 from Ft.Xml import EMPTY_NAMESPACE
|
Line 39 from Ft.Xml import EMPTY_NAMESPACE
|
|
|
import Ft.Xml.XPath |
import Ft.Xml.XPath |
import cStringIO |
import cStringIO |
|
import zLOG |
|
|
try: |
try: |
from psycopg import libpq |
from psycopg import libpq |
Line 590 class ECHO_layoutTemplate(ZopePageTempla
|
Line 591 class ECHO_layoutTemplate(ZopePageTempla
|
|
|
def manage_addECHO_layoutTemplateForm(self): |
def manage_addECHO_layoutTemplateForm(self): |
"""Form for adding""" |
"""Form for adding""" |
pt=PageTemplateFile('Products/ECHO_content/zpt/AddECHO_layoutTemplate.zpt').__of__(self) |
pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt/AddECHO_layoutTemplate.zpt')).__of__(self) |
return pt() |
return pt() |
|
|
from urllib import quote |
from urllib import quote |
Line 1142 class ECHO_resource(Folder,Persistent):
|
Line 1143 class ECHO_resource(Folder,Persistent):
|
|
|
def getFullTextXML(self,noredirect=None): |
def getFullTextXML(self,noredirect=None): |
"""getFullTextXML; gives the FullText as an XML Document, and <error></error> if somthing goes wrong.""" |
"""getFullTextXML; gives the FullText as an XML Document, and <error></error> if somthing goes wrong.""" |
|
|
try: |
try: |
|
zLOG.LOG("ECHO Fulltext",zLOG.INFO,"open %s"%self.metalink) |
fh=ECHO_helpers.urlopen(self.metalink) |
fh=ECHO_helpers.urlopen(self.metalink) |
|
zLOG.LOG("ECHO Fulltext",zLOG.INFO,"opened %s"%self.metalink) |
dom=xml.dom.minidom.parse(fh) |
dom=xml.dom.minidom.parse(fh) |
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) |
|
|
|
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']): |
if not (texturl.split(":")[0] in ['http','ftp','file']): |
texturl=re.sub("//","/",texturl) |
if not noredirect: |
#return texturl+"::"+texturl.split(":")[0] |
return file(texturl).read() |
|
else: |
|
return texturl |
|
|
if not noredirect: |
if not noredirect: |
self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml') |
self.REQUEST.RESPONSE.setHeader('Content-Type','text/xml') |
|
zLOG.LOG("ECHO Fulltext",zLOG.INFO,"redirect to:%s"%texturl) |
self.REQUEST.RESPONSE.redirect(texturl) |
self.REQUEST.RESPONSE.redirect(texturl) |
else: |
else: |
return texturl |
return texturl |
Line 1178 class ECHO_resource(Folder,Persistent):
|
Line 1191 class ECHO_resource(Folder,Persistent):
|
archivepath=getText(text[0].childNodes) |
archivepath=getText(text[0].childNodes) |
archivepath=re.sub('/mpiwg/online/','',archivepath) |
archivepath=re.sub('/mpiwg/online/','',archivepath) |
imageurl="http://echo.mpiwg-berlin.mpg.de/zogilib?fn="+archivepath+"/"+imagetemp |
imageurl="http://echo.mpiwg-berlin.mpg.de/zogilib?fn="+archivepath+"/"+imagetemp |
|
fh.close() |
|
|
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(imageurl) |
self.REQUEST.RESPONSE.redirect(imageurl) |