Changeset 615:d6eca930a534 in documentViewer for documentViewer.py
- Timestamp:
- Jul 21, 2014, 10:53:42 AM (10 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentViewer.py
r613 r615 83 83 # viewMode templates 84 84 viewer_text = PageTemplateFile('zpt/viewer/viewer_text', globals()) 85 viewer_hocr = PageTemplateFile('zpt/viewer/viewer_hocr', globals()) 85 86 viewer_xml = PageTemplateFile('zpt/viewer/viewer_xml', globals()) 86 87 viewer_image = PageTemplateFile('zpt/viewer/viewer_image', globals()) … … 165 166 def getTextPage(self, **args): 166 167 """returns full text content of page""" 168 167 169 return self.template.fulltextclient.getTextPage(**args) 170 171 172 168 173 169 174 def getSearchResults(self, **args): … … 240 245 @param url: url which contains display information 241 246 @param mode: defines how to access the document behind url 242 @param viewMode: 'image': display images, 'text': display text, 'xml': display xml, default is 'auto' 247 @param viewMode: 'image': display images, 'text': display text, 'xml': display xml, default is 'auto', 'hocr' : hocr format 243 248 @param viewLayer: sub-type of viewMode, e.g. layer 'dict' for viewMode='text' 244 249 @param tocMode: type of 'table of contents' for navigation (thumbs, text, figures, none) … … 288 293 viewMode = 'image' 289 294 self.REQUEST['viewMode'] = 'image' 295 296 297 290 298 291 299 # safe viewLayer in userinfo … … 533 541 metaDom = self.metadataService.getDomFromPathOrUrl(docUrl) 534 542 docinfo['imagePath'] = url.replace('/mpiwg/online', '', 1) 543 544 elif mode=="hocr": 545 # url points to folder with images, index.meta optional 546 # asssume index.meta in parent dir 547 docUrl = getParentPath(url) 548 metaDom = self.metadataService.getDomFromPathOrUrl(docUrl) 549 docinfo['imagePath'] = url.replace('/mpiwg/online', '', 1) 550 docinfo['textURLPath'] = url.replace('/mpiwg/online', '', 1) 551 if docinfo.get("creator", None) is None: 552 docinfo['creator'] = "" 553 554 if docinfo.get("title", None) is None: 555 docinfo['title'] = "" 556 557 if docinfo.get("documentPath", None) is None: 558 docinfo['documentPath'] = url.replace('/mpiwg/online', '', 1) 559 docinfo['documentPath'] = url.replace('/pages', '', 1) 535 560 536 561 elif mode=="filepath":
Note: See TracChangeset
for help on using the changeset viewer.