changeset 175:d1c13a6ba20d

gis ?nderung
author abukhman
date Tue, 21 Sep 2010 12:21:33 +0200
parents 5780092e4989
children 0c6df37adcd1
files MpdlXmlTextServer.py
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Wed Sep 01 15:25:38 2010 +0200
+++ b/MpdlXmlTextServer.py	Tue Sep 21 12:21:33 2010 +0200
@@ -178,6 +178,13 @@
               pagedivs = pagedom.xpath("/div")
               if len(pagedivs) > 0:
                   pagenode = pagedivs[0]
+                  links =pagenode.xpath("//a")
+                  for l in links:
+                      hrefNode =l.getAttributeNodeNS(None, u"href")
+                      if hrefNode:
+                          href=hrefNode.nodeValue
+                          if href.startswith('http://chinagis.mpiwg-berlin.mpg.de'):
+                              hrefNode.nodeValue =href.replace('chinagis_REST','chinagis')
                   return serializeNode(pagenode)
                     
         if mode == "pureXml":
@@ -237,6 +244,20 @@
         #pagexml=self.template.fulltextclient.eval("/mpdl/interface/lt/lemma.xql","document=&language="+str(language)+"&lemma="+url_quote(str(query)))
         return data
 
+    def getGis (self, mode="gis", pn=1, pageinfo=None, docinfo=None):
+        docpath = docinfo['textURLPath']
+        path = docinfo['textURLPath']       
+        pagesize = pageinfo['tocPageSize']
+        pn = pageinfo['tocPN']
+        url = docinfo['url']
+        selfurl = self.absolute_url()  
+        viewMode=  pageinfo['viewMode']
+        tocMode = pageinfo['tocMode']
+        tocPN = pageinfo['tocPN']  
+        data = self.getServerData("doc-query.xql","document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s"%(docpath,queryType, pagesize, pn))
+        page =data.replace("http://chinagis.mpiwg-berlin.mpg.de/chinagis_REST/REST/","http://chinagis.mpiwg-berlin.mpg.de/chinagis/REST/")      
+        return page
+    
     def getQuery (self,  docinfo=None, pageinfo=None, query=None, queryType=None, pn=1):
          """number of"""
          docpath = docinfo['textURLPath']