changeset 338:0576f524e2ee

*** empty log message ***
author abukhman
date Mon, 18 Oct 2010 12:08:59 +0200
parents ee5e36c5a700
children 3cd6cb5e1e24
files MpdlXmlTextServer.py documentViewer.py
diffstat 2 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Mon Oct 18 12:01:16 2010 +0200
+++ b/MpdlXmlTextServer.py	Mon Oct 18 12:08:59 2010 +0200
@@ -178,7 +178,7 @@
             logging.debug("getALLGisPlaces :%s"%(myList))
         return myList
     
-    def getOrigPages (self, docinfo=None):
+    def getOrigPages (self, docinfo=None,pageinfo=None):
         """Show original page """
         #docpath = docinfo['textURLPath'] 
         #url = docinfo['url']
@@ -190,10 +190,10 @@
         dom =Parse(text)
         pagedivs = dom.xpath("//div[@class='pageNumberOrig']")
         if len(pagedivs)>0:
-            docinfo['originalPage'] = getTextFromNode(pagedivs[0])
+            originalPage = getTextFromNode(pagedivs[0])
             #return docinfo['originalPage']
-            #return originalPage
-            return docinfo
+            return originalPage
+            #return docinfo
         
     def getTextPage(self, mode="text", pn=1, docinfo=None, pageinfo=None, highlightQuery=None,sn=None, viewMode=None, tocMode=None, tocPN=None, characterNormalization=""):
         """returns single page from fulltext"""
--- a/documentViewer.py	Mon Oct 18 12:01:16 2010 +0200
+++ b/documentViewer.py	Mon Oct 18 12:08:59 2010 +0200
@@ -243,8 +243,8 @@
             self.digilibBaseUrl = self.findDigilibUrl() or "http://nausikaa.mpiwg-berlin.mpg.de/digitallibrary"
             
         docinfo = self.getDocinfo(mode=mode,url=url)
-        pageinfo = self.getPageinfo(start=start,current=pn,docinfo=docinfo)
-        #pageinfo = self.getPageinfo(start=start,current=pn, originalPage=originalPage, docinfo=docinfo)
+        #pageinfo = self.getPageinfo(start=start,current=pn,docinfo=docinfo)
+        pageinfo = self.getPageinfo(start=start,current=pn, originalPage=originalPage, docinfo=docinfo)
         ''' ZDES '''
         pt = getattr(self.template, 'thumbs_main_rss')
         
@@ -290,7 +290,7 @@
             else:
                 viewMode="images"
                 
-        pageinfo = self.getPageinfo(start=start,current=pn, docinfo=docinfo,viewMode=viewMode,tocMode=tocMode)
+        pageinfo = self.getPageinfo(start=start,current=pn, docinfo=docinfo,viewMode=viewMode,tocMode=tocMode, originalPage=originalPage)
         
         pt = getattr(self.template, 'viewer_main')               
         return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode,mk=self.generateMarks(mk))
@@ -662,7 +662,7 @@
         presentationUrls = dom.xpath("//texttool/presentation")
         docinfo = self.getBibinfoFromIndexMeta(url, docinfo=docinfo, dom=dom)   # get info von bib tag
         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 
              # presentation url ergiebt sich ersetzen von index.meta in der url der fuer die Metadaten
@@ -746,11 +746,12 @@
         self.REQUEST.SESSION['docinfo'] = docinfo
         return docinfo
                
-    def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None,characterNormalization=""):
+    def getPageinfo(self, current, start=None, rows=None, cols=None, docinfo=None, viewMode=None, tocMode=None,characterNormalization="", originalPage=None):
         """returns pageinfo with the given parameters"""
         pageinfo = {}
         current = getInt(current)
-        #pageinfo ['originalPage'] = originalPage
+    
+        pageinfo ['originalPage'] = originalPage
         pageinfo['current'] = current
         rows = int(rows or self.thumbrows)
         pageinfo['rows'] = rows