from OFS.Folder import Folder from Globals import DTMLFile,package_home from tempfile import mkstemp from AccessControl import getSecurityManager from Products.PageTemplates.PageTemplateFile import PageTemplateFile import urllib import os.path import zLOG """Webfrontend fuer das Update der Datenbanken ueber das Web mithilfe von fm.jar """ class ZSQLUpdate(Folder): """Klasse zum update, in den Folder werden die verschiedenen Update XML files hineingelegt""" meta_type="ZSQLUpdate" def update(self,xmlurl=None,xmlobject=None): """update by calling fm.jar and using the xmlfile at xmlurl @param xmlurl: url auf ein xml file fuer fm.jar """ tmphandler,path =mkstemp() tmpFile=os.fdopen(tmphandler,"w+b") if xmlurl: xmlf=urllib.urlopen(xmlurl).read() if xmlobject: try: xmlf=getattr(self,xmlobject)() except: xmlf=getattr(self,xmlobject).data tmpFile.write(xmlf) tmpFile.close() #path=tmpFile.name fmJarPath=os.path.join(package_home(globals()), 'fm.jar') zLOG.LOG("MPIWG Web",zLOG.INFO,"java -classpath %s -Djava.awt.headless=true Convert %s"%(fmJarPath,path)) ret=os.popen("java -classpath %s -Djava.awt.headless=true Convert %s"%(fmJarPath,path),"r").read() zLOG.LOG("MPIWG Web",zLOG.INFO,"result convert: %s"%ret) os.unlink(path) return "
(notice, everything worked fine if only java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
comes out as result)
Result:
%s