Changeset 444:f160791b0074 in documentViewer for MpdlXmlTextServer.py
- Timestamp:
- May 17, 2011, 1:02:57 PM (14 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MpdlXmlTextServer.py
r443 r444 55 55 tocMode = pageinfo['tocMode'] 56 56 characterNormalization = pageinfo['characterNormalization'] 57 optionToggle = pageinfo['optionToggle']57 #optionToggle = pageinfo['optionToggle'] 58 58 tocPN = pageinfo['tocPN'] 59 59 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))) 61 61 pagexml = data.replace('?document=%s'%str(docpath),'?url=%s'%url) 62 62 pagedom = Parse(pagexml) … … 86 86 if href.startswith('page-fragment.xql'): 87 87 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)) 89 89 hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl) 90 90 #logging.debug("PUREXML :%s"%(serializeNode(pagenode))) … … 101 101 if href.startswith('page-fragment.xql'): 102 102 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)) 104 104 hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl) 105 105 if href.startswith('../lt/lemma.xql'): … … 119 119 if hrefNode: 120 120 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)) 122 122 if href.startswith('../lt/lex.xql'): 123 123 hrefNode.nodeValue = href.replace('../lt/lex.xql','%s/template/head_main_lex'%selfurl) … … 186 186 pn =pageinfo['current'] 187 187 sn = pageinfo['sn'] 188 optionToggle =pageinfo ['optionToggle']188 #optionToggle =pageinfo ['optionToggle'] 189 189 highlightQuery = pageinfo['highlightQuery'] 190 190 #mode = pageinfo ['viewMode'] … … 198 198 textmode = mode 199 199 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) 201 201 if highlightQuery is not None: 202 202 textParam +="&highlightQuery=%s&sn=%s"%(urllib.quote(highlightQuery),sn) … … 424 424 return data 425 425 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): 427 427 #number of 428 428 docpath = docinfo['textURLPath'] … … 487 487 viewMode= pageinfo['viewMode'] 488 488 characterNormalization = pageinfo ['characterNormalization'] 489 optionToggle =pageinfo ['optionToggle']489 #optionToggle =pageinfo ['optionToggle'] 490 490 tocMode = pageinfo['tocMode'] 491 491 tocPN = pageinfo['tocPN'] 492 492 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)) 495 495 text = page.replace('mode=image','mode=texttool') 496 496 return text
Note: See TracChangeset
for help on using the changeset viewer.