Changeset 448:35e7ea6f2368 in documentViewer for MpdlXmlTextServer.py
- Timestamp:
- Jul 29, 2011, 10:33:17 AM (13 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MpdlXmlTextServer.py
r447 r448 22 22 manage_changeMpdlXmlTextServerForm = PageTemplateFile("zpt/manage_changeMpdlXmlTextServer", globals()) 23 23 24 def __init__(self,id,title="",serverUrl="http://mpdl- system.mpiwg-berlin.mpg.de/mpdl/interface/", serverName=None, timeout=40):24 def __init__(self,id,title="",serverUrl="http://mpdl-test.mpiwg-berlin.mpg.de/mpdl/interface/", serverName=None, timeout=40): 25 25 #def __init__(self,id,title="",serverUrl="http://mpdl-text.mpiwg-berlin.mpg.de:30030/mpdl/interface/", serverName=None, timeout=40): 26 26 … … 49 49 pagesize = pageinfo['queryPageSize'] 50 50 pn = pageinfo.get('searchPN',1) 51 sn = pageinfo['sn'] 51 #sn = pageinfo['sn'] 52 s = pageinfo['s'] 53 highlightElementPos =pageinfo ['highlightElementPos'] 54 highlightElement = pageinfo ['highlightElement'] 55 52 56 highlightQuery = pageinfo['highlightQuery'] 53 57 query =pageinfo['query'] … … 59 63 tocPN = pageinfo['tocPN'] 60 64 selfurl = self.absolute_url() 61 data = self.getServerData("doc-query.xql","document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&sn=%s&viewMode=%s&characterNormalization=%s&highlightQuery=%s"%(docpath, 'text', queryType, urllib.quote(query), pagesize, pn, sn, viewMode,characterNormalization, urllib.quote(highlightQuery))) 65 data = 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))) 66 #data = self.getServerData("doc-query.xql","document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&sn=%s&viewMode=%s&characterNormalization=%s&highlightQuery=%s"%(docpath, 'text', queryType, urllib.quote(query), pagesize, pn, sn, viewMode,characterNormalization, urllib.quote(highlightQuery))) 62 67 pagexml = data.replace('?document=%s'%str(docpath),'?url=%s'%url) 63 68 pagedom = Parse(pagexml) … … 186 191 name = docinfo.get('name',None) 187 192 pn =pageinfo['current'] 188 sn = pageinfo['sn'] 193 #sn = pageinfo['sn'] 194 s = pageinfo['s'] 195 highlightElementPos =pageinfo ['highlightElementPos'] 196 highlightElement = pageinfo ['highlightElement'] 189 197 #optionToggle =pageinfo ['optionToggle'] 190 198 highlightQuery = pageinfo['highlightQuery'] … … 201 209 textParam = "document=%s&mode=%s&pn=%s&characterNormalization=%s"%(docpath,textmode,pn,characterNormalization) 202 210 if highlightQuery is not None: 203 textParam +="&highlightQuery=%s&sn=%s"%(urllib.quote(highlightQuery),sn) 211 #textParam +="&highlightQuery=%s&sn=%s"%(urllib.quote(highlightQuery),sn) 212 textParam +="&highlightQuery=%s&s=%s&highlightElement=%s&highlightElementPos=%s"%(urllib.quote(highlightQuery),s, highlightElement, highlightElementPos) 204 213 205 214 pagexml = self.getServerData("page-fragment.xql",textParam) … … 355 364 # is link with href 356 365 href = hrefNode.nodeValue 357 if href.startswith('http://mpdl- proto.mpiwg-berlin.mpg.de/mpdl/interface/lt/wordInfo.xql'):366 if href.startswith('http://mpdl-text.mpiwg-berlin.mpg.de/mpdl/interface/lt/wordInfo.xql'): 358 367 # is pollux link 359 368 selfurl = self.absolute_url() 360 369 # change href 361 hrefNode.nodeValue = href.replace('http://mpdl- proto.mpiwg-berlin.mpg.de/mpdl/interface/lt/wordInfo.xql','%s/head_main_voc'%selfurl)370 hrefNode.nodeValue = href.replace('http://mpdl-text.mpiwg-berlin.mpg.de/mpdl/interface/lt/wordInfo.xql','%s/head_main_voc'%selfurl) 362 371 # add target 363 372 l.setAttributeNS(None, 'target', '_blank') … … 366 375 #window.open("this.href, 'InfoWindow', 'menubar=no, location,width=500,height=600,top=180, left=700, toolbar=yes, scrollbars=1'"); return false;") 367 376 368 if href.startswith('http://mpdl- proto.mpiwg-berlin.mpg.de/mpdl/lt/lemma.xql'):377 if href.startswith('http://mpdl-text.mpiwg-berlin.mpg.de/mpdl/lt/lemma.xql'): 369 378 selfurl = self.absolute_url() 370 hrefNode.nodeValue = href.replace('http://mpdl- proto.mpiwg-berlin.mpg.de/mpdl/lt/lemma.xql','%s/head_main_lemma'%selfurl)379 hrefNode.nodeValue = href.replace('http://mpdl-text.mpiwg-berlin.mpg.de/mpdl/lt/lemma.xql','%s/head_main_lemma'%selfurl) 371 380 l.setAttributeNS(None, 'target', '_blank') 372 381 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;")
Note: See TracChangeset
for help on using the changeset viewer.