Index: MpdlXmlTextServer.py
===================================================================
--- MpdlXmlTextServer.py	(revision 508)
+++ MpdlXmlTextServer.py	(revision 509)
@@ -271,5 +271,5 @@
     
 
-    def getSearchResults(self, mode, query=None, docinfo=None):
+    def getSearchResults(self, mode, query=None, pageinfo=None, docinfo=None):
         """loads list of search results and stores XML in docinfo"""
         logging.debug("getSearchResults mode=%s query=%s"%(mode, query))
@@ -282,7 +282,5 @@
         
         docpath = docinfo['textURLPath']
-        # we need to set a result set size
-        pagesize = 1000
-        pn = 1
+        
         # fetch full results
         params = {'document': docpath,
@@ -291,5 +289,6 @@
                   'query': query,
                   'queryResultPageSize': 1000,
-                  'queryResultPN': 1}
+                  'queryResultPN': 1,
+                  'characterNormalization': pageinfo.get('characterNormalization', 'reg')}
         pagexml = self.getServerData("doc-query.xql",urllib.urlencode(params))
         #pagexml = self.getServerData("doc-query.xql","document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&s=%s&viewMode=%s&characterNormalization=%s&highlightElementPos=%s&highlightElement=%s&highlightQuery=%s"%(docpath, 'text', queryType, urllib.quote(query), pagesize, pn, s, viewMode,characterNormalization, highlightElementPos, highlightElement, urllib.quote(highlightQuery)))
@@ -322,5 +321,5 @@
         #TODO: cache only one search
         if not docinfo.has_key('resultXML_%s_%s'%(mode,query)):
-            self.getSearchResults(mode=mode, query=query, docinfo=docinfo)
+            self.getSearchResults(mode=mode, query=query, pageinfo=pageinfo, docinfo=docinfo)
             
         resultxml = docinfo.get('resultXML_%s_%s'%(mode,query), None)
Index: documentViewer.py
===================================================================
--- documentViewer.py	(revision 508)
+++ documentViewer.py	(revision 509)
@@ -733,14 +733,10 @@
         # TODO: do we need this here?
         pageinfo['characterNormalization'] = self.REQUEST.get('characterNormalization','reg')
-        pageinfo['query'] = self.REQUEST.get('query','') 
-        pageinfo['queryType'] = self.REQUEST.get('queryType','')
-        pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext')
-        pageinfo['highlightQuery'] = self.REQUEST.get('highlightQuery','')
         pageinfo['tocPageSize'] = getInt(self.REQUEST.get('tocPageSize', 30))
-        pageinfo['queryPageSize'] = getInt(self.REQUEST.get('queryPageSize', 10))
+        pageinfo['resultPageSize'] = getInt(self.REQUEST.get('resultPageSize', 10))
         pageinfo['tocPN'] = getInt(self.REQUEST.get('tocPN', '1'))
-        pageinfo['searchPN'] = getInt(self.REQUEST.get('searchPN','1'))
-        
-        # limit tocPN
+        pageinfo['resultPN'] = getInt(self.REQUEST.get('resultPN','1'))
+        
+        # limit tocPN TODO: do we need this?
         if 'tocSize_%s'%tocMode in docinfo:
             tocSize = docinfo['tocSize_%s'%tocMode]
Index: zpt/viewer_text.zpt
===================================================================
--- zpt/viewer_text.zpt	(revision 508)
+++ zpt/viewer_text.zpt	(revision 509)
@@ -69,4 +69,5 @@
           <h4>Text display</h4>
           <pre tal:content="python:repr(viewLayers)" />
+          <pre tal:content="python:repr(viewLayer)" />
           <form tal:attributes="action viewerUrl" class="autosubmit">
             <input type="hidden"
@@ -182,5 +183,5 @@
             tal:define="norm python:pageinfo.get('characterNormalization','regPlusNorm');">
             <input type="hidden"
-              tal:define="params python:here.getParams('characterNormalization',None)"
+              tal:define="params python:here.getParams(params={'characterNormalization':None, 'viewLayer':viewLayer})"
               tal:repeat="param params"
               tal:attributes="name param; value python:params[param]" />
