--- documentViewer/MpdlXmlTextServer.py 2010/10/05 12:56:02 1.55 +++ documentViewer/MpdlXmlTextServer.py 2010/10/05 14:58:34 1.56 @@ -130,18 +130,15 @@ class MpdlXmlTextServer(SimpleItem): def getNumTextPages (self, docinfo): """get list of pages from fulltext (texts without images) and put in docinfo""" - # if 'numPages' in docinfo: + if 'numPages' in docinfo: # allredy there - # return docinfo - # xpath ='/count(//pb)' - # text=self.getServerData("xpath.xql", "document=%s&xpath=%s"%(docinfo['textURLPath'], xpath)) - # logging.debug("documentViewer (text) text: %s"%(text)) - #docinfo['numPages']=text('resultPage') - # dom = Parse(text) - - # result= dom.xpath("//result/resultPage") - # docinfo['numPages']=int(getTextFromNode(result[0])) - #logging.debug("documentViewer (characterNormalization) docinfo['numPages']: %s"%(docinfo['numPages'])) + return docinfo + xpath ='/count(//pb)' + text=self.getServerData("xpath.xql", "document=%s&xpath=%s"%(docinfo['textURLPath'], xpath)) + docinfo['numPages']=text('resultPage') + dom = Parse(text) + result= dom.xpath("//result/resultPage") + docinfo['numPages']=int(getTextFromNode(result[0])) return docinfo def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, highlightQuery=None,sn=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization=""):