version 1.208, 2010/11/09 11:45:38
|
version 1.211, 2010/11/09 12:52:02
|
Line 371 class MpdlXmlTextServer(SimpleItem):
|
Line 371 class MpdlXmlTextServer(SimpleItem):
|
pagedom = Parse(pagexml) |
pagedom = Parse(pagexml) |
numdivs = pagedom.xpath("//div[@class='queryResultHits']") |
numdivs = pagedom.xpath("//div[@class='queryResultHits']") |
tocSearch = int(getTextFromNode(numdivs[0])) |
tocSearch = int(getTextFromNode(numdivs[0])) |
return tocSearch |
tc=int((tocSearch/10)+1) |
|
return tc |
|
|
def getQueryResultHitsText(self, docinfo=None, pageinfo=None): |
def getQueryResultHitsText(self, docinfo=None, pageinfo=None): |
"""number of hits in Text of Contents mode""" |
"""number of hits in Text of Contents mode""" |
Line 390 class MpdlXmlTextServer(SimpleItem):
|
Line 391 class MpdlXmlTextServer(SimpleItem):
|
logging.debug("documentViewer (pagedom) pagedom: %s"%(pagedom)) |
logging.debug("documentViewer (pagedom) pagedom: %s"%(pagedom)) |
numdivs = pagedom.xpath("//div[@class='queryResultHits']") |
numdivs = pagedom.xpath("//div[@class='queryResultHits']") |
tocSearch = int(getTextFromNode(numdivs[0])) |
tocSearch = int(getTextFromNode(numdivs[0])) |
return tocSearch |
tc=int((tocSearch/30)+1) |
|
return tc |
|
|
def getQueryResultHitsFigures(self, docinfo=None, pageinfo=None): |
def getQueryResultHitsFigures(self, docinfo=None, pageinfo=None): |
"""number of hits in Text of Figures mode""" |
"""number of hits in Text of Figures mode""" |
Line 409 class MpdlXmlTextServer(SimpleItem):
|
Line 411 class MpdlXmlTextServer(SimpleItem):
|
logging.debug("documentViewer (pagedom) pagedom: %s"%(pagedom)) |
logging.debug("documentViewer (pagedom) pagedom: %s"%(pagedom)) |
numdivs = pagedom.xpath("//div[@class='queryResultHits']") |
numdivs = pagedom.xpath("//div[@class='queryResultHits']") |
tocSearch = int(getTextFromNode(numdivs[0])) |
tocSearch = int(getTextFromNode(numdivs[0])) |
return tocSearch |
tc=int((tocSearch/30)+1) |
|
return tc |
|
|
|
|
def getToc(self, mode="text", docinfo=None): |
def getToc(self, mode="text", docinfo=None): |
Line 464 class MpdlXmlTextServer(SimpleItem):
|
Line 467 class MpdlXmlTextServer(SimpleItem):
|
tocPN = pageinfo['tocPN'] |
tocPN = pageinfo['tocPN'] |
|
|
data = self.getServerData("doc-query.xql","document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s&characterNormalization=%s&optionToggle=%s"%(docpath,queryType, pagesize, pn,characterNormalization,optionToggle)) |
data = self.getServerData("doc-query.xql","document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s&characterNormalization=%s&optionToggle=%s"%(docpath,queryType, pagesize, pn,characterNormalization,optionToggle)) |
page = data.replace('page-fragment.xql?document=%s'%str(path),'%s?url=%s&viewMode=%s&tocMode=%s&tocPN=%s'%(selfurl,url, viewMode, tocMode, tocPN)) |
page = data.replace('page-fragment.xql?document=%s'%str(path),'%s?url=%s&viewMode=%s&tocMode=%s&tocPN=%s&optionToggle=%s'%(selfurl,url, viewMode, tocMode, tocPN,optionToggle)) |
text = page.replace('mode=image','mode=texttool') |
text = page.replace('mode=image','mode=texttool') |
logging.debug("documentViewer (characterNormalization) characterNormalization: %s"%(characterNormalization)) |
logging.debug("documentViewer (characterNormalization) characterNormalization: %s"%(characterNormalization)) |
#logging.debug("documentViewer (characterNormalization) text: %s"%(text)) |
#logging.debug("documentViewer (characterNormalization) text: %s"%(text)) |