# HG changeset patch # User abukhman # Date 1287136692 -7200 # Node ID ec5e920a61e675119d3c9aecb4c1ebe5d4da9cd3 # Parent ec293c61f8a9921005d07791157dd726003c3136 *** empty log message *** diff -r ec293c61f8a9 -r ec5e920a61e6 MpdlXmlTextServer.py --- 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""" diff -r ec293c61f8a9 -r ec5e920a61e6 documentViewer.py --- 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)