1 | from OFS.SimpleItem import SimpleItem |
---|
2 | from Products.PageTemplates.PageTemplateFile import PageTemplateFile |
---|
3 | |
---|
4 | import xml.etree.ElementTree as ET |
---|
5 | |
---|
6 | import re |
---|
7 | import logging |
---|
8 | import urllib |
---|
9 | import urlparse |
---|
10 | import base64 |
---|
11 | |
---|
12 | from SrvTxtUtils import getInt, getText, getHttpData |
---|
13 | |
---|
14 | def serialize(node): |
---|
15 | """returns a string containing an XML snippet of node""" |
---|
16 | s = ET.tostring(node, 'UTF-8') |
---|
17 | # snip off XML declaration |
---|
18 | if s.startswith('<?xml'): |
---|
19 | i = s.find('?>') |
---|
20 | return s[i+3:] |
---|
21 | |
---|
22 | return s |
---|
23 | |
---|
24 | |
---|
25 | class MpdlXmlTextServer(SimpleItem): |
---|
26 | """TextServer implementation for MPDL-XML eXist server""" |
---|
27 | meta_type="MPDL-XML TextServer" |
---|
28 | |
---|
29 | manage_options=( |
---|
30 | {'label':'Config','action':'manage_changeMpdlXmlTextServerForm'}, |
---|
31 | )+SimpleItem.manage_options |
---|
32 | |
---|
33 | manage_changeMpdlXmlTextServerForm = PageTemplateFile("zpt/manage_changeMpdlXmlTextServer", globals()) |
---|
34 | |
---|
35 | def __init__(self,id,title="",serverUrl="http://mpdl-text.mpiwg-berlin.mpg.de/mpdl/interface/", serverName=None, timeout=40): |
---|
36 | """constructor""" |
---|
37 | self.id=id |
---|
38 | self.title=title |
---|
39 | self.timeout = timeout |
---|
40 | if serverName is None: |
---|
41 | self.serverUrl = serverUrl |
---|
42 | else: |
---|
43 | self.serverUrl = "http://%s/mpdl/interface/"%serverName |
---|
44 | |
---|
45 | def getHttpData(self, url, data=None): |
---|
46 | """returns result from url+data HTTP request""" |
---|
47 | return getHttpData(url,data,timeout=self.timeout) |
---|
48 | |
---|
49 | def getServerData(self, method, data=None): |
---|
50 | """returns result from text server for method+data""" |
---|
51 | url = self.serverUrl+method |
---|
52 | return getHttpData(url,data,timeout=self.timeout) |
---|
53 | |
---|
54 | |
---|
55 | def getPlacesOnPage(self, docinfo=None, pn=None): |
---|
56 | """Returns list of GIS places of page pn""" |
---|
57 | docpath = docinfo.get('textURLPath',None) |
---|
58 | if not docpath: |
---|
59 | return None |
---|
60 | |
---|
61 | places=[] |
---|
62 | text=self.getServerData("xpath.xql", "document=%s&xpath=//place&pn=%s"%(docpath,pn)) |
---|
63 | dom = ET.fromstring(text) |
---|
64 | result = dom.findall(".//resultPage/place") |
---|
65 | for l in result: |
---|
66 | id = l.get("id") |
---|
67 | name = l.text |
---|
68 | place = {'id': id, 'name': name} |
---|
69 | places.append(place) |
---|
70 | |
---|
71 | return places |
---|
72 | |
---|
73 | |
---|
74 | def getTextInfo(self, mode='', docinfo=None): |
---|
75 | """reads document info, including page concordance, from text server""" |
---|
76 | logging.debug("getTextInfo mode=%s"%mode) |
---|
77 | if mode not in ['toc', 'figures', '']: |
---|
78 | mode = '' |
---|
79 | # check cached info |
---|
80 | if mode: |
---|
81 | # cached toc-request? |
---|
82 | if 'full_%s'%mode in docinfo: |
---|
83 | return docinfo |
---|
84 | |
---|
85 | else: |
---|
86 | # no toc-request |
---|
87 | if 'numTextPages' in docinfo: |
---|
88 | return docinfo |
---|
89 | |
---|
90 | docpath = docinfo.get('textURLPath', None) |
---|
91 | if docpath is None: |
---|
92 | logging.error("getTextInfo: no textURLPath!") |
---|
93 | return docinfo |
---|
94 | |
---|
95 | # we need to set a result set size |
---|
96 | pagesize = 10000 |
---|
97 | pn = 1 |
---|
98 | # fetch docinfo |
---|
99 | pagexml = self.getServerData("doc-info.xql","document=%s&info=%s&pageSize=%s&pn=%s"%(docpath,mode,pagesize,pn)) |
---|
100 | dom = ET.fromstring(pagexml) |
---|
101 | # all info in tag <document> |
---|
102 | doc = dom.find("document") |
---|
103 | if doc is None: |
---|
104 | logging.error("getTextInfo: unable to find document-tag!") |
---|
105 | else: |
---|
106 | # go through all child elements |
---|
107 | for tag in doc: |
---|
108 | name = tag.tag |
---|
109 | # numTextPages |
---|
110 | if name == 'countPages': |
---|
111 | np = getInt(tag.text) |
---|
112 | if np > 0: |
---|
113 | docinfo['numTextPages'] = np |
---|
114 | |
---|
115 | # numFigureEntries |
---|
116 | elif name == 'countFigureEntries': |
---|
117 | docinfo['numFigureEntries'] = getInt(tag.text) |
---|
118 | |
---|
119 | # numTocEntries |
---|
120 | elif name == 'countTocEntries': |
---|
121 | # WTF: s1 = int(s)/30+1 |
---|
122 | docinfo['numTocEntries'] = getInt(tag.text) |
---|
123 | |
---|
124 | # numPlaces |
---|
125 | elif name == 'countPlaces': |
---|
126 | docinfo['numPlaces'] = getInt(tag.text) |
---|
127 | |
---|
128 | # pageNumbers |
---|
129 | elif name == 'pageNumbers': |
---|
130 | # contains tags with page numbers |
---|
131 | # <pn><n>4</n><no>4</no><non/></pn> |
---|
132 | # n=scan number, no=original page no, non=normalized original page no |
---|
133 | # pageNumbers is a dict indexed by scan number |
---|
134 | pages = {} |
---|
135 | for pn in tag: |
---|
136 | page = {} |
---|
137 | n = 0 |
---|
138 | for p in pn: |
---|
139 | if p.tag == 'n': |
---|
140 | n = getInt(p.text) |
---|
141 | page['pn'] = n |
---|
142 | elif p.tag == 'no': |
---|
143 | page['no'] = p.text |
---|
144 | elif p.tag == 'non': |
---|
145 | page['non'] = p.text |
---|
146 | |
---|
147 | if n > 0: |
---|
148 | pages[n] = page |
---|
149 | |
---|
150 | docinfo['pageNumbers'] = pages |
---|
151 | #logging.debug("got pageNumbers=%s"%repr(pages)) |
---|
152 | |
---|
153 | # toc |
---|
154 | elif name == 'toc': |
---|
155 | # contains tags with table of contents/figures |
---|
156 | # <toc-entry><page>13</page><level>3</level><content>Chapter I</content><level-string>1.</level-string><real-level>1</real-level></toc-entry> |
---|
157 | tocs = [] |
---|
158 | for te in tag: |
---|
159 | toc = {} |
---|
160 | for t in te: |
---|
161 | if t.tag == 'page': |
---|
162 | toc['pn'] = getInt(t.text) |
---|
163 | elif t.tag == 'level': |
---|
164 | toc['level'] = t.text |
---|
165 | elif t.tag == 'content': |
---|
166 | toc['content'] = t.text |
---|
167 | elif t.tag == 'level-string': |
---|
168 | toc['level-string'] = t.text |
---|
169 | elif t.tag == 'real-level': |
---|
170 | toc['real-level'] = t.text |
---|
171 | |
---|
172 | tocs.append(toc) |
---|
173 | |
---|
174 | # save as full_toc/full_figures |
---|
175 | docinfo['full_%s'%mode] = tocs |
---|
176 | |
---|
177 | return docinfo |
---|
178 | |
---|
179 | |
---|
180 | def processPageInfo(self, dom, docinfo, pageinfo): |
---|
181 | """processes page info divs from dom and stores in docinfo and pageinfo""" |
---|
182 | # assume first second level div is pageMeta |
---|
183 | alldivs = dom.find("div") |
---|
184 | |
---|
185 | if alldivs is None or alldivs.get('class', '') != 'pageMeta': |
---|
186 | logging.error("processPageInfo: pageMeta div not found!") |
---|
187 | return |
---|
188 | |
---|
189 | for div in alldivs: |
---|
190 | dc = div.get('class') |
---|
191 | |
---|
192 | # pageNumberOrig |
---|
193 | if dc == 'pageNumberOrig': |
---|
194 | pageinfo['pageNumberOrig'] = div.text |
---|
195 | |
---|
196 | # pageNumberOrigNorm |
---|
197 | elif dc == 'pageNumberOrigNorm': |
---|
198 | pageinfo['pageNumberOrigNorm'] = div.text |
---|
199 | |
---|
200 | # pageHeaderTitle |
---|
201 | elif dc == 'pageHeaderTitle': |
---|
202 | pageinfo['pageHeaderTitle'] = div.text |
---|
203 | |
---|
204 | #logging.debug("processPageInfo: pageinfo=%s"%repr(pageinfo)) |
---|
205 | return |
---|
206 | |
---|
207 | |
---|
208 | def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None): |
---|
209 | """returns single page from fulltext""" |
---|
210 | |
---|
211 | logging.debug("getTextPage mode=%s, pn=%s"%(mode,pn)) |
---|
212 | # check for cached text -- but ideally this shouldn't be called twice |
---|
213 | if pageinfo.has_key('textPage'): |
---|
214 | logging.debug("getTextPage: using cached text") |
---|
215 | return pageinfo['textPage'] |
---|
216 | |
---|
217 | docpath = docinfo.get('textURLPath', None) |
---|
218 | if not docpath: |
---|
219 | return None |
---|
220 | |
---|
221 | # just checking |
---|
222 | if pageinfo['current'] != pn: |
---|
223 | logging.warning("getTextPage: current!=pn!") |
---|
224 | |
---|
225 | # stuff for constructing full urls |
---|
226 | selfurl = docinfo['viewerUrl'] |
---|
227 | textParams = {'document': docpath, |
---|
228 | 'pn': pn} |
---|
229 | if 'characterNormalization' in pageinfo: |
---|
230 | textParams['characterNormalization'] = pageinfo['characterNormalization'] |
---|
231 | |
---|
232 | if not mode: |
---|
233 | # default is dict |
---|
234 | mode = 'text' |
---|
235 | |
---|
236 | modes = mode.split(',') |
---|
237 | # check for multiple layers |
---|
238 | if len(modes) > 1: |
---|
239 | logging.debug("getTextPage: more than one mode=%s"%mode) |
---|
240 | |
---|
241 | # search mode |
---|
242 | if 'search' in modes: |
---|
243 | # add highlighting |
---|
244 | highlightQuery = pageinfo.get('highlightQuery', None) |
---|
245 | if highlightQuery: |
---|
246 | textParams['highlightQuery'] = highlightQuery |
---|
247 | textParams['highlightElement'] = pageinfo.get('highlightElement', '') |
---|
248 | textParams['highlightElementPos'] = pageinfo.get('highlightElementPos', '') |
---|
249 | |
---|
250 | # ignore mode in the following |
---|
251 | modes.remove('search') |
---|
252 | |
---|
253 | # other modes don't combine |
---|
254 | if 'dict' in modes: |
---|
255 | # dict is called textPollux in the backend |
---|
256 | textmode = 'textPollux' |
---|
257 | elif 'xml' in modes: |
---|
258 | # xml mode |
---|
259 | textmode = 'xml' |
---|
260 | textParams['characterNormalization'] = 'orig' |
---|
261 | else: |
---|
262 | # text is default mode |
---|
263 | textmode = 'text' |
---|
264 | |
---|
265 | textParams['mode'] = textmode |
---|
266 | |
---|
267 | # fetch the page |
---|
268 | pagexml = self.getServerData("page-fragment.xql",urllib.urlencode(textParams)) |
---|
269 | dom = ET.fromstring(pagexml) |
---|
270 | # extract additional info |
---|
271 | self.processPageInfo(dom, docinfo, pageinfo) |
---|
272 | # page content is in <div class="pageContent"> |
---|
273 | pagediv = None |
---|
274 | # ElementTree 1.2 in Python 2.6 can't do div[@class='pageContent'] |
---|
275 | # so we look at the second level divs |
---|
276 | alldivs = dom.findall("div") |
---|
277 | for div in alldivs: |
---|
278 | dc = div.get('class') |
---|
279 | # page content div |
---|
280 | if dc == 'pageContent': |
---|
281 | pagediv = div |
---|
282 | break |
---|
283 | |
---|
284 | # plain text mode |
---|
285 | if textmode == "text": |
---|
286 | # get full url assuming documentViewer is parent |
---|
287 | selfurl = self.getLink() |
---|
288 | if pagediv is not None: |
---|
289 | links = pagediv.findall(".//a") |
---|
290 | for l in links: |
---|
291 | href = l.get('href') |
---|
292 | if href and href.startswith('#note-'): |
---|
293 | href = href.replace('#note-',"%s#note-"%selfurl) |
---|
294 | l.set('href', href) |
---|
295 | |
---|
296 | return serialize(pagediv) |
---|
297 | |
---|
298 | # text-with-links mode |
---|
299 | elif textmode == "textPollux": |
---|
300 | if pagediv is not None: |
---|
301 | viewerurl = docinfo['viewerUrl'] |
---|
302 | selfurl = self.getLink() |
---|
303 | # check all a-tags |
---|
304 | links = pagediv.findall(".//a") |
---|
305 | for l in links: |
---|
306 | href = l.get('href') |
---|
307 | |
---|
308 | if href: |
---|
309 | # is link with href |
---|
310 | linkurl = urlparse.urlparse(href) |
---|
311 | #logging.debug("getTextPage: linkurl=%s"%repr(linkurl)) |
---|
312 | if linkurl.path.endswith('GetDictionaryEntries'): |
---|
313 | #TODO: replace wordInfo page |
---|
314 | # is dictionary link - change href (keeping parameters) |
---|
315 | #l.set('href', href.replace('http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/interface/lt/wordInfo.xql','%s/template/viewer_wordinfo'%viewerurl)) |
---|
316 | # add target to open new page |
---|
317 | l.set('target', '_blank') |
---|
318 | |
---|
319 | # TODO: is this needed? |
---|
320 | # if href.startswith('http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/lt/lemma.xql'): |
---|
321 | # selfurl = self.absolute_url() |
---|
322 | # l.set('href', href.replace('http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/lt/lemma.xql','%s/head_main_lemma'%selfurl)) |
---|
323 | # l.set('target', '_blank') |
---|
324 | # l.set('onclick',"popupWin = window.open(this.href, 'InfoWindow', 'menubar=no, location,width=500,height=600,top=180, left=700, toolbar=no, scrollbars=1'); return false;") |
---|
325 | # l.set('ondblclick', 'popupWin.focus();') |
---|
326 | |
---|
327 | if href.startswith('#note-'): |
---|
328 | # note link |
---|
329 | l.set('href', href.replace('#note-',"%s#note-"%selfurl)) |
---|
330 | |
---|
331 | return serialize(pagediv) |
---|
332 | |
---|
333 | # xml mode |
---|
334 | elif textmode == "xml": |
---|
335 | if pagediv is not None: |
---|
336 | return serialize(pagediv) |
---|
337 | |
---|
338 | # pureXml mode |
---|
339 | elif textmode == "pureXml": |
---|
340 | if pagediv is not None: |
---|
341 | return serialize(pagediv) |
---|
342 | |
---|
343 | # gis mode |
---|
344 | elif textmode == "gis": |
---|
345 | if pagediv is not None: |
---|
346 | # check all a-tags |
---|
347 | links = pagediv.findall(".//a") |
---|
348 | # add our URL as backlink |
---|
349 | selfurl = self.getLink() |
---|
350 | doc = base64.b64encode(selfurl) |
---|
351 | for l in links: |
---|
352 | href = l.get('href') |
---|
353 | if href: |
---|
354 | if href.startswith('http://mappit.mpiwg-berlin.mpg.de'): |
---|
355 | l.set('href', re.sub(r'doc=[\w+/=]+', 'doc=%s'%doc, href)) |
---|
356 | l.set('target', '_blank') |
---|
357 | |
---|
358 | return serialize(pagediv) |
---|
359 | |
---|
360 | return None |
---|
361 | |
---|
362 | |
---|
363 | def getSearchResults(self, mode, query=None, pageinfo=None, docinfo=None): |
---|
364 | """loads list of search results and stores XML in docinfo""" |
---|
365 | |
---|
366 | logging.debug("getSearchResults mode=%s query=%s"%(mode, query)) |
---|
367 | if mode == "none": |
---|
368 | return docinfo |
---|
369 | |
---|
370 | cachedQuery = docinfo.get('cachedQuery', None) |
---|
371 | if cachedQuery is not None: |
---|
372 | # cached search result |
---|
373 | if cachedQuery == '%s_%s'%(mode,query): |
---|
374 | # same query |
---|
375 | return docinfo |
---|
376 | |
---|
377 | else: |
---|
378 | # different query |
---|
379 | del docinfo['resultSize'] |
---|
380 | del docinfo['resultXML'] |
---|
381 | |
---|
382 | # cache query |
---|
383 | docinfo['cachedQuery'] = '%s_%s'%(mode,query) |
---|
384 | |
---|
385 | # fetch full results |
---|
386 | docpath = docinfo['textURLPath'] |
---|
387 | params = {'document': docpath, |
---|
388 | 'mode': 'text', |
---|
389 | 'queryType': mode, |
---|
390 | 'query': query, |
---|
391 | 'queryResultPageSize': 1000, |
---|
392 | 'queryResultPN': 1, |
---|
393 | 'characterNormalization': pageinfo.get('characterNormalization', 'reg')} |
---|
394 | pagexml = self.getServerData("doc-query.xql",urllib.urlencode(params)) |
---|
395 | #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))) |
---|
396 | dom = ET.fromstring(pagexml) |
---|
397 | # page content is in <div class="queryResultPage"> |
---|
398 | pagediv = None |
---|
399 | # ElementTree 1.2 in Python 2.6 can't do div[@class='queryResultPage'] |
---|
400 | alldivs = dom.findall("div") |
---|
401 | for div in alldivs: |
---|
402 | dc = div.get('class') |
---|
403 | # page content div |
---|
404 | if dc == 'queryResultPage': |
---|
405 | pagediv = div |
---|
406 | |
---|
407 | elif dc == 'queryResultHits': |
---|
408 | docinfo['resultSize'] = getInt(div.text) |
---|
409 | |
---|
410 | if pagediv is not None: |
---|
411 | # store XML in docinfo |
---|
412 | docinfo['resultXML'] = ET.tostring(pagediv, 'UTF-8') |
---|
413 | |
---|
414 | return docinfo |
---|
415 | |
---|
416 | |
---|
417 | def getResultsPage(self, mode="text", query=None, pn=None, start=None, size=None, pageinfo=None, docinfo=None): |
---|
418 | """returns single page from the table of contents""" |
---|
419 | logging.debug("getResultsPage mode=%s, pn=%s"%(mode,pn)) |
---|
420 | # get (cached) result |
---|
421 | self.getSearchResults(mode=mode, query=query, pageinfo=pageinfo, docinfo=docinfo) |
---|
422 | |
---|
423 | resultxml = docinfo.get('resultXML', None) |
---|
424 | if not resultxml: |
---|
425 | logging.error("getResultPage: unable to find resultXML") |
---|
426 | return "Error: no result!" |
---|
427 | |
---|
428 | if size is None: |
---|
429 | size = pageinfo.get('resultPageSize', 10) |
---|
430 | |
---|
431 | if start is None: |
---|
432 | start = (pn - 1) * size |
---|
433 | |
---|
434 | fullresult = ET.fromstring(resultxml) |
---|
435 | |
---|
436 | if fullresult is not None: |
---|
437 | # paginate |
---|
438 | first = start-1 |
---|
439 | len = size |
---|
440 | del fullresult[:first] |
---|
441 | del fullresult[len:] |
---|
442 | tocdivs = fullresult |
---|
443 | |
---|
444 | # check all a-tags |
---|
445 | links = tocdivs.findall(".//a") |
---|
446 | for l in links: |
---|
447 | href = l.get('href') |
---|
448 | if href: |
---|
449 | # assume all links go to pages |
---|
450 | linkUrl = urlparse.urlparse(href) |
---|
451 | linkParams = urlparse.parse_qs(linkUrl.query) |
---|
452 | # take some parameters |
---|
453 | params = {'pn': linkParams['pn'], |
---|
454 | 'highlightQuery': linkParams.get('highlightQuery',''), |
---|
455 | 'highlightElement': linkParams.get('highlightElement',''), |
---|
456 | 'highlightElementPos': linkParams.get('highlightElementPos','') |
---|
457 | } |
---|
458 | url = self.getLink(params=params) |
---|
459 | l.set('href', url) |
---|
460 | |
---|
461 | return serialize(tocdivs) |
---|
462 | |
---|
463 | return "ERROR: no results!" |
---|
464 | |
---|
465 | |
---|
466 | def getToc(self, mode='text', docinfo=None): |
---|
467 | """returns list of table of contents from docinfo""" |
---|
468 | logging.debug("getToc mode=%s"%mode) |
---|
469 | if mode == 'text': |
---|
470 | queryType = 'toc' |
---|
471 | else: |
---|
472 | queryType = mode |
---|
473 | |
---|
474 | if not 'full_%s'%queryType in docinfo: |
---|
475 | # get new toc |
---|
476 | docinfo = self.getTextInfo(queryType, docinfo) |
---|
477 | |
---|
478 | return docinfo.get('full_%s'%queryType, []) |
---|
479 | |
---|
480 | def getTocPage(self, mode='text', pn=None, start=None, size=None, pageinfo=None, docinfo=None): |
---|
481 | """returns single page from the table of contents""" |
---|
482 | logging.debug("getTocPage mode=%s, pn=%s start=%s size=%s"%(mode,repr(pn),repr(start),repr(size))) |
---|
483 | fulltoc = self.getToc(mode=mode, docinfo=docinfo) |
---|
484 | if len(fulltoc) < 1: |
---|
485 | logging.error("getTocPage: unable to find toc!") |
---|
486 | return "Error: no table of contents!" |
---|
487 | |
---|
488 | if size is None: |
---|
489 | size = pageinfo.get('tocPageSize', 30) |
---|
490 | |
---|
491 | if start is None: |
---|
492 | start = (pn - 1) * size |
---|
493 | |
---|
494 | # paginate |
---|
495 | first = (start - 1) |
---|
496 | last = first + size |
---|
497 | tocs = fulltoc[first:last] |
---|
498 | tp = '<div>' |
---|
499 | for toc in tocs: |
---|
500 | pageurl = self.getLink('pn', toc['pn']) |
---|
501 | tp += '<div class="tocline">' |
---|
502 | tp += '<div class="toc name">[%s %s]</div>'%(toc['level-string'], toc['content']) |
---|
503 | tp += '<div class="toc float right page"><a href="%s">Page: %s</a></div>'%(pageurl, toc['pn']) |
---|
504 | tp += '</div>\n' |
---|
505 | |
---|
506 | tp += '</div>\n' |
---|
507 | |
---|
508 | return tp |
---|
509 | |
---|
510 | |
---|
511 | def manage_changeMpdlXmlTextServer(self,title="",serverUrl="http://mpdl-text.mpiwg-berlin.mpg.de/mpdl/interface/",timeout=40,RESPONSE=None): |
---|
512 | """change settings""" |
---|
513 | self.title=title |
---|
514 | self.timeout = timeout |
---|
515 | self.serverUrl = serverUrl |
---|
516 | if RESPONSE is not None: |
---|
517 | RESPONSE.redirect('manage_main') |
---|
518 | |
---|
519 | # management methods |
---|
520 | def manage_addMpdlXmlTextServerForm(self): |
---|
521 | """Form for adding""" |
---|
522 | pt = PageTemplateFile("zpt/manage_addMpdlXmlTextServer", globals()).__of__(self) |
---|
523 | return pt() |
---|
524 | |
---|
525 | def manage_addMpdlXmlTextServer(self,id,title="",serverUrl="http://mpdl-text.mpiwg-berlin.mpg.de/mpdl/interface/",timeout=40,RESPONSE=None): |
---|
526 | #def manage_addMpdlXmlTextServer(self,id,title="",serverUrl="http://mpdl-text.mpiwg-berlin.mpg.de:30030/mpdl/interface/",timeout=40,RESPONSE=None): |
---|
527 | """add zogiimage""" |
---|
528 | newObj = MpdlXmlTextServer(id,title,serverUrl,timeout) |
---|
529 | self.Destination()._setObject(id, newObj) |
---|
530 | if RESPONSE is not None: |
---|
531 | RESPONSE.redirect('manage_main') |
---|
532 | |
---|
533 | |
---|