Changeset 444:f160791b0074 in documentViewer for MpdlXmlTextServer.py


Ignore:
Timestamp:
May 17, 2011, 1:02:57 PM (14 years ago)
Author:
abukhman
Branch:
default
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MpdlXmlTextServer.py

    r443 r444  
    5555        tocMode = pageinfo['tocMode']
    5656        characterNormalization = pageinfo['characterNormalization']
    57         optionToggle = pageinfo['optionToggle']
     57        #optionToggle = pageinfo['optionToggle']
    5858        tocPN = pageinfo['tocPN']
    5959        selfurl = self.absolute_url()
    60         data = self.getServerData("doc-query.xql","document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&sn=%s&viewMode=%s&characterNormalization=%s&optionToggle=%s&highlightQuery=%s"%(docpath, 'text', queryType, urllib.quote(query), pagesize, pn, sn, viewMode,characterNormalization,optionToggle ,urllib.quote(highlightQuery)))
     60        data = self.getServerData("doc-query.xql","document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&sn=%s&viewMode=%s&characterNormalization=%s&highlightQuery=%s"%(docpath, 'text', queryType, urllib.quote(query), pagesize, pn, sn, viewMode,characterNormalization, urllib.quote(highlightQuery)))
    6161        pagexml = data.replace('?document=%s'%str(docpath),'?url=%s'%url)
    6262        pagedom = Parse(pagexml)
     
    8686                        if href.startswith('page-fragment.xql'):
    8787                            selfurl = self.absolute_url()           
    88                             pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s&optionToggle=%s&characterNormalization=%s'%(viewMode,queryType,urllib.quote(query),pagesize,pn,tocMode,pn,tocPN,optionToggle,characterNormalization))
     88                            pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s&characterNormalization=%s'%(viewMode,queryType,urllib.quote(query),pagesize,pn,tocMode,pn,tocPN, characterNormalization))
    8989                            hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl)                                           
    9090                #logging.debug("PUREXML :%s"%(serializeNode(pagenode)))
     
    101101                        if href.startswith('page-fragment.xql'):
    102102                            selfurl = self.absolute_url()       
    103                             pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s&optionToggle=%s&characterNormalization=%s'%(viewMode,queryType,urllib.quote(query),pagesize,pn,tocMode,pn,tocPN,optionToggle,characterNormalization))
     103                            pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s&characterNormalization=%s'%(viewMode,queryType,urllib.quote(query),pagesize,pn,tocMode,pn,tocPN,characterNormalization))
    104104                            hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl) 
    105105                        if href.startswith('../lt/lemma.xql'):
     
    119119                    if hrefNode:
    120120                        href = hrefNode.nodeValue
    121                         hrefNode.nodeValue=href.replace('mode=text','mode=texttool&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s&optionToggle=%s&characterNormalization=%s'%(viewMode,tocMode,tocPN,pn,optionToggle,characterNormalization))             
     121                        hrefNode.nodeValue=href.replace('mode=text','mode=texttool&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s&characterNormalization=%s'%(viewMode,tocMode,tocPN,pn,characterNormalization))             
    122122                        if href.startswith('../lt/lex.xql'):
    123123                            hrefNode.nodeValue = href.replace('../lt/lex.xql','%s/template/head_main_lex'%selfurl)         
     
    186186        pn =pageinfo['current']
    187187        sn = pageinfo['sn']
    188         optionToggle =pageinfo ['optionToggle']
     188        #optionToggle =pageinfo ['optionToggle']
    189189        highlightQuery = pageinfo['highlightQuery']
    190190        #mode = pageinfo ['viewMode']
     
    198198            textmode = mode
    199199       
    200         textParam = "document=%s&mode=%s&pn=%s&characterNormalization=%s&optionToggle=%s"%(docpath,textmode,pn,characterNormalization,optionToggle)
     200        textParam = "document=%s&mode=%s&pn=%s&characterNormalization=%s"%(docpath,textmode,pn,characterNormalization)
    201201        if highlightQuery is not None:
    202202            textParam +="&highlightQuery=%s&sn=%s"%(urllib.quote(highlightQuery),sn)           
     
    424424        return data
    425425   
    426     def getQuery (self,  docinfo=None, pageinfo=None, query=None, queryType=None, pn=1, optionToggle=None):
     426    def getQuery (self,  docinfo=None, pageinfo=None, query=None, queryType=None, pn=1):
    427427         #number of
    428428         docpath = docinfo['textURLPath']
     
    487487        viewMode=  pageinfo['viewMode']
    488488        characterNormalization = pageinfo ['characterNormalization']
    489         optionToggle =pageinfo ['optionToggle']
     489        #optionToggle =pageinfo ['optionToggle']
    490490        tocMode = pageinfo['tocMode']
    491491        tocPN = pageinfo['tocPN'] 
    492492       
    493         data = self.getServerData("doc-query.xql","document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s&characterNormalization=regPlusNorm&optionToggle=1"%(docpath,queryType, pagesize, pn)) 
    494         page = data.replace('page-fragment.xql?document=%s'%str(path),'%s?url=%s&viewMode=%s&tocMode=%s&tocPN=%s&optionToggle=1'%(selfurl,url, viewMode, tocMode, tocPN))
     493        data = self.getServerData("doc-query.xql","document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s&characterNormalization=regPlusNorm"%(docpath,queryType, pagesize, pn)) 
     494        page = data.replace('page-fragment.xql?document=%s'%str(path),'%s?url=%s&viewMode=%s&tocMode=%s&tocPN=%s'%(selfurl,url, viewMode, tocMode, tocPN))
    495495        text = page.replace('mode=image','mode=texttool')
    496496        return text
Note: See TracChangeset for help on using the changeset viewer.