Changeset 471:415a7026eeda in documentViewer
- Timestamp:
- Aug 4, 2011, 2:57:02 PM (13 years ago)
- Branch:
- elementtree
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
MpdlXmlTextServer.py
r469 r471 1 2 1 from OFS.SimpleItem import SimpleItem 3 2 from Products.PageTemplates.PageTemplateFile import PageTemplateFile … … 270 269 271 270 272 def getTextPage(self, mode="text _dict", pn=1, docinfo=None, pageinfo=None):271 def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None): 273 272 """returns single page from fulltext""" 274 273 logging.debug("getTextPage mode=%s, pn=%s"%(mode,pn)) … … 293 292 selfurl = docinfo['viewerUrl'] 294 293 295 if mode == " text_dict":294 if mode == "dict": 296 295 # text_dict is called textPollux in the backend 297 296 textmode = "textPollux" 297 elif not mode: 298 # default is text 299 textmode = "text" 298 300 else: 299 301 textmode = mode -
documentViewer.py
r469 r471 267 267 268 268 security.declareProtected('View','index_html') 269 def index_html(self,url,mode="texttool",viewMode="auto", tocMode="thumbs",start=None,pn=1,mk=None):269 def index_html(self,url,mode="texttool",viewMode="auto",viewTYpe=None,tocMode="thumbs"): 270 270 """ 271 view it 271 view page 272 @param url: url which contains display information 272 273 @param mode: defines how to access the document behind url 273 @param url: url which contains display information274 @param view Mode: if images display images, if text display text, default is auto (text,images or auto)274 @param viewMode: 'images': display images, 'text': display text, default is 'auto' 275 @param viewType: sub-type of viewMode, e.g. 'dict' for viewMode='text' 275 276 @param tocMode: type of 'table of contents' for navigation (thumbs, text, figures, none) 276 277 """ … … 292 293 docinfo = self.getToc(mode=tocMode, docinfo=docinfo) 293 294 294 # auto viewMode: text _dict iftext else images295 # auto viewMode: text if there is a text else images 295 296 if viewMode=="auto": 296 297 if docinfo.get('textURL', None) or docinfo.get('textURLPath', None): 297 viewMode="text_dict" 298 viewMode = "text" 299 viewType = "dict" 298 300 else: 299 viewMode ="images"301 viewMode = "images" 300 302 301 pageinfo = self.getPageinfo(start=start, current=pn, docinfo=docinfo, viewMode=viewMode, tocMode=tocMode)303 pageinfo = self.getPageinfo(start=start, current=pn, docinfo=docinfo, viewMode=viewMode, viweType=viewType, tocMode=tocMode) 302 304 303 305 # get template /template/viewer_main 304 306 pt = getattr(self.template, 'viewer_main') 305 307 # and execute with parameters 306 return pt(docinfo=docinfo, pageinfo=pageinfo , viewMode=viewMode, mk=self.generateMarks(mk))308 return pt(docinfo=docinfo, pageinfo=pageinfo) 307 309 308 310 def generateMarks(self,mk): … … 665 667 666 668 667 def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None):669 def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, viewType=None, tocMode=None): 668 670 """returns pageinfo with the given parameters""" 669 671 pageinfo = {} 672 pageinfo['viewMode'] = viewMode 673 pageinfo['viewType'] = viewType 674 pageinfo['tocMode'] = tocMode 675 670 676 current = getInt(current) 671 677 pageinfo['current'] = current … … 688 694 if docinfo.get('textURLPath', None): 689 695 # cache text page as well 690 pageinfo['textPage'] = self.getTextPage(mode=view Mode, pn=pn, docinfo=docinfo, pageinfo=pageinfo)696 pageinfo['textPage'] = self.getTextPage(mode=viewType, pn=pn, docinfo=docinfo, pageinfo=pageinfo) 691 697 np = int(docinfo.get('numPages', 0)) 692 698 … … 696 702 pageinfo['numgroups'] += 1 697 703 698 pageinfo['viewMode'] = viewMode699 pageinfo['tocMode'] = tocMode700 704 pageinfo['characterNormalization'] = self.REQUEST.get('characterNormalization','reg') 701 #pageinfo['optionToggle'] = self.REQUEST.get('optionToggle','1')702 705 pageinfo['query'] = self.REQUEST.get('query','') 703 706 pageinfo['queryType'] = self.REQUEST.get('queryType','') … … 709 712 # WTF?: 710 713 toc = int(pageinfo['tocPN']) 711 pageinfo['textPages'] = int(toc)714 pageinfo['textPages'] = int(toc) 712 715 713 716 # What does this do?
Note: See TracChangeset
for help on using the changeset viewer.