version 1.140, 2010/10/18 11:51:42
|
version 1.143, 2010/10/19 09:41:04
|
Line 12 import Ft.Xml.Domlette
|
Line 12 import Ft.Xml.Domlette
|
import os.path |
import os.path |
import sys |
import sys |
import urllib |
import urllib |
|
|
import urllib2 |
import urllib2 |
import logging |
import logging |
import math |
import math |
Line 663 class documentViewer(Folder):
|
Line 662 class documentViewer(Folder):
|
presentationUrls = dom.xpath("//texttool/presentation") |
presentationUrls = dom.xpath("//texttool/presentation") |
docinfo = self.getBibinfoFromIndexMeta(url, docinfo=docinfo, dom=dom) # get info von bib tag |
docinfo = self.getBibinfoFromIndexMeta(url, docinfo=docinfo, dom=dom) # get info von bib tag |
docinfo = self.getNameFromIndexMeta(url, docinfo=docinfo, dom=dom) |
docinfo = self.getNameFromIndexMeta(url, docinfo=docinfo, dom=dom) |
docinfo =self.getOrigPages(docinfo=docinfo) |
#docinfo =self.getOrigPages(docinfo=docinfo) |
|
|
if presentationUrls and (len(presentationUrls) > 0): # ueberschreibe diese durch presentation informationen |
if presentationUrls and (len(presentationUrls) > 0): # ueberschreibe diese durch presentation informationen |
# presentation url ergiebt sich ersetzen von index.meta in der url der fuer die Metadaten |
# presentation url ergiebt sich ersetzen von index.meta in der url der fuer die Metadaten |
Line 744 class documentViewer(Folder):
|
Line 743 class documentViewer(Folder):
|
raise ValueError("Unknown mode %s! Has to be one of 'texttool','imagepath','filepath'."%(mode)) |
raise ValueError("Unknown mode %s! Has to be one of 'texttool','imagepath','filepath'."%(mode)) |
|
|
logging.debug("documentViewer (getdocinfo) docinfo: %s"%docinfo) |
logging.debug("documentViewer (getdocinfo) docinfo: %s"%docinfo) |
|
#logging.debug("documentViewer (getdocinfo) docinfo: %s"%) |
self.REQUEST.SESSION['docinfo'] = docinfo |
self.REQUEST.SESSION['docinfo'] = docinfo |
return docinfo |
return docinfo |
|
|
def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None,characterNormalization="",originalPage=None): |
def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None,characterNormalization=""): |
"""returns pageinfo with the given parameters""" |
"""returns pageinfo with the given parameters""" |
pageinfo = {} |
pageinfo = {} |
current = getInt(current) |
current = getInt(current) |
|
|
pageinfo ['originalPage'] = self.getOrigPages(docinfo=docinfo,pageinfo=pageinfo) |
|
pageinfo['current'] = current |
pageinfo['current'] = current |
rows = int(rows or self.thumbrows) |
rows = int(rows or self.thumbrows) |
pageinfo['rows'] = rows |
pageinfo['rows'] = rows |
Line 773 class documentViewer(Folder):
|
Line 771 class documentViewer(Folder):
|
pageinfo['numgroups'] += 1 |
pageinfo['numgroups'] += 1 |
pageinfo['viewMode'] = viewMode |
pageinfo['viewMode'] = viewMode |
pageinfo['tocMode'] = tocMode |
pageinfo['tocMode'] = tocMode |
#pageinfo['characterNormalization'] =characterNormalization |
pageinfo ['originalPage'] = self.getOrigPages(docinfo=None, pageinfo=None) |
pageinfo['characterNormalization'] = self.REQUEST.get('characterNormalization',' ') |
pageinfo['characterNormalization'] = self.REQUEST.get('characterNormalization',' ') |
pageinfo['query'] = self.REQUEST.get('query',' ') |
pageinfo['query'] = self.REQUEST.get('query',' ') |
pageinfo['queryType'] = self.REQUEST.get('queryType',' ') |
pageinfo['queryType'] = self.REQUEST.get('queryType',' ') |
Line 786 class documentViewer(Folder):
|
Line 784 class documentViewer(Folder):
|
toc = int (pageinfo['tocPN']) |
toc = int (pageinfo['tocPN']) |
pageinfo['textPages'] =int (toc) |
pageinfo['textPages'] =int (toc) |
|
|
logging.debug("originalPage: %s"%originalPage) |
|
|
|
if 'tocSize_%s'%tocMode in docinfo: |
if 'tocSize_%s'%tocMode in docinfo: |
tocSize = int(docinfo['tocSize_%s'%tocMode]) |
tocSize = int(docinfo['tocSize_%s'%tocMode]) |