|
|
| version 1.124, 2010/10/14 11:56:31 | version 1.151, 2010/10/15 13:14:59 |
|---|---|
| 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 |
| hrefList.append(href) | |
| myList = ",".join(hrefList) | |
| logging.debug("getGisPlaces :%s"%(myList)) | |
| return myList | |
| 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 | |
| #href = ",".join(href) | def getOrigPages (self, docinfo=None, pageinfo=None): |
| logging.debug("getGisPlaces :%s"%(href)) | """Show original page """ |
| return href | docpath = docinfo['textURLPath'] |
| #return ";".join(["%s=%s" % (href, href) for href, href in params.items()]) | #url = docinfo['url'] |
| #logging.debug("getGisPlaces :%s"%(href)) | selfurl = self.absolute_url() |
| #if href.startswith('id='): | pn =pageinfo['current'] |
| #hrefNode.nodeValue = href.replace('id=',"?") | viewMode= pageinfo['viewMode'] |
| #logging.debug("documentViewer getGisPlaces (characterNormalization) hrefNode.nodeValue:%s"%(hrefNode.nodeValue)) | text = self.getServerData("page-fragment.xql","document=%s&mode=%s&pn=%s"%(docinfo['textURLPath'], 'text', pn)) |
| logging.debug("getGisPlaces :%s"%(href)) | dom =Parse(text) |
| return "no text here" | pagedivs = dom.xpath("//div[@class='pageNumberOrig']") |
| logging.debug("getOrigPages :%s"%(pagedivs)) | |
| return "pagedivs" | |
| 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""" |