Mercurial > hg > documentViewer
comparison documentViewer.py @ 142:83e35adb92d3
characterNormalization (reg,norm, none)
author | abukhman |
---|---|
date | Thu, 12 Aug 2010 12:26:07 +0200 |
parents | 39c7d6164da8 |
children | 070b61f32519 |
comparison
equal
deleted
inserted
replaced
141:39c7d6164da8 | 142:83e35adb92d3 |
---|---|
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, characterNormalization=None): | 229 def index_html(self,url,mode="texttool",viewMode="auto",tocMode="thumbs",start=None,pn=1,mk=None, query=None, querySearch=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) |
676 | 676 |
677 logging.debug("documentViewer (getdocinfo) docinfo: %s"%docinfo) | 677 logging.debug("documentViewer (getdocinfo) docinfo: %s"%docinfo) |
678 self.REQUEST.SESSION['docinfo'] = docinfo | 678 self.REQUEST.SESSION['docinfo'] = docinfo |
679 return docinfo | 679 return docinfo |
680 | 680 |
681 def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None, characterNormalization=None): | 681 def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None): |
682 """returns pageinfo with the given parameters""" | 682 """returns pageinfo with the given parameters""" |
683 pageinfo = {} | 683 pageinfo = {} |
684 current = getInt(current) | 684 current = getInt(current) |
685 pageinfo['current'] = current | 685 pageinfo['current'] = current |
686 rows = int(rows or self.thumbrows) | 686 rows = int(rows or self.thumbrows) |
699 pageinfo['numgroups'] = int(np / grpsize) | 699 pageinfo['numgroups'] = int(np / grpsize) |
700 if np % grpsize > 0: | 700 if np % grpsize > 0: |
701 pageinfo['numgroups'] += 1 | 701 pageinfo['numgroups'] += 1 |
702 pageinfo['viewMode'] = viewMode | 702 pageinfo['viewMode'] = viewMode |
703 pageinfo['tocMode'] = tocMode | 703 pageinfo['tocMode'] = tocMode |
704 pageinfo['characterNormalization'] =characterNormalization | 704 pageinfo['characterNormalization'] = self.REQUEST.get ('characterNormalization', '') |
705 pageinfo['query'] = self.REQUEST.get('query',' ') | 705 pageinfo['query'] = self.REQUEST.get('query',' ') |
706 pageinfo['queryType'] = self.REQUEST.get('queryType',' ') | 706 pageinfo['queryType'] = self.REQUEST.get('queryType',' ') |
707 pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext') | 707 pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext') |
708 pageinfo['textPN'] = self.REQUEST.get('textPN','1') | 708 pageinfo['textPN'] = self.REQUEST.get('textPN','1') |
709 pageinfo['highlightQuery'] = self.REQUEST.get('highlightQuery','') | 709 pageinfo['highlightQuery'] = self.REQUEST.get('highlightQuery','') |