--- documentViewer/MpdlXmlTextServer.py 2010/10/25 12:13:22 1.197 +++ documentViewer/MpdlXmlTextServer.py 2010/10/26 16:47:20 1.200 @@ -178,6 +178,18 @@ class MpdlXmlTextServer(SimpleItem): logging.debug("getALLGisPlaces :%s"%(myList)) return myList + + def getPDF (self, docinfo=None, pageinfo=None): + """Show and Save different Pages as PDF in Options""" + selfurl=self.absolute_url() + pn=pageinfo['current'] + viewmode =pageinfo['viewMode'] + text = self.getServerData("page-fragment.xql", "document=%s&mode=%s&pn=%s&export=%s"(docinfo['textURLPath'],mode, pn,'pdf')) + dom =Parse(text) + logging.debug("dom :%s"%(dom)) + return dom + + def getOrigPages (self, docinfo=None, pageinfo=None): """Show original page """ docpath = docinfo['textURLPath'] @@ -196,7 +208,7 @@ class MpdlXmlTextServer(SimpleItem): return originalPage - def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization=""): + def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization="", highlightQuery=None, sn=None): """returns single page from fulltext""" docpath = docinfo['textURLPath'] path = docinfo['textURLPath'] @@ -218,8 +230,9 @@ class MpdlXmlTextServer(SimpleItem): textParam = "document=%s&mode=%s&pn=%s&characterNormalization=%s"%(docpath,textmode,pn,characterNormalization) if highlightQuery is not None: textParam +="&highlightQuery=%s&sn=%s"%(urllib.quote(highlightQuery),sn) - logging.debug("documentViewer highlightQuery: %s"%(highlightQuery)) + #logging.debug("documentViewer highlightQuery: %s"%(highlightQuery)) pagexml = self.getServerData("page-fragment.xql",textParam) + logging.debug("documentViewer highlightQuery: %s"%(highlightQuery)) #pagexml=self.template.fulltextclient.eval("/mpdl/interface/page-fragment.xql", textParam, outputUnicode=False) pagedom = Parse(pagexml)