version 1.122, 2010/10/14 10:52:54
|
version 1.162, 2010/10/15 14:23:03
|
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 147 class MpdlXmlTextServer(SimpleItem):
|
Line 145 class MpdlXmlTextServer(SimpleItem):
|
url = docinfo['url'] |
url = docinfo['url'] |
selfurl = self.absolute_url() |
selfurl = self.absolute_url() |
pn = pageinfo['current'] |
pn = pageinfo['current'] |
|
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") |
for l in result: |
for l in result: |
hrefNode= l.getAttributeNodeNS(None, u"id") |
hrefNode= l.getAttributeNodeNS(None, u"id") |
href= hrefNode.nodeValue |
href= hrefNode.nodeValue |
href.split(",") |
hrefList.append(href) |
#href = ",".join(href) |
myList = ",".join(hrefList) |
logging.debug("getGisPlaces :%s"%(href)) |
logging.debug("getGisPlaces :%s"%(myList)) |
#return ";".join(["%s=%s" % (href, href) for href, href in params.items()]) |
return myList |
#logging.debug("getGisPlaces :%s"%(href)) |
|
#if href.startswith('id='): |
def getAllGisPlaces (self, docinfo=None, pageinfo=None): |
#hrefNode.nodeValue = href.replace('id=',"?") |
"""Show all Gis Places of whole Book """ |
#logging.debug("documentViewer getGisPlaces (characterNormalization) hrefNode.nodeValue:%s"%(hrefNode.nodeValue)) |
xpath ='//echo:place' |
logging.debug("getGisPlaces :%s"%(href)) |
docpath =docinfo['textURLPath'] |
return href |
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, pageinfo=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)) |
|
dom =Parse(text) |
|
pagedivs = dom.xpath("//div[@class='pageNumberOrig']") |
|
if len(pagedivs)>0: |
|
docinfo['originalPage'] = getTextFromNode(pagedivs[0]) |
|
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""" |