--- documentViewer/MpdlXmlTextServer.py 2010/10/11 14:04:21 1.74 +++ documentViewer/MpdlXmlTextServer.py 2010/10/11 15:03:17 1.79 @@ -143,13 +143,17 @@ class MpdlXmlTextServer(SimpleItem): def getGisPlases(self, docinfo): """ Show all Gis Places of whole Page""" 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) result =pagedom.xpath("//result/resultPage/") for l in result: - hrefNode= l.getAttributeNodeNS(None, u"id") - docinfo['place']=getTextFromNode(result[0]) - return docinfo + hrefNode= l.getAttributeNodeNS(None, u"place") + if hrefNode: + href= hrefNode.nodeValue + if href.startswith('id='): + hrefNode.nodeValue = href.replace('id=',"?url=%s&viewMode=%s&tocMode=%s&tocPN=%s&pn=%sid="%(url,viewMode,tocMode,tocPN,pn)) + logging.debug("YYYY href%s"%href) + 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=""): """returns single page from fulltext""" @@ -206,9 +210,7 @@ class MpdlXmlTextServer(SimpleItem): if hrefNode: href=hrefNode.nodeValue 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'%url) - logging.debug("YYYYY docinfo[name] %s"%docinfo['name']) + hrefNode.nodeValue =href.replace('chinagis_REST/REST/db/chgis/mpdl','chinagis/REST/db/mpdl/%s'%name) l.setAttributeNS(None, 'target', '_blank') return serializeNode(pagenode)