Diff for /documentViewer/MpdlXmlTextServer.py between versions 1.237 and 1.240

version 1.237, 2011/05/17 13:02:57 version 1.240, 2011/07/18 14:02:37
Line 2 Line 2
 from OFS.SimpleItem import SimpleItem  from OFS.SimpleItem import SimpleItem
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile   from Products.PageTemplates.PageTemplateFile import PageTemplateFile 
 from Ft.Xml import EMPTY_NAMESPACE, Parse  from Ft.Xml import EMPTY_NAMESPACE, Parse
   from Ft.Xml.Domlette import NonvalidatingReader
   
 import md5  import md5
 import sys  import sys
Line 105  class MpdlXmlTextServer(SimpleItem): Line 106  class MpdlXmlTextServer(SimpleItem):
                         if href.startswith('../lt/lemma.xql'):                          if href.startswith('../lt/lemma.xql'):
                             hrefNode.nodeValue = href.replace('../lt/lemma.xql','%s/template/head_main_query'%(selfurl))                                      hrefNode.nodeValue = href.replace('../lt/lemma.xql','%s/template/head_main_query'%(selfurl))        
                             l.setAttributeNS(None, 'target', '_blank')                              l.setAttributeNS(None, 'target', '_blank')
                             l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=400, scrollbars=1'); return false;")                              l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=300,height=400,top=180, left=400, scrollbars=1'); return false;")
                             l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();')                                l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();')  
                 pagedivs = pagedom.xpath("//div[@class='queryResultMorphExpansion']")                                  pagedivs = pagedom.xpath("//div[@class='queryResultMorphExpansion']")                
                 return serializeNode(pagenode)                          return serializeNode(pagenode)        
Line 127  class MpdlXmlTextServer(SimpleItem): Line 128  class MpdlXmlTextServer(SimpleItem):
                         if href.startswith('../lt/lemma.xql'):                          if href.startswith('../lt/lemma.xql'):
                             hrefNode.nodeValue = href.replace('../lt/lemma.xql','%s/template/head_main_lemma'%(selfurl))                                      hrefNode.nodeValue = href.replace('../lt/lemma.xql','%s/template/head_main_lemma'%(selfurl))        
                             l.setAttributeNS(None, 'target', '_blank')                              l.setAttributeNS(None, 'target', '_blank')
                             l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=400, scrollbars=1'); return false;")                              l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=300,height=400,top=180, left=400, scrollbars=1'); return false;")
                             l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();')                              l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();')
                 return serializeNode(pagenode)                        return serializeNode(pagenode)      
         return "no text here"             return "no text here"   
Line 203  class MpdlXmlTextServer(SimpleItem): Line 204  class MpdlXmlTextServer(SimpleItem):
                   
         pagexml = self.getServerData("page-fragment.xql",textParam)          pagexml = self.getServerData("page-fragment.xql",textParam)
         dom = Parse(pagexml)          dom = Parse(pagexml)
                   #dom = NonvalidatingReader.parseStream(pagexml)
                   
         #original Pages          #original Pages
         pagedivs = dom.xpath("//div[@class='pageNumberOrig']")                 pagedivs = dom.xpath("//div[@class='pageNumberOrig']")       
Line 360  class MpdlXmlTextServer(SimpleItem): Line 361  class MpdlXmlTextServer(SimpleItem):
                             hrefNode.nodeValue = href.replace('http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/interface/lt/wordInfo.xql','%s/head_main_voc'%selfurl)                              hrefNode.nodeValue = href.replace('http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/interface/lt/wordInfo.xql','%s/head_main_voc'%selfurl)
                             # add target                              # add target
                             l.setAttributeNS(None, 'target', '_blank')                              l.setAttributeNS(None, 'target', '_blank')
                             l.setAttributeNS(None, 'onclick',"popupWin = window.open(this.href, 'InfoWindow', 'menubar=no, location,width=500,height=600,top=180, left=700, toolbar=no, scrollbars=1'); return false;")                              #l.setAttributeNS(None, 'onclick',"popupWin = window.open(this.href, 'InfoWindow', 'menubar=no, location,width=500,height=600,top=180, left=700, toolbar=no, scrollbars=1'); return false;")
                             l.setAttributeNS(None, "ondblclick", "popupWin.focus();")                              #l.setAttributeNS(None, "ondblclick", "popupWin.focus();")
                             #window.open("this.href, 'InfoWindow', 'menubar=no, location,width=500,height=600,top=180, left=700, toolbar=yes, scrollbars=1'"); return false;")                              #window.open("this.href, 'InfoWindow', 'menubar=no, location,width=500,height=600,top=180, left=700, toolbar=yes, scrollbars=1'"); return false;")
                                                                                                                       
                         if href.startswith('http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/lt/lemma.xql'):                              if href.startswith('http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/lt/lemma.xql'):    
                             selfurl = self.absolute_url()                              selfurl = self.absolute_url()
                             hrefNode.nodeValue = href.replace('http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/lt/lemma.xql','%s/head_main_lemma'%selfurl)                              hrefNode.nodeValue = href.replace('http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/lt/lemma.xql','%s/head_main_lemma'%selfurl)
                             l.setAttributeNS(None, 'target', '_blank')                              l.setAttributeNS(None, 'target', '_blank')
                             l.setAttributeNS(None, 'onclick',"popupWin = window.open(this.href, 'InfoWindow', 'menubar=no, location,width=500,height=600,top=180, left=700, toolbar=no, scrollbars=1'); return false;")                              l.setAttributeNS(None, 'onclick',"popupWin = window.open(this.href, 'InfoWindow', 'menubar=no, location,width=300,height=400,top=180, left=700, toolbar=no, scrollbars=1'); return false;")
                             l.setAttributeNS(None, 'ondblclick', 'popupWin.focus();')                                 l.setAttributeNS(None, 'ondblclick', 'popupWin.focus();')   
                                           
                         if href.startswith('#note-'):                          if href.startswith('#note-'):
Line 402  class MpdlXmlTextServer(SimpleItem): Line 403  class MpdlXmlTextServer(SimpleItem):
                 return docinfo['pageNumberOrigNorm']                  return docinfo['pageNumberOrigNorm']
   
                                   
     def getTranslate(self, word=None, language=None):      def getTranslate(self, word=None, language=None, display=None):
         """translate into another languages"""          """translate into another languages"""
         data = self.getServerData("lt/wordInfo.xql","language="+str(language)+"&word="+urllib.quote(word)+"&output=html")          data = self.getServerData("lt/wordInfo.xql","language="+str(language)+"&word="+urllib.quote(word)+"&display="+urllib.quote(display)+"&output=html")
         #pagexml=self.template.fulltextclient.eval("/mpdl/interface/lt/lex.xql","document=&language="+str(language)+"&query="+url_quote(str(query)))          #pagexml=self.template.fulltextclient.eval("/mpdl/interface/lt/lex.xql","document=&language="+str(language)+"&query="+url_quote(str(query)))
         return data          return data
           

Removed from v.1.237  
changed lines
  Added in v.1.240


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>