Mercurial > hg > documentViewer
changeset 398:55f9eeebc338
*** empty log message ***
author | abukhman |
---|---|
date | Tue, 09 Nov 2010 12:38:25 +0100 |
parents | 5b078a6d8909 |
children | 8abb09665ae5 |
files | MpdlXmlTextServer.py documentViewer.py |
diffstat | 2 files changed, 8 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/MpdlXmlTextServer.py Mon Nov 08 17:08:18 2010 +0100 +++ b/MpdlXmlTextServer.py Tue Nov 09 12:38:25 2010 +0100 @@ -38,7 +38,7 @@ url = self.serverUrl+method return documentViewer.getHttpData(url,data,timeout=self.timeout) - def getSearch(self, pn=1, pageinfo=None, docinfo=None, query=None, queryType=None, lemma=None, characterNormalization=None, optionsClose=None): + def getSearch(self, pn=1, pageinfo=None, docinfo=None, query=None, queryType=None, lemma=None, characterNormalization=None, optionToggle=None): """get search list""" docpath = docinfo['textURLPath'] url = docinfo['url'] @@ -214,7 +214,7 @@ return originalPage - def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization="", highlightQuery=None, sn=None, optionsClose=None): + def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization="", highlightQuery=None, sn=None, optionToggle=None): """returns single page from fulltext""" docpath = docinfo['textURLPath'] path = docinfo['textURLPath'] @@ -334,7 +334,7 @@ #pagexml=self.template.fulltextclient.eval("/mpdl/interface/lt/lemma.xql","document=&language="+str(language)+"&lemma="+url_quote(str(query))) return data - def getQuery (self, docinfo=None, pageinfo=None, query=None, queryType=None, pn=1, optionsClose=None): + def getQuery (self, docinfo=None, pageinfo=None, query=None, queryType=None, pn=1, optionToggle=None): """number of""" docpath = docinfo['textURLPath'] pagesize = pageinfo['queryPageSize'] @@ -458,10 +458,11 @@ selfurl = self.absolute_url() viewMode= pageinfo['viewMode'] characterNormalization = pageinfo ['characterNormalization'] + optionToggle =pageinfo ['optionToggle'] tocMode = pageinfo['tocMode'] tocPN = pageinfo['tocPN'] - data = self.getServerData("doc-query.xql","document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s&characterNormalization=%s"%(docpath,queryType, pagesize, pn,characterNormalization)) + data = self.getServerData("doc-query.xql","document=%s&queryType=%s&queryResultPageSize=%s&queryResultPN=%s&characterNormalization=%s&optionToggle=%s"%(docpath,queryType, pagesize, pn,characterNormalization,optionToggle)) page = data.replace('page-fragment.xql?document=%s'%str(path),'%s?url=%s&viewMode=%s&tocMode=%s&tocPN=%s'%(selfurl,url, viewMode, tocMode, tocPN)) text = page.replace('mode=image','mode=texttool') logging.debug("documentViewer (characterNormalization) characterNormalization: %s"%(characterNormalization))
--- a/documentViewer.py Mon Nov 08 17:08:18 2010 +0100 +++ b/documentViewer.py Tue Nov 09 12:38:25 2010 +0100 @@ -290,7 +290,7 @@ return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode) security.declareProtected('View','index_html') - def index_html(self,url,mode="texttool",viewMode="auto",tocMode="thumbs",start=None,pn=1,mk=None, query=None, querySearch=None, characterNormalization="", optionsClose=None): + def index_html(self,url,mode="texttool",viewMode="auto",tocMode="thumbs",start=None,pn=1,mk=None, query=None, querySearch=None, characterNormalization="", optionToggle=None): ''' view it @param mode: defines how to access the document behind url @@ -826,8 +826,8 @@ pageinfo['viewMode'] = viewMode pageinfo['tocMode'] = tocMode pageinfo['characterNormalization'] = self.REQUEST.get('characterNormalization','') - pageinfo['query'] = self.REQUEST.get('query','') - pageinfo['optionsClose']= self.REQUEST.get('optionsClose','') + pageinfo['optionToggle'] = self.REQUEST.get('optionToggle','') + pageinfo['query'] = self.REQUEST.get('query','') pageinfo['queryType'] = self.REQUEST.get('queryType','') pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext') pageinfo['textPN'] = self.REQUEST.get('textPN','1')