--- documentViewer/documentViewer.py 2010/05/19 16:24:16 1.53 +++ documentViewer/documentViewer.py 2010/05/21 09:44:29 1.58 @@ -659,17 +659,17 @@ class documentViewer(Folder): if np % grpsize > 0: pageinfo['numgroups'] += 1 - + #pageinfo['viewMode'] = viewMode pageinfo['viewMode'] = viewMode pageinfo['tocMode'] = tocMode pageinfo['query'] = self.REQUEST.get('query',' ') pageinfo['queryType'] = self.REQUEST.get('queryType',' ') pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext') - + pageinfo['sn'] = self.REQUEST.get('sn','') pageinfo['textPN'] = self.REQUEST.get('textPN','1') - + pageinfo['highlightQuery'] = self.REQUEST.get('highlightQuery','') pageinfo['tocPageSize'] = self.REQUEST.get('tocPageSize', '30') - pageinfo['queryPageSize'] =self.REQUEST.get('queryPageSize', '20') + pageinfo['queryPageSize'] =self.REQUEST.get('queryPageSize', '10') pageinfo['tocPN'] = self.REQUEST.get('tocPN', '1') toc = int (pageinfo['tocPN']) pageinfo['textPages'] =int (toc) @@ -699,14 +699,15 @@ class documentViewer(Folder): pagesize = pageinfo['queryPageSize'] pn = pageinfo['searchPN'] sn = pageinfo['sn'] + highlightQuery = pageinfo['highlightQuery'] query =pageinfo['query'] queryType =pageinfo['queryType'] viewMode= pageinfo['viewMode'] tocMode = pageinfo['tocMode'] tocPN = pageinfo['tocPN'] selfurl = self.absolute_url() - logging.debug("documentViewer (gettoc) /mpdl/interface/doc-query.xql?document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&sn=%s&viewMode=%s"%(docpath, 'text', queryType, query, pagesize, pn, sn, viewMode)) - 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"%(docpath, 'text', queryType, query, pagesize, pn, sn, viewMode) ,outputUnicode=False) + # logging.debug("documentViewer (gettoc) /mpdl/interface/doc-query.xql?document=%s&mode=%s&queryType=%s&query=%s&queryResultPageSize=%s&queryResultPN=%s&sn=%s&viewMode=%s"%(docpath, 'text', queryType, query, pagesize, pn, sn, viewMode)) + 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) pagexml = page.replace('?document=%s'%str(docpath),'?url=%s'%url) pagedom = Parse(pagexml) if (queryType=="fulltext")or(queryType=="xpath")or(queryType=="xquery")or(queryType=="fulltextMorphLemma"): @@ -723,7 +724,9 @@ class documentViewer(Folder): #l.setAttributeNS(None, "span class = 'hit highlight'", "background-color: #77DD77;") 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,query,pagesize,pn,tocMode,pn,tocPN)) hrefNode.nodeValue = pagexml.replace('page-fragment.xql','%s'%selfurl) - l.setAttributeNS(None, "onClick", "id='highlighting'") + l.setAttributeNS(None, "onClick", "id='highlighting'") + logging.debug("documentViewer (gettoc) highlightQuery: %s"%(highlightQuery)) + l.setAttributeNS(None, highlightQuery, "id='highlighting'") return serializeNode(pagenode) if (queryType=="fulltextMorph"): @@ -761,13 +764,13 @@ class documentViewer(Folder): if href.startswith('../lt/lex.xql'): # selfurl = self.absolute_url() - hrefNode.nodeValue = href.replace('../lt/lex.xql','%s../template/head_main_voc'%selfurl) + hrefNode.nodeValue = href.replace('../lt/lex.xql','%s/template/head_main_voc'%selfurl) l.setAttributeNS(None, 'target', '_blank') l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=400, scrollbars=1'); return false;") l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();') if href.startswith('../lt/lemma.xql'): #selfurl = self.absolute_url() - hrefNode.nodeValue = href.replace('../lt/lemma.xql','%s../template/head_main_lemma'%selfurl) + hrefNode.nodeValue = href.replace('../lt/lemma.xql','%s/template/head_main_lemma'%selfurl) l.setAttributeNS(None, 'target', '_blank') l.setAttributeNS(None, 'onClick',"popupWin = window.open(this.href, 'contacts', 'location,width=500,height=600,top=180, left=400, scrollbars=1'); return false;") l.setAttributeNS(None, 'onDblclick', 'popupWin.focus();') @@ -782,9 +785,10 @@ class documentViewer(Folder): docinfo['numPages'] = text.count("