comparison documentViewer.py @ 141:39c7d6164da8

characterNormalization (reg,norm, none)
author abukhman
date Thu, 12 Aug 2010 12:08:24 +0200
parents 6345583d809a
children 83e35adb92d3
comparison
equal deleted inserted replaced
140:6345583d809a 141:39c7d6164da8
224 viewMode="images" 224 viewMode="images"
225 225
226 return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode) 226 return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode)
227 227
228 security.declareProtected('View','index_html') 228 security.declareProtected('View','index_html')
229 def index_html(self,url,mode="texttool",viewMode="auto",tocMode="thumbs",start=None,pn=1,mk=None, query=None, querySearch=None): 229 def index_html(self,url,mode="texttool",viewMode="auto",tocMode="thumbs",start=None,pn=1,mk=None, query=None, querySearch=None, characterNormalization=None):
230 ''' 230 '''
231 view it 231 view it
232 @param mode: defines how to access the document behind url 232 @param mode: defines how to access the document behind url
233 @param url: url which contains display information 233 @param url: url which contains display information
234 @param viewMode: if images display images, if text display text, default is auto (text,images or auto) 234 @param viewMode: if images display images, if text display text, default is auto (text,images or auto)
235 @param tocMode: type of 'table of contents' for navigation (thumbs, text, figures, none) 235 @param tocMode: type of 'table of contents' for navigation (thumbs, text, figures, none)
236 @param characterNormalization type of text display (reg, norm, none)
236 @param querySearch: type of different search modes (fulltext, fulltextMorph, xpath, xquery, ftIndex, ftIndexMorph, fulltextMorphLemma) 237 @param querySearch: type of different search modes (fulltext, fulltextMorph, xpath, xquery, ftIndex, ftIndexMorph, fulltextMorphLemma)
237 ''' 238 '''
238 239
239 logging.debug("documentViewer (index) mode: %s url:%s start:%s pn:%s"%(mode,url,start,pn)) 240 logging.debug("documentViewer (index) mode: %s url:%s start:%s pn:%s"%(mode,url,start,pn))
240 241
675 676
676 logging.debug("documentViewer (getdocinfo) docinfo: %s"%docinfo) 677 logging.debug("documentViewer (getdocinfo) docinfo: %s"%docinfo)
677 self.REQUEST.SESSION['docinfo'] = docinfo 678 self.REQUEST.SESSION['docinfo'] = docinfo
678 return docinfo 679 return docinfo
679 680
680 def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None): 681 def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None, characterNormalization=None):
681 """returns pageinfo with the given parameters""" 682 """returns pageinfo with the given parameters"""
682 pageinfo = {} 683 pageinfo = {}
683 current = getInt(current) 684 current = getInt(current)
684 pageinfo['current'] = current 685 pageinfo['current'] = current
685 rows = int(rows or self.thumbrows) 686 rows = int(rows or self.thumbrows)
698 pageinfo['numgroups'] = int(np / grpsize) 699 pageinfo['numgroups'] = int(np / grpsize)
699 if np % grpsize > 0: 700 if np % grpsize > 0:
700 pageinfo['numgroups'] += 1 701 pageinfo['numgroups'] += 1
701 pageinfo['viewMode'] = viewMode 702 pageinfo['viewMode'] = viewMode
702 pageinfo['tocMode'] = tocMode 703 pageinfo['tocMode'] = tocMode
704 pageinfo['characterNormalization'] =characterNormalization
703 pageinfo['query'] = self.REQUEST.get('query',' ') 705 pageinfo['query'] = self.REQUEST.get('query',' ')
704 pageinfo['queryType'] = self.REQUEST.get('queryType',' ') 706 pageinfo['queryType'] = self.REQUEST.get('queryType',' ')
705 pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext') 707 pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext')
706 pageinfo['textPN'] = self.REQUEST.get('textPN','1') 708 pageinfo['textPN'] = self.REQUEST.get('textPN','1')
707 pageinfo['highlightQuery'] = self.REQUEST.get('highlightQuery','') 709 pageinfo['highlightQuery'] = self.REQUEST.get('highlightQuery','')