changeset 411:691f0c341b33

*** empty log message ***
author abukhman
date Mon, 06 Dec 2010 11:41:55 +0100
parents 13dd83f46f6f
children 759ed7577eef
files MpdlXmlTextServer.py
diffstat 1 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Mon Dec 06 11:39:43 2010 +0100
+++ b/MpdlXmlTextServer.py	Mon Dec 06 11:41:55 2010 +0100
@@ -214,13 +214,27 @@
         text = self.getServerData("page-fragment.xql","document=%s&mode=%s&pn=%s"%(docinfo['textURLPath'], 'text',  pn))
         dom =Parse(text)
         pagedivs = dom.xpath("//div[@class='pageNumberOrig']")
-        logging.debug("YYYYYYpagedivs :%s"%(pagedivs))
         if len(pagedivs)>0:
             originalPage= getTextFromNode(pagedivs[0])
             #return docinfo['originalPage']
             return originalPage
     
-    
+    def getAllPlaces (self, docinfo=None, pageinfo=None):
+        """Show all Places if no places than 0"""
+        docpath = docinfo['textURLPath'] 
+        selfurl = self.absolute_url()   
+        viewMode=  pageinfo['viewMode']
+        text = self.getServerData("page-fragment.xql","document=%s&mode=%s"%(docinfo['textURLPath'], 'text'))
+        dom =Parse(text)
+        pagedivs = dom.xpath("//div[@class='countPlaces']")
+        logging.debug ("pagedivs=%s"%(pagedivs))
+        #originalPage= getTextFromNode(pagedivs[0])
+        #return allPlaces
+        if len(pagedivs)>0:
+            originalPage= getTextFromNode(pagedivs[0])
+            #return docinfo['originalPage']
+            return originalPage
+           
     def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization="regPlusNorm", highlightQuery=None, sn=None, optionToggle=None):
         """returns single page from fulltext"""
         docpath = docinfo['textURLPath']