version 1.74, 2010/10/11 14:04:21
|
version 1.108, 2010/10/14 09:26:23
|
Line 140 class MpdlXmlTextServer(SimpleItem):
|
Line 140 class MpdlXmlTextServer(SimpleItem):
|
docinfo['numPages']=int(getTextFromNode(result[0])) |
docinfo['numPages']=int(getTextFromNode(result[0])) |
return docinfo |
return docinfo |
|
|
def getGisPlases(self, docinfo): |
def getGisPlaces(self, docinfo=None, pageinfo=None): |
""" 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)) |
docpath = docinfo['textURLPath'] |
pagedom = Parse(text) |
url = docinfo['url'] |
result =pagedom.xpath("//result/resultPage/") |
selfurl = self.absolute_url() |
|
pn = pageinfo['current'] |
|
|
|
text=self.getServerData("xpath.xql", "document=%s&xpath=%s&pn=%s"%(docinfo['textURLPath'],xpath,pn)) |
|
dom = Parse(text) |
|
result = dom.xpath("//result/resultPage/place") |
|
#logging.debug("getGisPlaces (place) result:%s"%(result)) |
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 getGisPlaces (characterNormalization) l:%s"%(l)) |
return docinfo |
href= hrefNode.nodeValue |
|
#if href.startswith('id='): |
|
#hrefNode.nodeValue = href.replace('id=',"?") |
|
#logging.debug("documentViewer getGisPlaces (characterNormalization) hrefNode.nodeValue:%s"%(hrefNode.nodeValue)) |
|
logging.debug("getGisPlaces :%s"%(href)) |
|
return serializeNode(href) |
|
|
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 217 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) |
|
|