version 1.78, 2010/10/11 14:49:37
|
version 1.139, 2010/10/14 14:50:09
|
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() |
logging.debug("YYYY result%s"%result) |
pn = pageinfo['current'] |
|
hrefList=[] |
|
|
|
text=self.getServerData("xpath.xql", "document=%s&xpath=%s&pn=%s"%(docinfo['textURLPath'],xpath,pn)) |
|
dom = Parse(text) |
|
result = dom.xpath("//result/resultPage/place") |
for l in result: |
for l in result: |
hrefNode= l.getAttributeNodeNS(None, u"place") |
hrefNode= l.getAttributeNodeNS(None, u"id") |
logging.debug("YYYY hrefNode%s"%hrefNode) |
|
if hrefNode: |
|
href= hrefNode.nodeValue |
href= hrefNode.nodeValue |
if href.startswith('id='): |
hrefList.append(href) |
hrefNode.nodeValue = href.replace('id=',"?url=%s&viewMode=%s&tocMode=%s&tocPN=%s&pn=%sid="%(url,viewMode,tocMode,tocPN,pn)) |
myList = ",".join(hrefList) |
logging.debug("YYYY href%s"%href) |
#hoho =hrefList.replace('','') |
return serializeNode(pagenode) |
#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" |
|
|
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""" |