Mercurial > hg > documentViewer
comparison documentViewer.py @ 341:602408d7b035
*** empty log message ***
author | abukhman |
---|---|
date | Mon, 18 Oct 2010 12:15:40 +0200 |
parents | 6b07f4a0bf34 |
children | 259660db1921 |
comparison
equal
deleted
inserted
replaced
340:6b07f4a0bf34 | 341:602408d7b035 |
---|---|
266 @param tocMode: type of 'table of contents' for navigation (thumbs, text, figures, none) | 266 @param tocMode: type of 'table of contents' for navigation (thumbs, text, figures, none) |
267 @param characterNormalization type of text display (reg, norm, none) | 267 @param characterNormalization type of text display (reg, norm, none) |
268 @param querySearch: type of different search modes (fulltext, fulltextMorph, xpath, xquery, ftIndex, ftIndexMorph, fulltextMorphLemma) | 268 @param querySearch: type of different search modes (fulltext, fulltextMorph, xpath, xquery, ftIndex, ftIndexMorph, fulltextMorphLemma) |
269 ''' | 269 ''' |
270 | 270 |
271 logging.debug("documentViewer (index) mode: %s url:%s start:%s pn:%s"%(mode,url,start,pn)) | 271 logging.debug("documentViewer (index) mode: %s url:%s start:%s pn:%s"%(mode,url,start,pn,originalPage)) |
272 | 272 |
273 if not hasattr(self, 'template'): | 273 if not hasattr(self, 'template'): |
274 # this won't work | 274 # this won't work |
275 logging.error("template folder missing!") | 275 logging.error("template folder missing!") |
276 return "ERROR: template folder missing!" | 276 return "ERROR: template folder missing!" |
741 else: | 741 else: |
742 logging.error("documentViewer (getdocinfo) unknown mode: %s!"%mode) | 742 logging.error("documentViewer (getdocinfo) unknown mode: %s!"%mode) |
743 raise ValueError("Unknown mode %s! Has to be one of 'texttool','imagepath','filepath'."%(mode)) | 743 raise ValueError("Unknown mode %s! Has to be one of 'texttool','imagepath','filepath'."%(mode)) |
744 | 744 |
745 logging.debug("documentViewer (getdocinfo) docinfo: %s"%docinfo) | 745 logging.debug("documentViewer (getdocinfo) docinfo: %s"%docinfo) |
746 logging.debug("originalPage: %s"%originalPage) | 746 |
747 self.REQUEST.SESSION['docinfo'] = docinfo | 747 self.REQUEST.SESSION['docinfo'] = docinfo |
748 return docinfo | 748 return docinfo |
749 | 749 |
750 def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None,characterNormalization="", originalPage=None): | 750 def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None,characterNormalization="", originalPage=None): |
751 """returns pageinfo with the given parameters""" | 751 """returns pageinfo with the given parameters""" |
783 pageinfo['queryPageSize'] =self.REQUEST.get('queryPageSize', '10') | 783 pageinfo['queryPageSize'] =self.REQUEST.get('queryPageSize', '10') |
784 pageinfo['tocPN'] = self.REQUEST.get('tocPN', '1') | 784 pageinfo['tocPN'] = self.REQUEST.get('tocPN', '1') |
785 toc = int (pageinfo['tocPN']) | 785 toc = int (pageinfo['tocPN']) |
786 pageinfo['textPages'] =int (toc) | 786 pageinfo['textPages'] =int (toc) |
787 | 787 |
788 | 788 logging.debug("originalPage: %s"%originalPage) |
789 | 789 |
790 if 'tocSize_%s'%tocMode in docinfo: | 790 if 'tocSize_%s'%tocMode in docinfo: |
791 tocSize = int(docinfo['tocSize_%s'%tocMode]) | 791 tocSize = int(docinfo['tocSize_%s'%tocMode]) |
792 tocPageSize = int(pageinfo['tocPageSize']) | 792 tocPageSize = int(pageinfo['tocPageSize']) |
793 # cached toc | 793 # cached toc |