Mercurial > hg > documentViewer
comparison documentViewer.py @ 169:21ac9164eedf
characterNormalization
author | abukhman |
---|---|
date | Tue, 24 Aug 2010 15:15:59 +0200 |
parents | 7e2b97941a66 |
children | caf66e1fccd3 |
comparison
equal
deleted
inserted
replaced
168:6f31a7c37914 | 169:21ac9164eedf |
---|---|
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) |
257 if docinfo.has_key('textURL') or docinfo.has_key('textURLPath'): #texturl gesetzt und textViewer konfiguriert | 257 if docinfo.has_key('textURL') or docinfo.has_key('textURLPath'): #texturl gesetzt und textViewer konfiguriert |
258 viewMode="text_dict" | 258 viewMode="text_dict" |
259 else: | 259 else: |
260 viewMode="images" | 260 viewMode="images" |
261 | 261 |
262 pageinfo = self.getPageinfo(start=start,current=pn,docinfo=docinfo,viewMode=viewMode,tocMode=tocMode) | 262 pageinfo = self.getPageinfo(start=start,current=pn,docinfo=docinfo,viewMode=viewMode,tocMode=tocMode,characterNormalization=characterNormalization) |
263 | 263 |
264 pt = getattr(self.template, 'viewer_main') | 264 pt = getattr(self.template, 'viewer_main') |
265 return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode,mk=self.generateMarks(mk)) | 265 return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode,mk=self.generateMarks(mk)) |
266 | 266 |
267 def generateMarks(self,mk): | 267 def generateMarks(self,mk): |
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): | 681 def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None,characterNormalization=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'] = self.REQUEST.get('characterNormalization',' ') | 704 pageinfo['characterNormalization'] =characterNormalization |
705 #pageinfo['characterNormalization'] = self.REQUEST.get('characterNormalization',' ') | |
705 pageinfo['query'] = self.REQUEST.get('query',' ') | 706 pageinfo['query'] = self.REQUEST.get('query',' ') |
706 pageinfo['queryType'] = self.REQUEST.get('queryType',' ') | 707 pageinfo['queryType'] = self.REQUEST.get('queryType',' ') |
707 pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext') | 708 pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext') |
708 pageinfo['textPN'] = self.REQUEST.get('textPN','1') | 709 pageinfo['textPN'] = self.REQUEST.get('textPN','1') |
709 pageinfo['highlightQuery'] = self.REQUEST.get('highlightQuery','') | 710 pageinfo['highlightQuery'] = self.REQUEST.get('highlightQuery','') |