version 1.22, 2010/08/24 12:34:32
|
version 1.24, 2010/08/24 13:15: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) docpath: %s"%(docpath)) |
#logging.debug("documentViewer (gettoc) url: %s"%(url)) |
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 52 class MpdlXmlTextServer(SimpleItem):
|
Line 52 class MpdlXmlTextServer(SimpleItem):
|
queryType =pageinfo['queryType'] |
queryType =pageinfo['queryType'] |
viewMode= pageinfo['viewMode'] |
viewMode= pageinfo['viewMode'] |
tocMode = pageinfo['tocMode'] |
tocMode = pageinfo['tocMode'] |
#characterNormalization = pageinfo ['characterNormalization'] |
characterNormalization = pageinfo['characterNormalization'] |
tocPN = pageinfo['tocPN'] |
tocPN = pageinfo['tocPN'] |
selfurl = self.absolute_url() |
selfurl = self.absolute_url() |
|
|
Line 253 class MpdlXmlTextServer(SimpleItem):
|
Line 253 class MpdlXmlTextServer(SimpleItem):
|
numdivs = pagedom.xpath("//div[@class='queryResultHits']") |
numdivs = pagedom.xpath("//div[@class='queryResultHits']") |
tocSearch = int(getTextFromNode(numdivs[0])) |
tocSearch = int(getTextFromNode(numdivs[0])) |
tc=int((tocSearch/10)+1) |
tc=int((tocSearch/10)+1) |
#logging.debug("documentViewer (gettoc) tc: %s"%(tc)) |
logging.debug("documentViewer (gettoc) tc: %s"%(tc)) |
return tc |
return tc |
|
|
def getToc(self, mode="text", docinfo=None): |
def getToc(self, mode="text", docinfo=None): |
"""loads table of contents and stores in docinfo""" |
"""loads table of contents and stores in docinfo""" |
#logging.debug("documentViewer (gettoc) mode: %s"%(mode)) |
logging.debug("documentViewer (gettoc) mode: %s"%(mode)) |
if mode == "none": |
if mode == "none": |
return docinfo |
return docinfo |
if 'tocSize_%s'%mode in docinfo: |
if 'tocSize_%s'%mode in docinfo: |
Line 306 class MpdlXmlTextServer(SimpleItem):
|
Line 306 class MpdlXmlTextServer(SimpleItem):
|
tocMode = pageinfo['tocMode'] |
tocMode = pageinfo['tocMode'] |
tocPN = pageinfo['tocPN'] |
tocPN = pageinfo['tocPN'] |
|
|
data = self.getServerData("doc-query.xql","document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s"%(docpath,queryType, pagesize, pn)) |
data = self.getServerData("doc-query.xql","document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s&characterNormalization=%s"%(docpath,queryType, pagesize, pn,characterNormalization)) |
page = data.replace('page-fragment.xql?document=%s'%str(path),'%s?url=%s&viewMode=%s&tocMode=%s&tocPN=%s&characterNormalization=%s'%(selfurl,url, viewMode, tocMode, tocPN,characterNormalization)) |
page = data.replace('page-fragment.xql?document=%s'%str(path),'%s?url=%s&viewMode=%s&tocMode=%s&tocPN=%s'%(selfurl,url, viewMode, tocMode, tocPN)) |
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)) |