changeset 190:c92e6b923913

*** empty log message ***
author abukhman
date Tue, 05 Oct 2010 11:20:51 +0200
parents 9794ccda39de
children cffaec9bc5ad
files MpdlXmlTextServer.py
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Mon Sep 27 14:59:40 2010 +0200
+++ b/MpdlXmlTextServer.py	Tue Oct 05 11:20:51 2010 +0200
@@ -122,13 +122,21 @@
         """get list of pages from fulltext and put in docinfo"""
         if 'numPages' in docinfo:
             # already there
-            return docinfo
-        
+            return docinfo        
         xquery = '//pb'
         text = self.getServerData("xquery.xql","document=%s&xquery=%s"%(docinfo['textURLPath'],xquery))
-        #text = self.template.fulltextclient.eval("/mpdl/interface/xquery.xql", "document=%s&xquery=%s"%(docinfo['textURLPath'],xquery))
         docinfo['numPages'] = text.count("<pb ")
         return docinfo
+     
+    def getNumTextPages (self, docinfo):
+        """get list of pages from fulltext (texts without images) and put in docinfo"""
+        if 'numPages' in docinfo:
+            # allredy there
+            return docinfo
+        xpath ='/count(//pb)'
+        text=self.getServerData("xpath.xql", "document=%sxpath=%s"%(docinfo['textURLPath'], xpath))
+        docinfo['numPages']=text.xpath
+        return docinfo
        
     def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, highlightQuery=None,sn=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization=""):
         """returns single page from fulltext"""