# HG changeset patch # User casties # Date 1276016256 -7200 # Node ID c6dcf12e3807787903b95569498b45db0676c7d2 # Parent 2d6c0ffcb934493b9c600cd8add335f24ee20f4c added method to get url of viewer instance fixed bug with gettoc with mode=none diff -r 2d6c0ffcb934 -r c6dcf12e3807 documentViewer.py --- a/documentViewer.py Tue Jun 01 16:31:56 2010 +0200 +++ b/documentViewer.py Tue Jun 08 18:57:36 2010 +0200 @@ -221,6 +221,10 @@ """try to get the digilib URL from zogilib""" url = self.template.zogilib.getDLBaseUrl() return url + + def getDocumentViewerURL(self): + """returns the URL of this instance""" + return self.absolute_url() def getStyle(self, idx, selected, style=""): """returns a string with the given style and append 'sel' if path == selected.""" @@ -900,9 +904,13 @@ def getToc(self, mode="text", docinfo=None): """loads table of contents and stores in docinfo""" logging.debug("documentViewer (gettoc) mode: %s"%(mode)) + if mode == "none": + return docinfo + if 'tocSize_%s'%mode in docinfo: # cached toc - return docinfo + return docinfo + docpath = docinfo['textURLPath'] # we need to set a result set size pagesize = 1000