changeset 434:44ccb7bd0938

*** empty log message ***
author abukhman
date Thu, 24 Feb 2011 14:55:28 +0100
parents 24fc850a35e6
children 94baa8dbc7e8
files MpdlXmlTextServer.py documentViewer.py
diffstat 2 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Fri Feb 18 12:21:46 2011 +0100
+++ b/MpdlXmlTextServer.py	Thu Feb 24 14:55:28 2011 +0100
@@ -183,8 +183,6 @@
         url = docinfo.get('url',None)
         name = docinfo.get('name',None)
         pn =pageinfo['current']
-        #viewMode= pageinfo['viewMode']
-        
         sn = pageinfo['sn']
         highlightQuery = pageinfo['highlightQuery']
         #mode = pageinfo ['viewMode']
@@ -209,14 +207,14 @@
         if pagedivs == dom.xpath("//div[@class='pageNumberOrig']"):
             if len(pagedivs)>0:
                 docinfo['pageNumberOrig']= getTextFromNode(pagedivs[0])
-                logging.debug("ORIGINAL PAGES: %s"%(docinfo['pageNumberOrig']))
+                #logging.debug("ORIGINAL PAGES: %s"%(docinfo['pageNumberOrig']))
         
         #original Pages Norm
         pagedivs = dom.xpath("//div[@class='pageNumberOrigNorm']")
         if pagedivs == dom.xpath("//div[@class='pageNumberOrigNorm']"):
             if len(pagedivs)>0:
                 docinfo['pageNumberOrigNorm']= getTextFromNode(pagedivs[0])
-                logging.debug("ORIGINAL PAGES: %s"%(docinfo['pageNumberOrigNorm']))
+                #logging.debug("ORIGINAL PAGES: %s"%(docinfo['pageNumberOrigNorm']))
 
         
         #figureEntries
@@ -228,14 +226,14 @@
                 if s=='0':
                     try:
                         docinfo['countFigureEntries'] = int(s)
-                        logging.debug("FIGURE ENTRIES: %s"%(s))
+                        #logging.debug("FIGURE ENTRIES: %s"%(s))
                     except:
                         docinfo['countFigureEntries'] = 0
                 else:
                     s1 = int(s)/30+1
                     try:
                         docinfo['countFigureEntries'] = int(s1)
-                        logging.debug("FIGURE ENTRIES: %s"%(s1))
+                        #logging.debug("FIGURE ENTRIES: %s"%(s1))
                     except:
                         docinfo['countFigureEntries'] = 0      
         
@@ -247,7 +245,7 @@
                 s = getTextFromNode(pagedivs[0])
                 try:
                     docinfo['countPlaces'] = int(s)
-                    logging.debug("PLACES HERE: %s"%(s))
+                    #logging.debug("PLACES HERE: %s"%(s))
                 except:
                     docinfo['countPlaces'] = 0
         
@@ -260,14 +258,14 @@
                 if s=='0':
                     try:
                         docinfo['countTocEntries'] = int(s)
-                        logging.debug("TEXT ENTRIES: %s"%(s))
+                        #logging.debug("TEXT ENTRIES: %s"%(s))
                     except:
                         docinfo['countTocEntries'] = 0
                 else:
                     s1 = int(s)/30+1
                     try:
                         docinfo['countTocEntries'] = int(s1)
-                        logging.debug("TEXT ENTRIES: %s"%(s1))
+                        #logging.debug("TEXT ENTRIES: %s"%(s1))
                     except:
                         docinfo['countTocEntries'] = 0
         
@@ -280,7 +278,7 @@
                 
                 try:
                     docinfo['numPages'] = int(s)
-                    logging.debug("PAGE NUMBER: %s"%(s))
+                    #logging.debug("PAGE NUMBER: %s"%(s))
                 
                     np = docinfo['numPages']
                     pageinfo['end'] = min(pageinfo['end'], np)
@@ -408,14 +406,14 @@
          pagedom = Parse(pagexml)
          numdivs = pagedom.xpath("//div[@class='queryResultHits']")
          tocSearch = int(getTextFromNode(numdivs[0]))
-         logging.debug("documentViewer (gettoc) tocSearch: %s"%(tocSearch))
+         #logging.debug("documentViewer (gettoc) tocSearch: %s"%(tocSearch))
          tc=int((tocSearch/10)+1)
-         logging.debug("documentViewer (gettoc) tc: %s"%(tc))
+         #logging.debug("documentViewer (gettoc) tc: %s"%(tc))
          return tc
     
     def getToc(self, mode="text", docinfo=None):
         """loads table of contents and stores in docinfo"""
-        logging.debug("documentViewer (gettoc) mode: %s"%(mode))
+        #logging.debug("documentViewer (gettoc) mode: %s"%(mode))
         if mode == "none":
             return docinfo        
         if 'tocSize_%s'%mode in docinfo:
@@ -468,7 +466,7 @@
         page = data.replace('page-fragment.xql?document=%s'%str(path),'%s?url=%s&viewMode=%s&tocMode=%s&tocPN=%s&optionToggle=1'%(selfurl,url, viewMode, tocMode, tocPN))
         text = page.replace('mode=image','mode=texttool')
         #logging.debug("documentViewer (characterNormalization) characterNormalization: %s"%(characterNormalization))
-        logging.debug("TEXT %s"%(text))
+        #logging.debug("TEXT %s"%(text))
         return text
     
     def manage_changeMpdlXmlTextServer(self,title="",serverUrl="http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/interface/",timeout=40,RESPONSE=None):
--- a/documentViewer.py	Fri Feb 18 12:21:46 2011 +0100
+++ b/documentViewer.py	Thu Feb 24 14:55:28 2011 +0100
@@ -766,6 +766,8 @@
         if textUrls and (len(textUrls) > 0):
             textUrl = getTextFromNode(textUrls[0])
             docinfo['textURLPath'] = textUrl
+            textUrlkurz = string.split(textUrl, ".")[0]
+            docinfo['textURLPathkurz'] = textUrlkurz
             #if not docinfo['imagePath']:
                 # text-only, no page images
                 #docinfo = self.getNumTextPages(docinfo)