Mercurial > hg > documentViewer
comparison documentViewer.py @ 331:6cde7f02786e
*** empty log message ***
author | abukhman |
---|---|
date | Mon, 18 Oct 2010 11:45:08 +0200 |
parents | c81509acead9 |
children | fdbe64b28a81 |
comparison
equal
deleted
inserted
replaced
330:c81509acead9 | 331:6cde7f02786e |
---|---|
241 | 241 |
242 if not self.digilibBaseUrl: | 242 if not self.digilibBaseUrl: |
243 self.digilibBaseUrl = self.findDigilibUrl() or "http://nausikaa.mpiwg-berlin.mpg.de/digitallibrary" | 243 self.digilibBaseUrl = self.findDigilibUrl() or "http://nausikaa.mpiwg-berlin.mpg.de/digitallibrary" |
244 | 244 |
245 docinfo = self.getDocinfo(mode=mode,url=url) | 245 docinfo = self.getDocinfo(mode=mode,url=url) |
246 pageinfo = self.getPageinfo(start=start,current=pn,docinfo=docinfo) | 246 #pageinfo = self.getPageinfo(start=start,current=pn,docinfo=docinfo) |
247 pageinfo = self.getPageinfo(start=start,current=pn, originalPage=originalPage, docinfo=docinfo) | |
248 ''' ZDES ''' | |
247 pt = getattr(self.template, 'thumbs_main_rss') | 249 pt = getattr(self.template, 'thumbs_main_rss') |
248 | 250 |
249 if viewMode=="auto": # automodus gewaehlt | 251 if viewMode=="auto": # automodus gewaehlt |
250 if docinfo.has_key("textURL") or docinfo.has_key('textURLPath'): #texturl gesetzt und textViewer konfiguriert | 252 if docinfo.has_key("textURL") or docinfo.has_key('textURLPath'): #texturl gesetzt und textViewer konfiguriert |
251 viewMode="text" | 253 viewMode="text" |
253 viewMode="images" | 255 viewMode="images" |
254 | 256 |
255 return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode) | 257 return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode) |
256 | 258 |
257 security.declareProtected('View','index_html') | 259 security.declareProtected('View','index_html') |
258 def index_html(self,url,mode="texttool",viewMode="auto",tocMode="thumbs",start=None,pn=1,mk=None, query=None, querySearch=None, characterNormalization=""): | 260 def index_html(self,url,mode="texttool",viewMode="auto",tocMode="thumbs",start=None,pn=1,mk=None, query=None, querySearch=None, characterNormalization="", originalPage=None): |
259 ''' | 261 ''' |
260 view it | 262 view it |
261 @param mode: defines how to access the document behind url | 263 @param mode: defines how to access the document behind url |
262 @param url: url which contains display information | 264 @param url: url which contains display information |
263 @param viewMode: if images display images, if text display text, default is auto (text,images or auto) | 265 @param viewMode: if images display images, if text display text, default is auto (text,images or auto) |
286 if docinfo.has_key('textURL') or docinfo.has_key('textURLPath'): #texturl gesetzt und textViewer konfiguriert | 288 if docinfo.has_key('textURL') or docinfo.has_key('textURLPath'): #texturl gesetzt und textViewer konfiguriert |
287 viewMode="text_dict" | 289 viewMode="text_dict" |
288 else: | 290 else: |
289 viewMode="images" | 291 viewMode="images" |
290 | 292 |
291 pageinfo = self.getPageinfo(start=start,current=pn,docinfo=docinfo,viewMode=viewMode,tocMode=tocMode) | 293 pageinfo = self.getPageinfo(start=start,current=pn,originalPage=originalPage, docinfo=docinfo,viewMode=viewMode,tocMode=tocMode) |
292 | 294 |
293 pt = getattr(self.template, 'viewer_main') | 295 pt = getattr(self.template, 'viewer_main') |
294 return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode,mk=self.generateMarks(mk)) | 296 return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode,mk=self.generateMarks(mk)) |
295 | 297 |
296 def generateMarks(self,mk): | 298 def generateMarks(self,mk): |
745 | 747 |
746 def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None,characterNormalization=""): | 748 def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None,characterNormalization=""): |
747 """returns pageinfo with the given parameters""" | 749 """returns pageinfo with the given parameters""" |
748 pageinfo = {} | 750 pageinfo = {} |
749 current = getInt(current) | 751 current = getInt(current) |
750 #pageinfo ['originalPage'] = originalPage | 752 pageinfo ['originalPage'] = originalPage |
751 pageinfo['current'] = current | 753 pageinfo['current'] = current |
752 rows = int(rows or self.thumbrows) | 754 rows = int(rows or self.thumbrows) |
753 pageinfo['rows'] = rows | 755 pageinfo['rows'] = rows |
754 cols = int(cols or self.thumbcols) | 756 cols = int(cols or self.thumbcols) |
755 pageinfo['cols'] = cols | 757 pageinfo['cols'] = cols |