Mercurial > hg > documentViewer
diff MpiwgXmlTextServer.py @ 577:9251719154a3
toc with list of handwritten notes.
author | casties |
---|---|
date | Thu, 18 Oct 2012 17:53:09 +0200 |
parents | b2c7e272e075 |
children | fc861a6cef17 |
line wrap: on
line diff
--- a/MpiwgXmlTextServer.py Wed Oct 17 16:36:13 2012 +0200 +++ b/MpiwgXmlTextServer.py Thu Oct 18 17:53:09 2012 +0200 @@ -159,7 +159,6 @@ pages[pn] = page docinfo['pageNumbers'] = pages - logging.debug("got pageNumbers=%s"%repr(pages)) # toc elif lt == 'toc' or lt == 'figures' or lt == 'handwritten': @@ -295,6 +294,11 @@ if punditMode: self._addPunditAttributes(pagediv, pageinfo, docinfo) + + # TODO: move empty page text + ep = dom.find(".//div[@class='emptyPage']") + if ep is not None: + pagediv.append(ep) s = serialize(pagediv) logging.debug("getTextPage done in %s"%(datetime.now()-startTime)) @@ -544,18 +548,11 @@ if start is None: start = (pn - 1) * size - #fullresult = ET.fromstring(resultxml) - #fullresult = resultxml - #logging.debug("resultxml=%s"%repr(resultxml)) - if resultxml is not None: # paginate first = start-1 last = first+size tocdivs = resultxml[first:last] - #del fullresult[:first] - #del fullresult[len:] - #tocdivs = fullresult toc = ET.Element('div', attrib={'class':'queryResultPage'}) for div in tocdivs: @@ -620,6 +617,7 @@ last = first + size tocs = fulltoc[first:last] tp = '<div>' + label = {'figures': 'Figure', 'handwritten': 'Handwritten note'}.get(mode, 'Item') for toc in tocs: pageurl = self.getLink('pn', toc['pn']) tp += '<div class="tocline">' @@ -627,7 +625,7 @@ if content: tp += '<div class="toc name">[%s] %s</div>'%(toc['level-string'], toc['content']) else: - tp += '<div class="toc name">[Figure %s]</div>'%(toc['level-string']) + tp += '<div class="toc name">[%s %s]</div>'%(label, toc['level-string']) if toc.get('no', None): tp += '<div class="toc page"><a href="%s">Page: %s (%s)</a></div>'%(pageurl, toc['pn'], toc['no']) @@ -658,8 +656,7 @@ return pt() def manage_addMpiwgXmlTextServer(self,id,title="",serverUrl="http://mpdl-text.mpiwg-berlin.mpg.de/mpdl/interface/",timeout=40,RESPONSE=None): -#def manage_addMpiwgXmlTextServer(self,id,title="",serverUrl="http://mpdl-text.mpiwg-berlin.mpg.de:30030/mpdl/interface/",timeout=40,RESPONSE=None): - """add zogiimage""" + """add MpiwgXmlTextServer""" newObj = MpiwgXmlTextServer(id=id,title=title,serverUrl=serverUrl,timeout=timeout) self.Destination()._setObject(id, newObj) if RESPONSE is not None: