# HG changeset patch # User casties # Date 1345486436 -7200 # Node ID c4cc01b104d72bb9ee12657c4a5c00e83fb93d4c # Parent 4b43a57ad9b3155e9a4df51c32add55bedfed487 better metadata display for index page. diff -r 4b43a57ad9b3 -r c4cc01b104d7 documentViewer.py --- a/documentViewer.py Thu Aug 16 19:09:49 2012 +0200 +++ b/documentViewer.py Mon Aug 20 20:13:56 2012 +0200 @@ -18,6 +18,8 @@ import string import json +from Products.MetaDataProvider import MetaDataFolder + from SrvTxtUtils import getInt, utf8ify, getText, getHttpData, refreshingImageFileIndexHtml def serializeNode(node, encoding="utf-8"): @@ -553,7 +555,14 @@ # bib info bib = self.metadataService.getBibData(dom=metaDom) if bib: - docinfo = self.getDocinfoFromBib(docinfo, bib) + # save extended version as 'bibx' + bibx = self.metadataService.getBibData(dom=metaDom, all=True, recursive=1) + if len(bibx) == 1: + # unwrap list if possible + bibx = bibx[0] + + docinfo['bibx'] = bibx + docinfo = self.getDocinfoFromBib(docinfo, bib, bibx) else: # no bib - try info.xml docinfo = self.getDocinfoFromPresentationInfoXml(docinfo) @@ -667,8 +676,8 @@ # odd pages are left docinfo['oddPage'] = texttool.get('odd-scan-position', 'left') - # number of title page (0: not defined) - docinfo['titlePage'] = texttool.get('title-scan-no', 0) + # number of title page (default 1) + docinfo['titlePage'] = texttool.get('title-scan-no', 1) # old presentation stuff presentation = texttool.get('presentation', None) @@ -680,7 +689,7 @@ return docinfo - def getDocinfoFromBib(self, docinfo, bib): + def getDocinfoFromBib(self, docinfo, bib, bibx=None): """reads contents of bib element into docinfo""" logging.debug("getDocinfoFromBib bib=%s"%repr(bib)) # put all raw bib fields in dict "bib" diff -r 4b43a57ad9b3 -r c4cc01b104d7 zpt/viewer_index.zpt --- a/zpt/viewer_index.zpt Thu Aug 16 19:09:49 2012 +0200 +++ b/zpt/viewer_index.zpt Mon Aug 20 20:13:56 2012 +0200 @@ -32,7 +32,7 @@