comparison documentViewer.py @ 126:c6dcf12e3807

added method to get url of viewer instance fixed bug with gettoc with mode=none
author casties
date Tue, 08 Jun 2010 18:57:36 +0200
parents 10d10e0db919
children 49f381f896d0
comparison
equal deleted inserted replaced
125:2d6c0ffcb934 126:c6dcf12e3807
219 219
220 def findDigilibUrl(self): 220 def findDigilibUrl(self):
221 """try to get the digilib URL from zogilib""" 221 """try to get the digilib URL from zogilib"""
222 url = self.template.zogilib.getDLBaseUrl() 222 url = self.template.zogilib.getDLBaseUrl()
223 return url 223 return url
224
225 def getDocumentViewerURL(self):
226 """returns the URL of this instance"""
227 return self.absolute_url()
224 228
225 def getStyle(self, idx, selected, style=""): 229 def getStyle(self, idx, selected, style=""):
226 """returns a string with the given style and append 'sel' if path == selected.""" 230 """returns a string with the given style and append 'sel' if path == selected."""
227 #logger("documentViewer (getstyle)", logging.INFO, "idx: %s selected: %s style: %s"%(idx,selected,style)) 231 #logger("documentViewer (getstyle)", logging.INFO, "idx: %s selected: %s style: %s"%(idx,selected,style))
228 if idx == selected: 232 if idx == selected:
898 return tc 902 return tc
899 903
900 def getToc(self, mode="text", docinfo=None): 904 def getToc(self, mode="text", docinfo=None):
901 """loads table of contents and stores in docinfo""" 905 """loads table of contents and stores in docinfo"""
902 logging.debug("documentViewer (gettoc) mode: %s"%(mode)) 906 logging.debug("documentViewer (gettoc) mode: %s"%(mode))
907 if mode == "none":
908 return docinfo
909
903 if 'tocSize_%s'%mode in docinfo: 910 if 'tocSize_%s'%mode in docinfo:
904 # cached toc 911 # cached toc
905 return docinfo 912 return docinfo
913
906 docpath = docinfo['textURLPath'] 914 docpath = docinfo['textURLPath']
907 # we need to set a result set size 915 # we need to set a result set size
908 pagesize = 1000 916 pagesize = 1000
909 pn = 1 917 pn = 1
910 if mode == "text": 918 if mode == "text":