version 1.139, 2010/10/14 14:50:09
|
version 1.170, 2010/10/18 10:26:39
|
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('','') |
logging.debug("getGisPlaces :%s"%(myList)) |
#probe =href.replace('chinagis_REST/REST/db/chgis/mpdl','chinagis/REST/db/mpdl/%s'%name) |
return myList |
#l.setAttributeNS(None, 'target', '_blank') |
|
#logging.debug("getGisPlaces :%s"%(myList)) |
def getAllGisPlaces (self, docinfo=None, pageinfo=None): |
return "myList" |
"""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): |
|
"""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'], 'text', pn)) |
|
text = self.getServerData("page-fragment.xql","document=%s&mode=%s"%(docinfo['textURLPath'], 'text')) |
|
dom =Parse(text) |
|
pagedivs = dom.xpath("//div[@class='pageNumberOrig']") |
|
if len(pagedivs)>0: |
|
docinfo['originalPage'] = getTextFromNode(pagedivs[0]) |
|
#return docinfo['originalPage'] |
|
#return originalPage |
|
return docinfo |
|
|
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""" |