--- documentViewer/MpdlXmlTextServer.py 2010/09/23 14:49:47 1.30 +++ documentViewer/MpdlXmlTextServer.py 2010/10/15 14:06:50 1.159 @@ -42,8 +42,6 @@ class MpdlXmlTextServer(SimpleItem): """get search list""" docpath = docinfo['textURLPath'] url = docinfo['url'] - logging.debug("documentViewer (gettoc) docpath: %s"%(docpath)) - logging.debug("documentViewer (gettoc) url: %s"%(url)) pagesize = pageinfo['queryPageSize'] pn = pageinfo['searchPN'] sn = pageinfo['sn'] @@ -56,7 +54,7 @@ class MpdlXmlTextServer(SimpleItem): tocPN = pageinfo['tocPN'] selfurl = self.absolute_url() - 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,highlightQuery)) + 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))) #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 = data.replace('?document=%s'%str(docpath),'?url=%s'%url) @@ -118,23 +116,90 @@ class MpdlXmlTextServer(SimpleItem): return serializeNode(pagenode) return "no text here" - def getNumPages(self, docinfo): - """get list of pages from fulltext and put in docinfo""" + """def getNumPages(self, docinfo): + ""get list of pages from fulltext and put in docinfo"" if 'numPages' in docinfo: # already there - return docinfo - + return docinfo xquery = '//pb' text = self.getServerData("xquery.xql","document=%s&xquery=%s"%(docinfo['textURLPath'],xquery)) - #text = self.template.fulltextclient.eval("/mpdl/interface/xquery.xql", "document=%s&xquery=%s"%(docinfo['textURLPath'],xquery)) docinfo['numPages'] = text.count("