changeset 207:0f6a377679d5

*** empty log message ***
author abukhman
date Fri, 08 Oct 2010 13:58:15 +0200
parents 944c44b469e4
children 0882bad5ac48
files MpdlXmlTextServer.py
diffstat 1 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Tue Oct 05 17:01:06 2010 +0200
+++ b/MpdlXmlTextServer.py	Fri Oct 08 13:58:15 2010 +0200
@@ -118,8 +118,8 @@
                 return serializeNode(pagenode)      
         return "no text here"   
                        
-    def getNumPages(self, docinfo):
-        """get list of pages from fulltext and put in docinfo"""
+    """def getNumPages(self, docinfo):
+        ""get list of pages from fulltext and put in docinfo""
         if 'numPages' in docinfo:
             # already there
             return docinfo        
@@ -127,7 +127,7 @@
         text = self.getServerData("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:
@@ -139,7 +139,16 @@
         result= dom.xpath("//result/resultPage")
         docinfo['numPages']=int(getTextFromNode(result[0]))
         return docinfo
-       
+    
+    def getGisPlases(self, docinfo):
+        """ Show all Gis Places of whole Page"""
+        xpath='//place'
+        text=self.getServerData("xpath.xql", "document=%s&xpath=%s"%(docinfo['textURLPath'], xpath))
+        pagedom = Parse(text)
+        result =pagedom.xpath("//result/resultPage/place")
+        docinfo['place']=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=""):
         """returns single page from fulltext"""
         docpath = docinfo['textURLPath']
@@ -195,6 +204,7 @@
                           href=hrefNode.nodeValue
                           if href.startswith('http://chinagis.mpiwg-berlin.mpg.de'):
                               hrefNode.nodeValue =href.replace('chinagis_REST','chinagis')
+                              hrefNode.nodeValue=href.replace('chgis','')
                               l.setAttributeNS(None, 'target', '_blank')
                   return serializeNode(pagenode)