Changeset 435:94baa8dbc7e8 in documentViewer for MpdlXmlTextServer.py


Ignore:
Timestamp:
Mar 1, 2011, 2:53:15 PM (13 years ago)
Author:
abukhman
Branch:
default
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MpdlXmlTextServer.py

    r434 r435  
    130130                return serializeNode(pagenode)     
    131131        return "no text here"   
    132                        
    133132           
    134133    def getGisPlaces(self, docinfo=None, pageinfo=None):
     
    202201        pagexml = self.getServerData("page-fragment.xql",textParam)
    203202        dom = Parse(pagexml)
    204        
    205203        #original Pages
    206204        pagedivs = dom.xpath("//div[@class='pageNumberOrig']")
     
    208206            if len(pagedivs)>0:
    209207                docinfo['pageNumberOrig']= getTextFromNode(pagedivs[0])
    210                 #logging.debug("ORIGINAL PAGES: %s"%(docinfo['pageNumberOrig']))
    211208       
    212209        #original Pages Norm
     
    215212            if len(pagedivs)>0:
    216213                docinfo['pageNumberOrigNorm']= getTextFromNode(pagedivs[0])
    217                 #logging.debug("ORIGINAL PAGES: %s"%(docinfo['pageNumberOrigNorm']))
    218 
    219214       
    220215        #figureEntries
     
    227222                    try:
    228223                        docinfo['countFigureEntries'] = int(s)
    229                         #logging.debug("FIGURE ENTRIES: %s"%(s))
    230224                    except:
    231225                        docinfo['countFigureEntries'] = 0
     
    234228                    try:
    235229                        docinfo['countFigureEntries'] = int(s1)
    236                         #logging.debug("FIGURE ENTRIES: %s"%(s1))
    237230                    except:
    238231                        docinfo['countFigureEntries'] = 0     
     
    246239                try:
    247240                    docinfo['countPlaces'] = int(s)
    248                     #logging.debug("PLACES HERE: %s"%(s))
    249241                except:
    250242                    docinfo['countPlaces'] = 0
     
    259251                    try:
    260252                        docinfo['countTocEntries'] = int(s)
    261                         #logging.debug("TEXT ENTRIES: %s"%(s))
    262253                    except:
    263254                        docinfo['countTocEntries'] = 0
     
    266257                    try:
    267258                        docinfo['countTocEntries'] = int(s1)
    268                         #logging.debug("TEXT ENTRIES: %s"%(s1))
    269259                    except:
    270260                        docinfo['countTocEntries'] = 0
     
    302292        if mode == "text":
    303293            # first div contains text
    304             #mode = viewMode
    305294            pagedivs = dom.xpath("/div")
    306295            if len(pagedivs) > 0:     
     
    407396         numdivs = pagedom.xpath("//div[@class='queryResultHits']")
    408397         tocSearch = int(getTextFromNode(numdivs[0]))
    409          #logging.debug("documentViewer (gettoc) tocSearch: %s"%(tocSearch))
    410398         tc=int((tocSearch/10)+1)
    411          #logging.debug("documentViewer (gettoc) tc: %s"%(tc))
    412399         return tc
    413400   
    414401    def getToc(self, mode="text", docinfo=None):
    415402        """loads table of contents and stores in docinfo"""
    416         #logging.debug("documentViewer (gettoc) mode: %s"%(mode))
    417403        if mode == "none":
    418404            return docinfo       
     
    466452        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))
    467453        text = page.replace('mode=image','mode=texttool')
    468         #logging.debug("documentViewer (characterNormalization) characterNormalization: %s"%(characterNormalization))
    469         #logging.debug("TEXT %s"%(text))
    470454        return text
    471455   
Note: See TracChangeset for help on using the changeset viewer.