Index: documentViewer.py
===================================================================
--- documentViewer.py	(revision 100)
+++ documentViewer.py	(revision 101)
@@ -3,4 +3,5 @@
 from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile 
+from Products.PythonScripts.standard import url_quote
 from AccessControl import ClassSecurityInfo
 from AccessControl import getSecurityManager
@@ -690,4 +691,7 @@
         """get search list"""
         docpath = docinfo['textURLPath'] 
+        url = docinfo['url']
+        logging.debug("documentViewer (gettoc) docpath: %s"%(docpath))
+        logging.debug("documentViewer (gettoc) url: %s"%(url))
         pagesize = pageinfo['queryPageSize']
         pn = pageinfo['searchPN']
@@ -700,8 +704,6 @@
         selfurl = self.absolute_url()
         page=self.template.fulltextclient.eval("/mpdl/interface/doc-query.xql","document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&sn=%s&viewMode=%s"%(docpath, 'text', queryType, query, pagesize, pn, sn, viewMode) ,outputUnicode=False)                
-        pagexml = page.replace('?document=/echo/la/Benedetti_1585.xml','?url=/mpiwg/online/permanent/library/163127KK')
-        #hrefNode.nodeValue =pagexml.replace('mode=text','%s&mode=texttool'%selfurl)
+        pagexml = page.replace('?document=%s'%str(docpath),'?url=%s'%url)
         pagedom = Parse(pagexml)
-        #logging.debug("documentViewer (gettoc) pagedom: %s"%(pagedom))
         if (queryType=="fulltext")or(queryType=="xpath")or(queryType=="xquery")or(queryType=="fulltextMorphLemma"):   
             pagedivs = pagedom.xpath("//div[@class='queryResultPage']")
@@ -717,6 +719,7 @@
                             #l.setAttributeNS(None, "span class = 'hit highlight'", "background-color: #77DD77;")            
                             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)              
-                            l.setAttributeNS(None, "span class = 'hit'", "background-color: #77DD77;")      
+                            hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl)                                          
+                            l.setAttributeNS(None, "onClick", "id='highlighting'")  
+                              
                 return serializeNode(pagenode)
         
@@ -767,5 +770,5 @@
                             l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();')
                 return serializeNode(pagenode)      
-        return "xexe"   
+        return "no text here"   
                        
     def getNumPages(self,docinfo=None):
@@ -842,10 +845,11 @@
     def getTranslate(self, query=None, language=None):
         """translate into another languages"""
-        pagexml=self.template.fulltextclient.eval("/mpdl/interface/lt/lex.xql","query=%s&language=%s"%(query,language),outputUnicode=False)
+        pagexml=self.template.fulltextclient.eval("/mpdl/interface/lt/lex.xql","document=&language="+str(language)+"&query="+url_quote(str(query)))
         return pagexml
     
     def getLemma(self, lemma=None, language=None):
         """simular words lemma """
-        pagexml=self.template.fulltextclient.eval("/mpdl/interface/lt/lemma.xql","lemma=%s&language=%s"%(lemma,language),outputUnicode=False)
+        pagexml=self.template.fulltextclient.eval("/mpdl/interface/lt/lemma.xql","document=&language="+str(language)+"&lemma="+url_quote(str(lemma)))
+        #pagexml=self.template.fulltextclient.eval("/mpdl/interface/lt/lemma.xql","lemma=%s&language=%s"%(lemma,language),outputUnicode=False)
         return pagexml
 
@@ -910,7 +914,9 @@
             queryType = mode
         docpath = docinfo['textURLPath']
+        path = docinfo['textURLPath']
+        #logging.debug("documentViewer (gettoc) pathNomer: %s"%(pathNomer))
         pagesize = pageinfo['tocPageSize']
         pn = pageinfo['tocPN']
-        
+        url = docinfo['url']
         selfurl = self.absolute_url()  
         viewMode=  pageinfo['viewMode']
@@ -919,5 +925,5 @@
     
         pagexml=self.template.fulltextclient.eval("/mpdl/interface/doc-query.xql", "document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s"%(docpath,queryType, pagesize, pn), outputUnicode=False)
-        page = pagexml.replace('page-fragment.xql?document=/echo/la/Benedetti_1585.xml','%s?url=/mpiwg/online/permanent/library/163127KK&viewMode=%s&tocMode=%s&tocPN=%s'%(selfurl, viewMode, tocMode, tocPN))
+        page = pagexml.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
