version 1.147, 2010/10/28 15:44:20
|
version 1.151, 2010/11/02 15:32:44
|
Line 18 import math
|
Line 18 import math
|
import urlparse |
import urlparse |
import cStringIO |
import cStringIO |
import re |
import re |
|
import string |
|
|
def logger(txt,method,txt2): |
def logger(txt,method,txt2): |
"""logging""" |
"""logging""" |
Line 51 def serializeNode(node, encoding='utf-8'
|
Line 51 def serializeNode(node, encoding='utf-8'
|
buf.close() |
buf.close() |
return s |
return s |
|
|
def getBrowserType(self): |
def browserCheck(self): |
"""get browser type object""" |
"""check the browsers request to find out the browser type""" |
if self.REQUEST.SESSION.has_key('browserType'): |
bt = {} |
return self.REQUEST.SESSION['browserType'] |
ua = self.REQUEST.get_header("HTTP_USER_AGENT") |
else: |
bt['ua'] = ua |
bt = browserCheck(self) |
bt['isIE'] = False |
self.REQUEST.SESSION.set('browserType', bt) |
bt['isN4'] = False |
logging.debug("documentViewer (BROWSER TYPE) bt %s"%bt) |
if string.find(ua, 'MSIE') > -1: |
|
bt['isIE'] = True |
|
else: |
|
bt['isN4'] = (string.find(ua, 'Mozilla/4.') > -1) |
|
|
|
try: |
|
nav = ua[string.find(ua, '('):] |
|
ie = string.split(nav, "; ")[1] |
|
if string.find(ie, "MSIE") > -1: |
|
bt['versIE'] = string.split(ie, " ")[1] |
|
except: pass |
|
|
|
bt['isMac'] = string.find(ua, 'Macintosh') > -1 |
|
bt['isWin'] = string.find(ua, 'Windows') > -1 |
|
bt['isIEWin'] = bt['isIE'] and bt['isWin'] |
|
bt['isIEMac'] = bt['isIE'] and bt['isMac'] |
|
bt['staticHTML'] = False |
|
|
return bt |
return bt |
|
|
|
|
Line 310 class documentViewer(Folder):
|
Line 327 class documentViewer(Folder):
|
return ret |
return ret |
|
|
|
|
|
def getBrowser(self): |
|
"""getBrowser the version of browser """ |
|
names="" |
|
names = browserCheck(self) |
|
#logging.debug("XXXXXXXXXXXXXXXX: %s"%names) |
|
return names |
|
|
def findDigilibUrl(self): |
def findDigilibUrl(self): |
"""try to get the digilib URL from zogilib""" |
"""try to get the digilib URL from zogilib""" |
url = self.template.zogilib.getDLBaseUrl() |
url = self.template.zogilib.getDLBaseUrl() |
Line 778 class documentViewer(Folder):
|
Line 802 class documentViewer(Folder):
|
#pageinfo ['originalPage'] = self.getOrigPages(docinfo=None, pageinfo=None) |
#pageinfo ['originalPage'] = self.getOrigPages(docinfo=None, pageinfo=None) |
pageinfo['characterNormalization'] = self.REQUEST.get('characterNormalization','') |
pageinfo['characterNormalization'] = self.REQUEST.get('characterNormalization','') |
pageinfo['query'] = self.REQUEST.get('query','') |
pageinfo['query'] = self.REQUEST.get('query','') |
|
#pageinfo['optionsClose']= self.REQUEST.get('optionsClose','') |
pageinfo['queryType'] = self.REQUEST.get('queryType','') |
pageinfo['queryType'] = self.REQUEST.get('queryType','') |
pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext') |
pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext') |
pageinfo['textPN'] = self.REQUEST.get('textPN','1') |
pageinfo['textPN'] = self.REQUEST.get('textPN','1') |