changeset 307:ec5e920a61e6

*** empty log message ***
author abukhman
date Fri, 15 Oct 2010 11:58:12 +0200
parents ec293c61f8a9
children bc7c8021a83d
files MpdlXmlTextServer.py documentViewer.py
diffstat 2 files changed, 27 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Thu Oct 14 17:01:20 2010 +0200
+++ b/MpdlXmlTextServer.py	Fri Oct 15 11:58:12 2010 +0200
@@ -156,12 +156,28 @@
             hrefNode= l.getAttributeNodeNS(None, u"id")
             href= hrefNode.nodeValue
             hrefList.append(href)
+            myList = ",".join(hrefList)                            
+        return myList
+    
+    
+    def getAllGisPlaces (self, docinfo=None, pageinfo=None):
+        """Show all Gis Places of whole Book """
+        xpath ='//echo:place'
+        docpath =docinfo['textURLPath']
+        url = docinfo['url']
+        selfurl =self.absolute_url()
+        pn =pageinfo['current']
+        hrefList=[]
+        myList=""
+        text=self.getServerData("xpath.xql", "document=%s&xpath=%s"%(docinfo['textURLPath'],xpath))
+        dom =Parse(text)
+        result = dom.xpath("//result/resultPage/place")
+        for l in result:
+            hrefNode = l.getAttributeNodeNS(None, u"id")
+            href= hrefNode.nodeValue
+            hrefList.append(href)
             myList = ",".join(hrefList)
-            #hoho =hrefList.replace('','')
-            #probe =href.replace('chinagis_REST/REST/db/chgis/mpdl','chinagis/REST/db/mpdl/%s'%name)
-            #l.setAttributeNS(None, 'target', '_blank')
-        logging.debug("getGisPlaces :%s"%(myList))                             
-        return myList
+    return myList 
     
     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"""
--- a/documentViewer.py	Thu Oct 14 17:01:20 2010 +0200
+++ b/documentViewer.py	Fri Oct 15 11:58:12 2010 +0200
@@ -187,9 +187,13 @@
         return self.template.fulltextclient.getSearch(**args)
     
     def getGisPlaces(self, **args):
-        """get search"""
+        """get gis places"""
         return self.template.fulltextclient.getGisPlaces(**args)
-
+ 
+    def getAllGisPlaces(self, **args):
+        """get all gis places"""
+        return self.template.fulltextclient.getGisPlaces(**args)
+ 
     def getNumPages(self, docinfo):
         """get numpages"""
         return self.template.fulltextclient.getNumPages(docinfo)