changeset 156:c94e206ba32c

characterNormalization
author abukhman
date Tue, 24 Aug 2010 11:30:45 +0200
parents 47f8cfc180bd
children de82ae2e9850
files MpdlXmlTextServer.py documentViewer.py
diffstat 2 files changed, 15 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Tue Aug 24 11:22:31 2010 +0200
+++ b/MpdlXmlTextServer.py	Tue Aug 24 11:30:45 2010 +0200
@@ -52,7 +52,7 @@
         queryType =pageinfo['queryType']
         viewMode=  pageinfo['viewMode']
         tocMode = pageinfo['tocMode']
-        characterNormalization = pageinfo ['characterNormalization']
+        #characterNormalization = pageinfo ['characterNormalization']
         tocPN = pageinfo['tocPN']
         selfurl = self.absolute_url()
         
@@ -72,7 +72,9 @@
                         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&characterNormalization=%s'%(viewMode,queryType,query,pagesize,pn,tocMode,pn,tocPN,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,query,pagesize,pn,tocMode,pn,tocPN,characterNormalization))
+                            pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s'%(viewMode,queryType,query,pagesize,pn,tocMode,pn,tocPN))
+                            
                             hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl)                                           
                 return serializeNode(pagenode)        
         if (queryType=="fulltextMorph"):
@@ -86,7 +88,9 @@
                         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&characterNormalization=%s'%(viewMode,queryType,query,pagesize,pn,tocMode,pn,tocPN,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,query,pagesize,pn,tocMode,pn,tocPN,characterNormalization))
+                            pagexml=href.replace('mode=text','mode=texttool&viewMode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&tocMode=%s&searchPN=%s&tocPN=%s'%(viewMode,queryType,query,pagesize,pn,tocMode,pn,tocPN))
+                            
                             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_lemma_New'%(selfurl))        
@@ -104,7 +108,8 @@
                     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&characterNormalization=%s'%(viewMode,tocMode,tocPN,pn,characterNormalization))             
+                        #hrefNode.nodeValue=href.replace('mode=text','mode=texttool&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s&characterNormalization=%s'%(viewMode,tocMode,tocPN,pn,characterNormalization))
+                        hrefNode.nodeValue=href.replace('mode=text','mode=texttool&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s'%(viewMode,tocMode,tocPN,pn))             
                         if href.startswith('../lt/lex.xql'):
                             hrefNode.nodeValue = href.replace('../lt/lex.xql','%s/template/head_main_voc'%selfurl)         
                             l.setAttributeNS(None, 'target', '_blank')
@@ -302,16 +307,17 @@
         url = docinfo['url']
         selfurl = self.absolute_url()  
         viewMode=  pageinfo['viewMode']
-        characterNormalization =pageinfo ['characterNormalization']
+        #characterNormalization =pageinfo ['characterNormalization']
         tocMode = pageinfo['tocMode']
         tocPN = pageinfo['tocPN']  
         
         data = self.getServerData("doc-query.xql","document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s"%(docpath,queryType, pagesize, pn))  
 
-        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&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')
-        logging.debug("documentViewer (characterNormalization) characterNormalization: %s"%(characterNormalization))
-        logging.debug("documentViewer (characterNormalization) characterNormalization: %s"%(characterNormalization))
+        #logging.debug("documentViewer (characterNormalization) characterNormalization: %s"%(characterNormalization))
+        #logging.debug("documentViewer (characterNormalization) characterNormalization: %s"%(characterNormalization))
         return text
     
     def manage_changeMpdlXmlTextServer(self,title="",serverUrl="http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/interface/",timeout=40,RESPONSE=None):
--- a/documentViewer.py	Tue Aug 24 11:22:31 2010 +0200
+++ b/documentViewer.py	Tue Aug 24 11:30:45 2010 +0200
@@ -712,9 +712,7 @@
         pageinfo['tocPN'] = self.REQUEST.get('tocPN', '1')
         toc = int (pageinfo['tocPN'])
         pageinfo['textPages'] =int (toc)
-        
-       
-        
+              
         if 'tocSize_%s'%tocMode in docinfo:
             tocSize = int(docinfo['tocSize_%s'%tocMode])
             tocPageSize = int(pageinfo['tocPageSize'])