--- documentViewer/documentViewer.py 2010/05/19 16:19:45 1.52 +++ documentViewer/documentViewer.py 2010/05/20 09:28:36 1.55 @@ -667,9 +667,9 @@ class documentViewer(Folder): pageinfo['querySearch'] =self.REQUEST.get('querySearch', 'fulltext') 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,6 +699,7 @@ class documentViewer(Folder): pagesize = pageinfo['queryPageSize'] pn = pageinfo['searchPN'] sn = pageinfo['sn'] + highlightQuery = pageinfo['highlightQuery'] query =pageinfo['query'] queryType =pageinfo['queryType'] viewMode= pageinfo['viewMode'] @@ -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"): @@ -880,7 +883,7 @@ class documentViewer(Folder): pagedom = Parse(pagexml) numdivs = pagedom.xpath("//div[@class='queryResultHits']") tocSearch = int(getTextFromNode(numdivs[0])) - tc=int((tocSearch/20)+1) + tc=int((tocSearch/10)+1) logging.debug("documentViewer (gettoc) tc: %s"%(tc)) return tc