Changeset 548:7acc919f52ff in documentViewer
- Timestamp:
- Aug 31, 2012, 1:55:45 PM (12 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentViewer.py
r546 r548 222 222 return self.template.fulltextclient.getPlacesOnPage(**args) 223 223 224 # WTF?224 # Thumb list for CoolIris Plugin 225 225 thumbs_main_rss = PageTemplateFile('zpt/thumbs_main_rss', globals()) 226 226 security.declareProtected('View','thumbs_rss') … … 233 233 234 234 ''' 235 logging.debug("HHHHHHHHHHHHHH:load the rss")236 logging.debug("documentViewer (index) mode: %s url:%s start:%s pn:%s"%(mode,url,start,pn))237 235 238 236 if not hasattr(self, 'template'): … … 259 257 260 258 security.declareProtected('View','index_html') 261 def index_html(self,url,mode="texttool",viewMode="auto",viewLayer=None,tocMode= "thumbs",start=1,pn=1):259 def index_html(self,url,mode="texttool",viewMode="auto",viewLayer=None,tocMode=None,start=1,pn=1): 262 260 """ 263 261 show page … … 278 276 if not getattr(self, 'digilibBaseUrl', None): 279 277 self.digilibBaseUrl = self.findDigilibUrl() or "http://digilib.mpiwg-berlin.mpg.de/digitallibrary" 278 279 # mode=filepath should not have toc-thumbs 280 if tocMode is None: 281 if mode == "filepath": 282 tocMode = "none" 283 else: 284 tocMode = "thumbs" 280 285 281 286 # docinfo: information about document (cached) … … 303 308 # safe viewLayer in userinfo 304 309 userinfo['viewLayer'] = viewLayer 305 310 306 311 # pageinfo: information about page (not cached) 307 312 pageinfo = self.getPageinfo(start=start, current=pn, docinfo=docinfo, userinfo=userinfo, viewMode=viewMode, viewLayer=viewLayer, tocMode=tocMode) … … 540 545 elif mode=="filepath": 541 546 # url points to image file, index.meta optional 547 docinfo['imagePath'] = url 548 docinfo['imageURL'] = self.digilibBaseUrl + "/servlet/Scaler?fn=" + url 549 docinfo['numPages'] = 1 542 550 # asssume index.meta is two path segments up 543 551 docUrl = getParentPath(url, 2) … … 567 575 bib = self.metadataService.getBibData(dom=metaDom) 568 576 if bib: 569 # save extended version as 'bibx' 577 # save extended version as 'bibx' TODO: ugly 570 578 bibx = self.metadataService.getBibData(dom=metaDom, all=True, recursive=1) 571 579 if len(bibx) == 1: … … 607 615 docinfo['imagePath'] = url.replace('/mpiwg/online/', '', 1) 608 616 609 # number of images from digilib 610 if docinfo.get('imagePath', None): 611 docinfo['imageURL'] = self.digilibBaseUrl + "/servlet/Scaler?fn=" + docinfo['imagePath'] 612 docinfo = self.getDocinfoFromDigilib(docinfo, docinfo['imagePath']) 613 else: 614 # imagePath still missing? try "./pageimg" 615 imgPath = os.path.join(docUrl, 'pageimg') 616 docinfo = self.getDocinfoFromDigilib(docinfo, imgPath) 617 if docinfo.get('numPages', 0) > 0: 618 # there are pages 619 docinfo['imagePath'] = imgPath 617 # check numPages 618 if docinfo.get('numPages', 0) == 0: 619 # number of images from digilib 620 if docinfo.get('imagePath', None): 620 621 docinfo['imageURL'] = self.digilibBaseUrl + "/servlet/Scaler?fn=" + docinfo['imagePath'] 622 docinfo = self.getDocinfoFromDigilib(docinfo, docinfo['imagePath']) 623 else: 624 # imagePath still missing? try "./pageimg" 625 imgPath = os.path.join(docUrl, 'pageimg') 626 docinfo = self.getDocinfoFromDigilib(docinfo, imgPath) 627 if docinfo.get('numPages', 0) > 0: 628 # there are pages 629 docinfo['imagePath'] = imgPath 630 docinfo['imageURL'] = self.digilibBaseUrl + "/servlet/Scaler?fn=" + docinfo['imagePath'] 621 631 622 632 # check numPages
Note: See TracChangeset
for help on using the changeset viewer.