changeset 443:ad5c3dedfc18

*** empty log message ***
author abukhman
date Tue, 10 May 2011 17:24:55 +0200
parents 9148eac0cab3
children f160791b0074
files MpdlXmlTextServer.py
diffstat 1 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Thu Apr 28 11:58:39 2011 +0200
+++ b/MpdlXmlTextServer.py	Tue May 10 17:24:55 2011 +0200
@@ -20,7 +20,7 @@
     
     manage_changeMpdlXmlTextServerForm = PageTemplateFile("zpt/manage_changeMpdlXmlTextServer", globals())
         
-    def __init__(self,id,title="",serverUrl="http://mpdl-text.mpiwg-berlin.mpg.de/mpdl/interface/", serverName=None, timeout=40):
+    def __init__(self,id,title="",serverUrl="http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/interface/", serverName=None, timeout=40):
     #def __init__(self,id,title="",serverUrl="http://mpdl-text.mpiwg-berlin.mpg.de:30030/mpdl/interface/", serverName=None, timeout=40):    
         
         """constructor"""
@@ -203,8 +203,11 @@
         
         pagexml = self.getServerData("page-fragment.xql",textParam)
         dom = Parse(pagexml)
+        
+        
         #original Pages
         pagedivs = dom.xpath("//div[@class='pageNumberOrig']")       
+        
         """if pagedivs == dom.xpath("//div[@class='pageNumberOrig']"):
             if len(pagedivs)>0:
                 docinfo['pageNumberOrig']= getTextFromNode(pagedivs[0])
@@ -343,8 +346,10 @@
                 pagenode = pagedivs[0]
                 # check all a-tags
                 links = pagenode.xpath("//a")
+                
                 for l in links:
                     hrefNode = l.getAttributeNodeNS(None, u"href")
+                    
                     if hrefNode:
                         # is link with href
                         href = hrefNode.nodeValue
@@ -355,19 +360,20 @@
                             hrefNode.nodeValue = href.replace('http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/interface/lt/wordInfo.xql','%s/head_main_voc'%selfurl)
                             # add target
                             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, "onDblclick", "popupWin.focus();")
+                            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();")
                             #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'):    
                             selfurl = self.absolute_url()
                             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, '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, '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();')   
+                    
                         if href.startswith('#note-'):
-                            hrefNode.nodeValue = href.replace('#note-',"?url=%s&viewMode=text_dict&tocMode=%s&tocPN=%s&pn=%s#note-"%(url,tocMode,tocPN,pn))    
+                            hrefNode.nodeValue = href.replace('#note-',"?url=%s&viewMode=text_dict&tocMode=%s&tocPN=%s&pn=%s#note-"%(url,tocMode,tocPN,pn))  
+                              
                 return serializeNode(pagenode)
         return "no text here"