version 1.109, 2010/10/14 09:35:01
|
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 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 |
koko=len(href) |
hrefList.append(href) |
#if href.startswith('id='): |
myList = ",".join(hrefList) |
#hrefNode.nodeValue = href.replace('id=',"?") |
logging.debug("getGisPlaces :%s"%(myList)) |
#logging.debug("documentViewer getGisPlaces (characterNormalization) hrefNode.nodeValue:%s"%(hrefNode.nodeValue)) |
return myList |
logging.debug("getGisPlaces :%s"%(koko)) |
|
return serializeNode(href) |
def getAllGisPlaces (self, docinfo=None, pageinfo=None): |
|
"""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""" |