Annotation of documentViewer/MpdlXmlTextServer.py, revision 1.145

1.2       casties     1: 
                      2: from OFS.SimpleItem import SimpleItem
                      3: from Products.PageTemplates.PageTemplateFile import PageTemplateFile 
                      4: from Ft.Xml import EMPTY_NAMESPACE, Parse
                      5: 
                      6: import sys
                      7: import logging
1.5       casties     8: import urllib
1.2       casties     9: import documentViewer
                     10: from documentViewer import getTextFromNode, serializeNode
                     11: 
                     12: class MpdlXmlTextServer(SimpleItem):
                     13:     """TextServer implementation for MPDL-XML eXist server"""
                     14:     meta_type="MPDL-XML TextServer"
                     15: 
                     16:     manage_options=(
                     17:         {'label':'Config','action':'manage_changeMpdlXmlTextServerForm'},
                     18:        )+SimpleItem.manage_options
                     19:     
                     20:     manage_changeMpdlXmlTextServerForm = PageTemplateFile("zpt/manage_changeMpdlXmlTextServer", globals())
                     21:         
1.3       casties    22:     def __init__(self,id,title="",serverUrl="http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/interface/", serverName=None, timeout=40):
1.2       casties    23:         """constructor"""
                     24:         self.id=id
                     25:         self.title=title
                     26:         self.timeout = timeout
1.3       casties    27:         if serverName is None:
                     28:             self.serverUrl = serverUrl
                     29:         else:
                     30:             self.serverUrl = "http://%s/mpdl/interface/"%serverName
1.2       casties    31:         
                     32:     def getHttpData(self, url, data=None):
                     33:         """returns result from url+data HTTP request"""
                     34:         return documentViewer.getHttpData(url,data,timeout=self.timeout)
                     35:     
                     36:     def getServerData(self, method, data=None):
                     37:         """returns result from text server for method+data"""
                     38:         url = self.serverUrl+method
                     39:         return documentViewer.getHttpData(url,data,timeout=self.timeout)
                     40: 
                     41:     def getSearch(self, pn=1, pageinfo=None,  docinfo=None, query=None, queryType=None, lemma=None):
                     42:         """get search list"""
                     43:         docpath = docinfo['textURLPath'] 
                     44:         url = docinfo['url']
1.23      abukhman   45:         logging.debug("documentViewer (gettoc) docpath: %s"%(docpath))
                     46:         logging.debug("documentViewer (gettoc) url: %s"%(url))
1.2       casties    47:         pagesize = pageinfo['queryPageSize']
                     48:         pn = pageinfo['searchPN']
                     49:         sn = pageinfo['sn']
                     50:         highlightQuery = pageinfo['highlightQuery']
1.34      abukhman   51:         query =pageinfo['query']
1.2       casties    52:         queryType =pageinfo['queryType']
                     53:         viewMode=  pageinfo['viewMode']
                     54:         tocMode = pageinfo['tocMode']
1.24      abukhman   55:         characterNormalization = pageinfo['characterNormalization']
1.2       casties    56:         tocPN = pageinfo['tocPN']
                     57:         selfurl = self.absolute_url()
                     58:         
1.41      abukhman   59:         data = self.getServerData("doc-query.xql","document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&sn=%s&viewMode=%s&highlightQuery=%s"%(docpath, 'text', queryType, urllib.quote(query), pagesize, pn, sn, viewMode,urllib.quote(highlightQuery)))
1.2       casties    60:         #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&highlightQuery=%s"%(docpath, 'text', queryType, query, pagesize, pn, sn, viewMode,highlightQuery) ,outputUnicode=False)                
                     61:         
                     62:         pagexml = data.replace('?document=%s'%str(docpath),'?url=%s'%url)
                     63:         pagedom = Parse(pagexml)
                     64:         if (queryType=="fulltext")or(queryType=="xpath")or(queryType=="xquery")or(queryType=="fulltextMorphLemma"):   
                     65:             pagedivs = pagedom.xpath("//div[@class='queryResultPage']")
                     66:             if len(pagedivs)>0:
                     67:                 pagenode=pagedivs[0]
                     68:                 links=pagenode.xpath("//a")
                     69:                 for l in links:
                     70:                     hrefNode = l.getAttributeNodeNS(None, u"href")
                     71:                     if hrefNode:
                     72:                         href = hrefNode.nodeValue
                     73:                         if href.startswith('page-fragment.xql'):
                     74:                             selfurl = self.absolute_url()            
1.30      abukhman   75:                             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,urllib.quote(query),pagesize,pn,tocMode,pn,tocPN))
1.2       casties    76:                             hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl)                                           
                     77:                 return serializeNode(pagenode)        
                     78:         if (queryType=="fulltextMorph"):
                     79:             pagedivs = pagedom.xpath("//div[@class='queryResult']")
                     80:             if len(pagedivs)>0:
                     81:                 pagenode=pagedivs[0]
                     82:                 links=pagenode.xpath("//a")
                     83:                 for l in links:
                     84:                     hrefNode = l.getAttributeNodeNS(None, u"href")
                     85:                     if hrefNode:
                     86:                         href = hrefNode.nodeValue
                     87:                         if href.startswith('page-fragment.xql'):
                     88:                             selfurl = self.absolute_url()       
1.30      abukhman   89:                             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,urllib.quote(query),pagesize,pn,tocMode,pn,tocPN))
1.2       casties    90:                             hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl)  
                     91:                         if href.startswith('../lt/lemma.xql'):
                     92:                             hrefNode.nodeValue = href.replace('../lt/lemma.xql','%s/template/head_main_lemma_New'%(selfurl))        
                     93:                             l.setAttributeNS(None, 'target', '_blank')
                     94:                             l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=400, scrollbars=1'); return false;")
1.6       abukhman   95:                             l.setAttributeNS(None, 'onClick', 'popupWin.focus();')  
1.2       casties    96:                 pagedivs = pagedom.xpath("//div[@class='queryResultMorphExpansion']")                
                     97:                 return serializeNode(pagenode)        
                     98:         if (queryType=="ftIndex")or(queryType=="ftIndexMorph"):
                     99:             pagedivs= pagedom.xpath("//div[@class='queryResultPage']")
                    100:             if len(pagedivs)>0:
                    101:                 pagenode=pagedivs[0]
                    102:                 links=pagenode.xpath("//a")
                    103:                 for l in links:
                    104:                     hrefNode = l.getAttributeNodeNS(None, u"href")
                    105:                     if hrefNode:
                    106:                         href = hrefNode.nodeValue
1.18      abukhman  107:                         hrefNode.nodeValue=href.replace('mode=text','mode=texttool&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s'%(viewMode,tocMode,tocPN,pn))             
1.2       casties   108:                         if href.startswith('../lt/lex.xql'):
                    109:                             hrefNode.nodeValue = href.replace('../lt/lex.xql','%s/template/head_main_voc'%selfurl)         
                    110:                             l.setAttributeNS(None, 'target', '_blank')
                    111:                             l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=400, scrollbars=1'); return false;")
1.6       abukhman  112:                             l.setAttributeNS(None, 'onClick', 'popupWin.focus();')
1.2       casties   113:                         if href.startswith('../lt/lemma.xql'):
                    114:                             hrefNode.nodeValue = href.replace('../lt/lemma.xql','%s/template/head_main_lemma'%selfurl)        
                    115:                             l.setAttributeNS(None, 'target', '_blank')
                    116:                             l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=400, scrollbars=1'); return false;")
1.6       abukhman  117:                             l.setAttributeNS(None, 'onClick', 'popupWin.focus();')
1.2       casties   118:                 return serializeNode(pagenode)      
                    119:         return "no text here"   
                    120:                        
1.58      abukhman  121:     """def getNumPages(self, docinfo):
                    122:         ""get list of pages from fulltext and put in docinfo""
1.2       casties   123:         if 'numPages' in docinfo:
                    124:             # already there
1.43      abukhman  125:             return docinfo        
1.2       casties   126:         xquery = '//pb'
                    127:         text = self.getServerData("xquery.xql","document=%s&xquery=%s"%(docinfo['textURLPath'],xquery))
                    128:         docinfo['numPages'] = text.count("<pb ")
                    129:         return docinfo
1.58      abukhman  130:      """
1.43      abukhman  131:     def getNumTextPages (self, docinfo):
                    132:         """get list of pages from fulltext (texts without images) and put in docinfo"""
1.56      abukhman  133:         if 'numPages' in docinfo:
1.43      abukhman  134:             # allredy there
1.56      abukhman  135:             return docinfo
                    136:         xpath ='/count(//pb)'
                    137:         text=self.getServerData("xpath.xql", "document=%s&xpath=%s"%(docinfo['textURLPath'], xpath))
                    138:         dom = Parse(text)
                    139:         result= dom.xpath("//result/resultPage")
                    140:         docinfo['numPages']=int(getTextFromNode(result[0]))
1.43      abukhman  141:         return docinfo
1.58      abukhman  142:     
1.89      abukhman  143:     def getGisPlaces(self, docinfo=None, pageinfo=None):
1.58      abukhman  144:         """ Show all Gis Places of whole Page"""
1.100     abukhman  145:         xpath='//place'
1.89      abukhman  146:         docpath = docinfo['textURLPath'] 
                    147:         url = docinfo['url']
                    148:         selfurl = self.absolute_url()
1.93      abukhman  149:         pn = pageinfo['current']
1.127     abukhman  150:         hrefList=[]
1.142     abukhman  151:         myList= ""
1.100     abukhman  152:         text=self.getServerData("xpath.xql", "document=%s&xpath=%s&pn=%s"%(docinfo['textURLPath'],xpath,pn))
                    153:         dom = Parse(text)
1.101     abukhman  154:         result = dom.xpath("//result/resultPage/place")
1.72      abukhman  155:         for l in result:
1.86      abukhman  156:             hrefNode= l.getAttributeNodeNS(None, u"id")
1.108     abukhman  157:             href= hrefNode.nodeValue
1.128     abukhman  158:             hrefList.append(href)
1.145   ! abukhman  159:             myList = ",".join(hrefList)
        !           160:         logging.debug("getGisPlaces :%s"%(myList))                             
1.143     abukhman  161:         return myList
                    162:     
                    163:     def getAllGisPlaces (self, docinfo=None, pageinfo=None):
                    164:         """Show all Gis Places of whole Book """
                    165:         xpath ='//echo:place'
                    166:         docpath =docinfo['textURLPath']
                    167:         url = docinfo['url']
                    168:         selfurl =self.absolute_url()
                    169:         pn =pageinfo['current']
                    170:         hrefList=[]
                    171:         myList=""
                    172:         text=self.getServerData("xpath.xql", "document=%s&xpath=%s"%(docinfo['textURLPath'],xpath))
                    173:         dom =Parse(text)
                    174:         result = dom.xpath("//result/resultPage/place")
                    175:         for l in result:
                    176:             hrefNode = l.getAttributeNodeNS(None, u"id")
                    177:             href= hrefNode.nodeValue
                    178:             hrefList.append(href)
1.136     abukhman  179:             myList = ",".join(hrefList)
1.145   ! abukhman  180:             logging.debug("getALLGisPlaces :%s"%(myList))
        !           181:         return myList
        !           182:     
1.58      abukhman  183:     
1.25      abukhman  184:     def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, highlightQuery=None,sn=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization=""):
1.2       casties   185:         """returns single page from fulltext"""
                    186:         docpath = docinfo['textURLPath']
                    187:         path = docinfo['textURLPath']
                    188:         url = docinfo['url']
1.73      abukhman  189:         name = docinfo['name']
1.2       casties   190:         viewMode= pageinfo['viewMode']
                    191:         tocMode = pageinfo['tocMode']
1.20      abukhman  192:         characterNormalization=pageinfo['characterNormalization']
1.2       casties   193:         tocPN = pageinfo['tocPN']
                    194:         selfurl = self.absolute_url()   
                    195:         if mode == "text_dict":
                    196:             textmode = "textPollux"
                    197:         else:
                    198:             textmode = mode
1.19      abukhman  199:         #logging.debug("documentViewer (characterNormalization) characterNormalization: %s"%(characterNormalization))
1.26      abukhman  200:         textParam = "document=%s&mode=%s&pn=%s&characterNormalization=%s"%(docpath,textmode,pn,characterNormalization)
1.2       casties   201:         if highlightQuery is not None:
1.40      abukhman  202:             textParam +="&highlightQuery=%s&sn=%s"%(urllib.quote(highlightQuery),sn)           
1.2       casties   203:         
1.38      abukhman  204:         pagexml = self.getServerData("page-fragment.xql",textParam)
1.2       casties   205:         #pagexml=self.template.fulltextclient.eval("/mpdl/interface/page-fragment.xql", textParam, outputUnicode=False)
                    206:         
1.39      abukhman  207:         pagedom = Parse(pagexml)
1.2       casties   208:         # plain text mode
                    209:         if mode == "text":
                    210:             # first div contains text
                    211:             pagedivs = pagedom.xpath("/div")
                    212:             if len(pagedivs) > 0:      
                    213:                 pagenode = pagedivs[0]
                    214:                 links = pagenode.xpath("//a")
                    215:                 for l in links:
                    216:                     hrefNode = l.getAttributeNodeNS(None, u"href")
                    217:                     if hrefNode:
                    218:                         href= hrefNode.nodeValue
                    219:                         if href.startswith('#note-'):
1.27      abukhman  220:                             hrefNode.nodeValue = href.replace('#note-',"?url=%s&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s#note-"%(url,viewMode,tocMode,tocPN,pn))
1.2       casties   221:                 return serializeNode(pagenode)
                    222:         if mode == "xml":
                    223:               # first div contains text
                    224:               pagedivs = pagedom.xpath("/div")
                    225:               if len(pagedivs) > 0:
                    226:                   pagenode = pagedivs[0]
                    227:                   return serializeNode(pagenode)
1.7       abukhman  228:         if mode == "gis":
                    229:               # first div contains text
                    230:               pagedivs = pagedom.xpath("/div")
                    231:               if len(pagedivs) > 0:
                    232:                   pagenode = pagedivs[0]
1.28      abukhman  233:                   links =pagenode.xpath("//a")
                    234:                   for l in links:
                    235:                       hrefNode =l.getAttributeNodeNS(None, u"href")
                    236:                       if hrefNode:
                    237:                           href=hrefNode.nodeValue
                    238:                           if href.startswith('http://chinagis.mpiwg-berlin.mpg.de'):
1.75      abukhman  239:                               hrefNode.nodeValue =href.replace('chinagis_REST/REST/db/chgis/mpdl','chinagis/REST/db/mpdl/%s'%name)
1.62      abukhman  240:                               l.setAttributeNS(None, 'target', '_blank') 
1.61      abukhman  241:                   return serializeNode(pagenode)
1.7       abukhman  242:                     
1.2       casties   243:         if mode == "pureXml":
                    244:               # first div contains text
                    245:               pagedivs = pagedom.xpath("/div")
                    246:               if len(pagedivs) > 0:
                    247:                   pagenode = pagedivs[0]
                    248:                   return serializeNode(pagenode)      
                    249:         # text-with-links mode
                    250:         if mode == "text_dict":
                    251:             # first div contains text
                    252:             pagedivs = pagedom.xpath("/div")
                    253:             if len(pagedivs) > 0:
                    254:                 pagenode = pagedivs[0]
                    255:                 # check all a-tags
                    256:                 links = pagenode.xpath("//a")
                    257:                 for l in links:
                    258:                     hrefNode = l.getAttributeNodeNS(None, u"href")
                    259:                     if hrefNode:
                    260:                         # is link with href
                    261:                         href = hrefNode.nodeValue
                    262:                         if href.startswith('lt/lex.xql'):
                    263:                             # is pollux link
                    264:                             selfurl = self.absolute_url()
                    265:                             # change href
                    266:                             hrefNode.nodeValue = href.replace('lt/lex.xql','%s/template/head_main_voc'%selfurl)
                    267:                             # add target
                    268:                             l.setAttributeNS(None, 'target', '_blank')
                    269:                             l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=700, scrollbars=1'); return false;")
1.6       abukhman  270:                             l.setAttributeNS(None, 'onClick', 'popupWin.focus();')      
1.2       casties   271:                         if href.startswith('lt/lemma.xql'):    
                    272:                             selfurl = self.absolute_url()
                    273:                             hrefNode.nodeValue = href.replace('lt/lemma.xql','%s/template/head_main_lemma'%selfurl)
                    274:                             l.setAttributeNS(None, 'target', '_blank')
                    275:                             l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=700, scrollbars=1'); return false;")
1.6       abukhman  276:                             l.setAttributeNS(None, 'onClick', 'popupWin.focus();')   
1.2       casties   277:                         if href.startswith('#note-'):
1.19      abukhman  278:                             hrefNode.nodeValue = href.replace('#note-',"?url=%s&viewMode=%s&tocMode=%s&tocPN=%s&pn=%s#note-"%(url,viewMode,tocMode,tocPN,pn))    
1.2       casties   279:                 return serializeNode(pagenode)
                    280:         return "no text here"
                    281: 
                    282:     def getTranslate(self, query=None, language=None):
                    283:         """translate into another languages"""
1.5       casties   284:         data = self.getServerData("lt/lex.xql","document=&language="+str(language)+"&query="+urllib.quote(query))
1.2       casties   285:         #pagexml=self.template.fulltextclient.eval("/mpdl/interface/lt/lex.xql","document=&language="+str(language)+"&query="+url_quote(str(query)))
                    286:         return data
                    287:     
                    288:     def getLemma(self, lemma=None, language=None):
                    289:         """simular words lemma """
1.5       casties   290:         data = self.getServerData("lt/lemma.xql","document=&language="+str(language)+"&lemma="+urllib.quote(lemma))
1.2       casties   291:         #pagexml=self.template.fulltextclient.eval("/mpdl/interface/lt/lemma.xql","document=&language="+str(language)+"&lemma="+url_quote(str(lemma)))
                    292:         return data
                    293:     
                    294:     def getLemmaNew(self, query=None, language=None):
                    295:         """simular words lemma """
1.5       casties   296:         data = self.getServerData("lt/lemma.xql","document=&language="+str(language)+"&lemma="+urllib.quote(query))
1.2       casties   297:         #pagexml=self.template.fulltextclient.eval("/mpdl/interface/lt/lemma.xql","document=&language="+str(language)+"&lemma="+url_quote(str(query)))
                    298:         return data
1.28      abukhman  299:     
1.2       casties   300:     def getQuery (self,  docinfo=None, pageinfo=None, query=None, queryType=None, pn=1):
                    301:          """number of"""
                    302:          docpath = docinfo['textURLPath'] 
                    303:          pagesize = pageinfo['queryPageSize']
                    304:          pn = pageinfo['searchPN']
1.34      abukhman  305:          query =pageinfo['query']
1.2       casties   306:          queryType =pageinfo['queryType']
                    307:          tocSearch = 0
                    308:          tocDiv = None
                    309:          
1.32      abukhman  310:          pagexml = self.getServerData("doc-query.xql","document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s"%(docpath, 'text', queryType, urllib.quote(query), pagesize, pn))
1.2       casties   311:          #pagexml=self.template.fulltextclient.eval("/mpdl/interface/doc-query.xql","document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s"%(docpath, 'text', queryType, query, pagesize, pn) ,outputUnicode=False)
                    312:          pagedom = Parse(pagexml)
                    313:          numdivs = pagedom.xpath("//div[@class='queryResultHits']")
                    314:          tocSearch = int(getTextFromNode(numdivs[0]))
                    315:          tc=int((tocSearch/10)+1)
1.23      abukhman  316:          logging.debug("documentViewer (gettoc) tc: %s"%(tc))
1.2       casties   317:          return tc
                    318: 
                    319:     def getToc(self, mode="text", docinfo=None):
                    320:         """loads table of contents and stores in docinfo"""
1.23      abukhman  321:         logging.debug("documentViewer (gettoc) mode: %s"%(mode))
1.2       casties   322:         if mode == "none":
                    323:             return docinfo        
                    324:         if 'tocSize_%s'%mode in docinfo:
                    325:             # cached toc
                    326:             return docinfo
                    327:         
                    328:         docpath = docinfo['textURLPath']
                    329:         # we need to set a result set size
                    330:         pagesize = 1000
                    331:         pn = 1
                    332:         if mode == "text":
                    333:             queryType = "toc"
                    334:         else:
                    335:             queryType = mode
                    336:         # number of entries in toc
                    337:         tocSize = 0
                    338:         tocDiv = None
                    339:         
                    340:         pagexml = self.getServerData("doc-query.xql","document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s"%(docpath,queryType, pagesize, pn))
                    341:         #pagexml=self.template.fulltextclient.eval("/mpdl/interface/doc-query.xql", "document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s"%(docpath,queryType,pagesize,pn), outputUnicode=False)
                    342:         # post-processing downloaded xml
                    343:         pagedom = Parse(pagexml)
                    344:         # get number of entries
                    345:         numdivs = pagedom.xpath("//div[@class='queryResultHits']")
                    346:         if len(numdivs) > 0:
                    347:             tocSize = int(getTextFromNode(numdivs[0]))
                    348:         docinfo['tocSize_%s'%mode] = tocSize
                    349:         return docinfo
                    350:     
                    351:     def getTocPage(self, mode="text", pn=1, pageinfo=None, docinfo=None):
                    352:         """returns single page from the table of contents"""
                    353:         # TODO: this should use the cached TOC
                    354:         if mode == "text":
                    355:             queryType = "toc"
                    356:         else:
                    357:             queryType = mode
                    358:         docpath = docinfo['textURLPath']
                    359:         path = docinfo['textURLPath']       
                    360:         pagesize = pageinfo['tocPageSize']
                    361:         pn = pageinfo['tocPN']
                    362:         url = docinfo['url']
                    363:         selfurl = self.absolute_url()  
                    364:         viewMode=  pageinfo['viewMode']
1.26      abukhman  365:         characterNormalization = pageinfo ['characterNormalization']
1.2       casties   366:         tocMode = pageinfo['tocMode']
                    367:         tocPN = pageinfo['tocPN']  
                    368:         
1.23      abukhman  369:         data = self.getServerData("doc-query.xql","document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s&characterNormalization=%s"%(docpath,queryType, pagesize, pn,characterNormalization))  
                    370:         page = data.replace('page-fragment.xql?document=%s'%str(path),'%s?url=%s&viewMode=%s&tocMode=%s&tocPN=%s'%(selfurl,url, viewMode, tocMode, tocPN))
1.2       casties   371:         text = page.replace('mode=image','mode=texttool')
1.21      abukhman  372:         logging.debug("documentViewer (characterNormalization) characterNormalization: %s"%(characterNormalization))
1.19      abukhman  373:         #logging.debug("documentViewer (characterNormalization) text: %s"%(text))
1.2       casties   374:         return text
                    375:     
                    376:     def manage_changeMpdlXmlTextServer(self,title="",serverUrl="http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/interface/",timeout=40,RESPONSE=None):
                    377:         """change settings"""
                    378:         self.title=title
                    379:         self.timeout = timeout
                    380:         self.serverUrl = serverUrl
                    381:         if RESPONSE is not None:
                    382:             RESPONSE.redirect('manage_main')
                    383:         
                    384: # management methods
                    385: def manage_addMpdlXmlTextServerForm(self):
                    386:     """Form for adding"""
                    387:     pt = PageTemplateFile("zpt/manage_addMpdlXmlTextServer", globals()).__of__(self)
                    388:     return pt()
                    389: 
                    390: def manage_addMpdlXmlTextServer(self,id,title="",serverUrl="http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/interface/",timeout=40,RESPONSE=None):
                    391:     """add zogiimage"""
                    392:     newObj = MpdlXmlTextServer(id,title,serverUrl,timeout)
                    393:     self.Destination()._setObject(id, newObj)
                    394:     if RESPONSE is not None:
                    395:         RESPONSE.redirect('manage_main')
                    396: 
                    397: 
1.4       casties   398:     

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