version 1.107, 2007/04/02 09:48:13
|
version 1.109, 2007/04/03 14:44:24
|
Line 4 from Globals import DTMLFile,package_hom
|
Line 4 from Globals import DTMLFile,package_hom
|
import urllib |
import urllib |
import re |
import re |
import string |
import string |
import sys |
|
#from pyPgSQL import libpq |
#from pyPgSQL import libpq |
from AccessControl import getSecurityManager |
from AccessControl import getSecurityManager,Unauthorized |
from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate |
from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate |
from Products.PageTemplates.PageTemplateFile import PageTemplateFile |
from Products.PageTemplates.PageTemplateFile import PageTemplateFile |
|
|
Line 20 import os
|
Line 19 import os
|
import copy |
import copy |
import unicodedata |
import unicodedata |
import tempfile |
import tempfile |
import logging |
import sys |
|
|
#ersetzt logging |
#ersetzt logging |
def logger(txt,method,txt2): |
def logger(txt,method,txt2): |
Line 322 class ZSQLExtendFolder(Folder,Persistent
|
Line 321 class ZSQLExtendFolder(Folder,Persistent
|
return ret |
return ret |
|
|
|
|
def importXMLFile(self,table,data=None,identify=None,filename=None,RESPONSE=None): |
def importXMLFile(self,table,containerTagName,fieldNames,data=None,identify=None,filename=None,RESPONSE=None): |
#TODO: finish importXMLFile |
#TODO: finish importXMLFile |
''' |
''' |
Import XML file into the table |
Import XML file into the table |
Line 332 class ZSQLExtendFolder(Folder,Persistent
|
Line 331 class ZSQLExtendFolder(Folder,Persistent
|
@param identify: (optional) field res. tag which identifies a entry uniquely for updating purposes. |
@param identify: (optional) field res. tag which identifies a entry uniquely for updating purposes. |
@param RESPONSE: (optional) |
@param RESPONSE: (optional) |
''' |
''' |
|
ret="" |
from xml.dom.pulldom import parseString |
from xml.dom.pulldom import parseString |
|
|
doc=parseString(file.read()) |
doc=parseString(file.read()) |
Line 409 class ZSQLExtendFolder(Folder,Persistent
|
Line 409 class ZSQLExtendFolder(Folder,Persistent
|
#print "wrote: %s"%fn |
#print "wrote: %s"%fn |
|
|
|
|
def importXMLFileFMP(self,table,dsn=None,uploadfile=None,update_fields=None,id_field=None,sync_mode=False,replace=False,redirect_url=None,RESPONSE=None): |
def importXMLFileFMP(self,table,dsn=None,uploadfile=None,update_fields=None,id_field=None,sync_mode=False,replace=False,redirect_url=None,ascii_db=False,RESPONSE=None): |
''' |
''' |
Import FileMaker XML file (FMPXMLRESULT format) into the table. |
Import FileMaker XML file (FMPXMLRESULT format) into the table. |
@param dsn: database connection string |
@param dsn: database connection string |
Line 443 class ZSQLExtendFolder(Folder,Persistent
|
Line 443 class ZSQLExtendFolder(Folder,Persistent
|
options.sync_mode=sync_mode |
options.sync_mode=sync_mode |
options.replace_table=replace |
options.replace_table=replace |
options.lc_names=True |
options.lc_names=True |
|
options.ascii_db=ascii_db |
importFMPXML(options) |
importFMPXML(options) |
|
|
os.remove(filename) |
os.remove(filename) |
Line 852 class ZSQLExtendFolder(Folder,Persistent
|
Line 853 class ZSQLExtendFolder(Folder,Persistent
|
|
|
def ZSQLSimpleSearch(self,query=None,max_rows=1000000): |
def ZSQLSimpleSearch(self,query=None,max_rows=1000000): |
"""simple search""" |
"""simple search""" |
|
logging.error(query) |
#print query |
#print query |
if not query: |
if not query: |
query=self.query |
query=self.query |
Line 1037 class ZSQLExtendFolder(Folder,Persistent
|
Line 1038 class ZSQLExtendFolder(Folder,Persistent
|
return True |
return True |
|
|
|
|
def ZSQLFindIndexed(self,qs="",select="oid,*",storename=None,indexedFields=['data_line'],restrictField='id_text',**argv): |
def ZSQLFindIndexed(self,tableList=[],qs="",select="oid,*",storename=None,indexedFields=['data_line'],restrictField='id_text',**argv): |
"""find2""" |
"""find2""" |
|
|
for index in self.ZopeFind(self,obj_ids=indexedFields): |
for index in self.ZopeFind(self,obj_ids=indexedFields): |