Diff for /documentViewer/MpdlXmlTextServer.py between versions 1.74 and 1.82

version 1.74, 2010/10/11 14:04:21 version 1.82, 2010/10/11 15:49:43
Line 143  class MpdlXmlTextServer(SimpleItem): Line 143  class MpdlXmlTextServer(SimpleItem):
     def getGisPlases(self, docinfo):      def getGisPlases(self, docinfo):
         """ Show all Gis Places of whole Page"""          """ Show all Gis Places of whole Page"""
         xpath='//place'          xpath='//place'
         text=self.getServerData("xpath.xql", "document=%s&xpath=%s"%(docinfo['textURLPath'], xpath))          text=self.getServerData("xpath.xql", "document=%s&xpath=%s&pn=%s"%(docinfo['textURLPath'], xpath,pn))
         pagedom = Parse(text)          pagedom = Parse(text)
         result =pagedom.xpath("//result/resultPage/")          result =pagedom.xpath("//result/resultPage/place/")
         for l in result:          for l in result:
             hrefNode= l.getAttributeNodeNS(None, u"id")              hrefNode= l.getAttributeNodeNS(None, u"id")
         docinfo['place']=getTextFromNode(result[0])              logging.debug("documentViewer (characterNormalization) l: %s"%(l))
         return docinfo              if hrefNode:
                   href= hrefNode.nodeValue
                   if href.startswith('id='):
                       hrefNode.nodeValue = href.replace('id=',"?")
                                   
           return serializeNode(pagenode)
           
     def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, highlightQuery=None,sn=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization=""):      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"""          """returns single page from fulltext"""
Line 206  class MpdlXmlTextServer(SimpleItem): Line 211  class MpdlXmlTextServer(SimpleItem):
                       if hrefNode:                        if hrefNode:
                           href=hrefNode.nodeValue                            href=hrefNode.nodeValue
                           if href.startswith('http://chinagis.mpiwg-berlin.mpg.de'):                            if href.startswith('http://chinagis.mpiwg-berlin.mpg.de'):
                               hrefNode.nodeValue =href.replace('chinagis_REST/REST/db/chgis/mpdl','chinagis/REST/db/mpdl/name=%s'%name)                                hrefNode.nodeValue =href.replace('chinagis_REST/REST/db/chgis/mpdl','chinagis/REST/db/mpdl/%s'%name)
                              #hrefNode.nodeValue =href.replace('chinagis_REST/REST/db/chgis/mpdl','chinagis/REST/db/mpdl%s'%url)  
                               logging.debug("YYYYY docinfo[name] %s"%docinfo['name'])  
                               l.setAttributeNS(None, 'target', '_blank')                                 l.setAttributeNS(None, 'target', '_blank') 
                   return serializeNode(pagenode)                    return serializeNode(pagenode)
                                           

Removed from v.1.74  
changed lines
  Added in v.1.82


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>