Diff for /documentViewer/MpdlXmlTextServer.py between versions 1.141 and 1.149

version 1.141, 2010/10/14 14:53:14 version 1.149, 2010/10/15 13:05:47
Line 42  class MpdlXmlTextServer(SimpleItem): Line 42  class MpdlXmlTextServer(SimpleItem):
         """get search list"""          """get search list"""
         docpath = docinfo['textURLPath']           docpath = docinfo['textURLPath'] 
         url = docinfo['url']          url = docinfo['url']
         logging.debug("documentViewer (gettoc) docpath: %s"%(docpath))  
         logging.debug("documentViewer (gettoc) url: %s"%(url))  
         pagesize = pageinfo['queryPageSize']          pagesize = pageinfo['queryPageSize']
         pn = pageinfo['searchPN']          pn = pageinfo['searchPN']
         sn = pageinfo['sn']          sn = pageinfo['sn']
Line 148  class MpdlXmlTextServer(SimpleItem): Line 146  class MpdlXmlTextServer(SimpleItem):
         selfurl = self.absolute_url()          selfurl = self.absolute_url()
         pn = pageinfo['current']          pn = pageinfo['current']
         hrefList=[]          hrefList=[]
           myList= ""
         text=self.getServerData("xpath.xql", "document=%s&xpath=%s&pn=%s"%(docinfo['textURLPath'],xpath,pn))          text=self.getServerData("xpath.xql", "document=%s&xpath=%s&pn=%s"%(docinfo['textURLPath'],xpath,pn))
         dom = Parse(text)          dom = Parse(text)
         result = dom.xpath("//result/resultPage/place")          result = dom.xpath("//result/resultPage/place")
Line 157  class MpdlXmlTextServer(SimpleItem): Line 155  class MpdlXmlTextServer(SimpleItem):
             href= hrefNode.nodeValue              href= hrefNode.nodeValue
             hrefList.append(href)              hrefList.append(href)
             myList = ",".join(hrefList)              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))                                       logging.debug("getGisPlaces :%s"%(myList))                             
         return myList          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)
               logging.debug("getALLGisPlaces :%s"%(myList))
           return myList
       
       def getOrigPages (self, docinfo=None, pageinfo=None, viewMode=None, pn=1):
           """Show original page """
           docpath = docinfo['textURLPath'] 
           #url = docinfo['url']
           selfurl = self.absolute_url()
           pn =pageinfo['current']
           viewMode=  pageinfo['viewMode']
           text = self.getServerData("page-fragment.xql","document=%s&mode=%s&pn=%s"%(docinfo['textURLPath'], mode,  pn))
           dom =Parse(text)
           pagedivs = dom.xpath("//div[@class='pageNumberOrig']")
           logging.debug("getOrigPages :%s"%(pagedivs))
           return "pagedivs"
       
     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"""
         docpath = docinfo['textURLPath']          docpath = docinfo['textURLPath']

Removed from v.1.141  
changed lines
  Added in v.1.149


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