changeset 205:1fc7d73ce7ce

*** empty log message ***
author abukhman
date Tue, 05 Oct 2010 16:58:34 +0200
parents ab1ab4ad4b65
children 944c44b469e4
files MpdlXmlTextServer.py documentViewer.py
diffstat 2 files changed, 9 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Tue Oct 05 14:56:02 2010 +0200
+++ b/MpdlXmlTextServer.py	Tue Oct 05 16:58:34 2010 +0200
@@ -130,18 +130,15 @@
      
     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=""):
--- a/documentViewer.py	Tue Oct 05 14:56:02 2010 +0200
+++ b/documentViewer.py	Tue Oct 05 16:58:34 2010 +0200
@@ -615,7 +615,7 @@
             docinfo['textURLPath'] = textUrl
             if not docinfo['imagePath']:
                 # text-only, no page images
-                docinfo = self.getNumPages(docinfo)
+                docinfo = self.getNumTextPages(docinfo)
          
         presentationUrls = dom.xpath("//texttool/presentation")
         docinfo = self.getBibinfoFromIndexMeta(url, docinfo=docinfo, dom=dom)   # get info von bib tag