changeset 444:f160791b0074

*** empty log message ***
author abukhman
date Tue, 17 May 2011 15:02:57 +0200
parents ad5c3dedfc18
children 93b9a5dddb8b
files MpdlXmlTextServer.py documentViewer.py
diffstat 2 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Tue May 10 17:24:55 2011 +0200
+++ b/MpdlXmlTextServer.py	Tue May 17 15:02:57 2011 +0200
@@ -54,10 +54,10 @@
         viewMode=  pageinfo['viewMode']
         tocMode = pageinfo['tocMode']
         characterNormalization = pageinfo['characterNormalization']
-        optionToggle = pageinfo['optionToggle']
+        #optionToggle = pageinfo['optionToggle']
         tocPN = pageinfo['tocPN']
         selfurl = self.absolute_url()
-        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)))
+        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)))
         pagexml = data.replace('?document=%s'%str(docpath),'?url=%s'%url)
         pagedom = Parse(pagexml)
         
@@ -85,7 +85,7 @@
                         href = hrefNode.nodeValue
                         if href.startswith('page-fragment.xql'):
                             selfurl = self.absolute_url()            
-                            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))
+                            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))
                             hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl)                                           
                 #logging.debug("PUREXML :%s"%(serializeNode(pagenode)))
                 return serializeNode(pagenode)        
@@ -100,7 +100,7 @@
                         href = hrefNode.nodeValue
                         if href.startswith('page-fragment.xql'):
                             selfurl = self.absolute_url()       
-                            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))
+                            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))
                             hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl)  
                         if href.startswith('../lt/lemma.xql'):
                             hrefNode.nodeValue = href.replace('../lt/lemma.xql','%s/template/head_main_query'%(selfurl))        
@@ -118,7 +118,7 @@
                     hrefNode = l.getAttributeNodeNS(None, u"href")
                     if hrefNode:
                         href = hrefNode.nodeValue
-                        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))             
+                        hrefNode.nodeValue=href.replace('mode=text','mode=texttool&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s&characterNormalization=%s'%(viewMode,tocMode,tocPN,pn,characterNormalization))             
                         if href.startswith('../lt/lex.xql'):
                             hrefNode.nodeValue = href.replace('../lt/lex.xql','%s/template/head_main_lex'%selfurl)         
                             l.setAttributeNS(None, 'target', '_blank')
@@ -185,7 +185,7 @@
         name = docinfo.get('name',None)
         pn =pageinfo['current']
         sn = pageinfo['sn']
-        optionToggle =pageinfo ['optionToggle']
+        #optionToggle =pageinfo ['optionToggle']
         highlightQuery = pageinfo['highlightQuery']
         #mode = pageinfo ['viewMode']
         tocMode = pageinfo['tocMode']
@@ -197,7 +197,7 @@
         else:
             textmode = mode
         
-        textParam = "document=%s&mode=%s&pn=%s&characterNormalization=%s&optionToggle=%s"%(docpath,textmode,pn,characterNormalization,optionToggle)
+        textParam = "document=%s&mode=%s&pn=%s&characterNormalization=%s"%(docpath,textmode,pn,characterNormalization)
         if highlightQuery is not None:
             textParam +="&highlightQuery=%s&sn=%s"%(urllib.quote(highlightQuery),sn)           
         
@@ -423,7 +423,7 @@
         data = self.getServerData("lt/lex.xql","document=&language="+str(language)+"&query="+urllib.quote(query))
         return data
     
-    def getQuery (self,  docinfo=None, pageinfo=None, query=None, queryType=None, pn=1, optionToggle=None):
+    def getQuery (self,  docinfo=None, pageinfo=None, query=None, queryType=None, pn=1):
          #number of
          docpath = docinfo['textURLPath'] 
          pagesize = pageinfo['queryPageSize']
@@ -486,12 +486,12 @@
         selfurl = self.absolute_url()  
         viewMode=  pageinfo['viewMode']
         characterNormalization = pageinfo ['characterNormalization']
-        optionToggle =pageinfo ['optionToggle']
+        #optionToggle =pageinfo ['optionToggle']
         tocMode = pageinfo['tocMode']
         tocPN = pageinfo['tocPN']  
         
-        data = self.getServerData("doc-query.xql","document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s&characterNormalization=regPlusNorm&optionToggle=1"%(docpath,queryType, pagesize, pn))  
-        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))
+        data = self.getServerData("doc-query.xql","document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s&characterNormalization=regPlusNorm"%(docpath,queryType, pagesize, pn))  
+        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')
         return text
     
--- a/documentViewer.py	Tue May 10 17:24:55 2011 +0200
+++ b/documentViewer.py	Tue May 17 15:02:57 2011 +0200
@@ -906,7 +906,7 @@
         pageinfo['viewMode'] = viewMode
         pageinfo['tocMode'] = tocMode
         pageinfo['characterNormalization'] = self.REQUEST.get('characterNormalization','reg')
-        pageinfo['optionToggle'] = self.REQUEST.get('optionToggle','1')
+        #pageinfo['optionToggle'] = self.REQUEST.get('optionToggle','1')
         pageinfo['query'] = self.REQUEST.get('query','') 
         pageinfo['queryType'] = self.REQUEST.get('queryType','')
         pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext')