version 1.6, 2004/01/22 09:18:49
|
version 1.10, 2004/02/05 20:31:42
|
Line 18 class ZSQLExtendFolder(Persistent, Impli
|
Line 18 class ZSQLExtendFolder(Persistent, Impli
|
"""Folder""" |
"""Folder""" |
meta_type="ZSQLExtendFolder" |
meta_type="ZSQLExtendFolder" |
|
|
|
def actualPath(self,url=None): |
|
"""path""" |
|
|
|
if self.REQUEST['HTTP_X_FORWARDED_SERVER']=='': |
|
host=self.REQUEST['HTTP_HOST'] |
|
else: |
|
host=self.REQUEST['HTTP_X_FORWARDED_SERVER'] |
|
if not url: |
|
return "http://"+host+self.REQUEST['PATH_TRANSLATED'] |
|
else: |
|
temp=self.REQUEST[url].split("/") |
|
temp[2]=host |
|
return string.join(temp,"/") |
|
|
|
def getRequest(self): |
|
"""request""" |
|
return self.REQUEST |
|
|
def lowerEnd(self,path): |
def lowerEnd(self,path): |
"""oinly for demo""" |
"""oinly for demo""" |
Line 25 class ZSQLExtendFolder(Persistent, Impli
|
Line 42 class ZSQLExtendFolder(Persistent, Impli
|
|
|
def ZSQLisEmpty(self,field): |
def ZSQLisEmpty(self,field): |
"""Teste ob Treffer leer""" |
"""Teste ob Treffer leer""" |
print "field",field |
#print "field",field |
if not field: |
if not field: |
return 1 |
return 1 |
if field=="": |
if field=="": |
Line 38 class ZSQLExtendFolder(Persistent, Impli
|
Line 55 class ZSQLExtendFolder(Persistent, Impli
|
ret="""<select name="-op_%s"> |
ret="""<select name="-op_%s"> |
<option value="bw">begins with</option> <!-- begins with / beginnt mit, "Wort*" --> |
<option value="bw">begins with</option> <!-- begins with / beginnt mit, "Wort*" --> |
<option value="ew">ends with</option> |
<option value="ew">ends with</option> |
<option value="ct">contains</option> <!-- contains / enthaellt, "Wort" --> |
<option value="ct" selected>contains</option> <!-- contains / enthaellt, "Wort" --> |
<option value="eq">equals</option> <!-- equals / ist, =Wort --> |
<option value="eq">equals</option> <!-- equals / ist, =Wort --> |
</select>"""%fieldname |
</select>"""%fieldname |
return ret |
return ret |
Line 157 class ZSQLExtendFolder(Persistent, Impli
|
Line 174 class ZSQLExtendFolder(Persistent, Impli
|
self.search(var=queryString) |
self.search(var=queryString) |
return self.REQUEST.RESPONSE.redirect(format) |
return self.REQUEST.RESPONSE.redirect(format) |
|
|
def ZSQLFind(self,qs="",select="*",storename=None): |
def ZSQLFind(self,qs="",select="oid,*",storename=None): |
"""Find""" |
"""Find""" |
|
|
|
|
Line 252 class ZSQLExtendFolder(Persistent, Impli
|
Line 269 class ZSQLExtendFolder(Persistent, Impli
|
rangeStart=0 |
rangeStart=0 |
|
|
if not select: |
if not select: |
select="*" |
select="oid,*" |
#print "Q",nostore,qs |
#print "Q",nostore,qs |
#check for op in the case of inline search |
#check for op in the case of inline search |
|
|
Line 341 class ZSQLExtendFolder(Persistent, Impli
|
Line 358 class ZSQLExtendFolder(Persistent, Impli
|
if not nostore=="yes": |
if not nostore=="yes": |
|
|
self.REQUEST.SESSION['qs']=opfields |
self.REQUEST.SESSION['qs']=opfields |
print "IAMHERE again:", query |
#print "IAMHERE again:", query |
|
|
if storename: |
if storename: |
query2="SELECT count(%s) FROM %s %s"%(select,table,where) |
query2="SELECT count(*) FROM %s %s"%(table,where) |
#print "storing",query2 |
#print "storing",query2 |
#print "QUERYSTRING:",self.REQUEST.SESSION[storename]['queryString2'] |
#print "QUERYSTRING:",self.REQUEST.SESSION[storename]['queryString2'] |
if not self.REQUEST.SESSION.has_key(storename): |
if not self.REQUEST.SESSION.has_key(storename): |
Line 370 class ZSQLExtendFolder(Persistent, Impli
|
Line 387 class ZSQLExtendFolder(Persistent, Impli
|
self.REQUEST.SESSION[storename]['rangeEnd']=int(rangeStart)+int(limit) |
self.REQUEST.SESSION[storename]['rangeEnd']=int(rangeStart)+int(limit) |
self.REQUEST.SESSION[storename]['rangeSize']=limit |
self.REQUEST.SESSION[storename]['rangeSize']=limit |
|
|
print query |
#print query |
return self.search(var=query) |
return self.search(var=query) |
|
|
def ZSQLSearch(self): |
def ZSQLSearch(self): |
Line 443 class ZSQLExtendFolder(Persistent, Impli
|
Line 460 class ZSQLExtendFolder(Persistent, Impli
|
newquery.append(query) |
newquery.append(query) |
|
|
newquerystring=string.join(newquery,"&") |
newquerystring=string.join(newquery,"&") |
return "<a href='%s'>%s</a>"%(self.REQUEST['URL0']+"?"+newquerystring,html) |
|
|
return "<a href='%s'>%s</a>"%(self.actualPath()+"?"+newquerystring,html) |
|
|
|
|
def prevLink(self,html,storename="foundCount"): |
def prevLink(self,html,storename="foundCount"): |
Line 494 class ZSQLExtendFolder(Persistent, Impli
|
Line 512 class ZSQLExtendFolder(Persistent, Impli
|
newquery.append(query) |
newquery.append(query) |
|
|
newquerystring=string.join(newquery,"&") |
newquerystring=string.join(newquery,"&") |
return "<a href='%s'>%s</a>"%(self.REQUEST['URL0']+"?"+newquerystring,html) |
|
|
return "<a href='%s'>%s</a>"%(self.actualPath()+"?"+newquerystring,html) |
|
|
|
|
|
|
def prevLink_old(self,html): |
def prevLink_old(self,html): |
"""prev link""" |
"""prev link""" |
Line 521 class ZSQLExtendFolder(Persistent, Impli
|
Line 542 class ZSQLExtendFolder(Persistent, Impli
|
else: |
else: |
queries.append("-offset=%i"%offsetnew) |
queries.append("-offset=%i"%offsetnew) |
newquerystring=string.join(queries,"&") |
newquerystring=string.join(queries,"&") |
return "<a href='%s'>%s</a>"%(self.REQUEST['URL0']+"?"+newquerystring,html) |
return "<a href='%s'>%s</a>"%(self.actualPath()+"?"+newquerystring,html) |
|
|
def nextLink_old(self,html): |
def nextLink_old(self,html): |
"""prev link""" |
"""prev link""" |
Line 551 class ZSQLExtendFolder(Persistent, Impli
|
Line 572 class ZSQLExtendFolder(Persistent, Impli
|
queries.append("-offset=%i"%offsetnew) |
queries.append("-offset=%i"%offsetnew) |
newquerystring=string.join(queries,"&") |
newquerystring=string.join(queries,"&") |
|
|
return "<a href='%s'>%s</a>"%(self.REQUEST['URL0']+"?"+newquerystring,html) |
return "<a href='%s'>%s</a>"%(self.actualPath()+"?"+newquerystring,html) |
|
|
|
|
manage_addZSQLExtendFolderForm=DTMLFile('ZSQLExtendFolderAdd', globals()) |
manage_addZSQLExtendFolderForm=DTMLFile('ZSQLExtendFolderAdd', globals()) |