Changeset 435:94baa8dbc7e8 in documentViewer for MpdlXmlTextServer.py
- Timestamp:
- Mar 1, 2011, 2:53:15 PM (13 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MpdlXmlTextServer.py
r434 r435 130 130 return serializeNode(pagenode) 131 131 return "no text here" 132 133 132 134 133 def getGisPlaces(self, docinfo=None, pageinfo=None): … … 202 201 pagexml = self.getServerData("page-fragment.xql",textParam) 203 202 dom = Parse(pagexml) 204 205 203 #original Pages 206 204 pagedivs = dom.xpath("//div[@class='pageNumberOrig']") … … 208 206 if len(pagedivs)>0: 209 207 docinfo['pageNumberOrig']= getTextFromNode(pagedivs[0]) 210 #logging.debug("ORIGINAL PAGES: %s"%(docinfo['pageNumberOrig']))211 208 212 209 #original Pages Norm … … 215 212 if len(pagedivs)>0: 216 213 docinfo['pageNumberOrigNorm']= getTextFromNode(pagedivs[0]) 217 #logging.debug("ORIGINAL PAGES: %s"%(docinfo['pageNumberOrigNorm']))218 219 214 220 215 #figureEntries … … 227 222 try: 228 223 docinfo['countFigureEntries'] = int(s) 229 #logging.debug("FIGURE ENTRIES: %s"%(s))230 224 except: 231 225 docinfo['countFigureEntries'] = 0 … … 234 228 try: 235 229 docinfo['countFigureEntries'] = int(s1) 236 #logging.debug("FIGURE ENTRIES: %s"%(s1))237 230 except: 238 231 docinfo['countFigureEntries'] = 0 … … 246 239 try: 247 240 docinfo['countPlaces'] = int(s) 248 #logging.debug("PLACES HERE: %s"%(s))249 241 except: 250 242 docinfo['countPlaces'] = 0 … … 259 251 try: 260 252 docinfo['countTocEntries'] = int(s) 261 #logging.debug("TEXT ENTRIES: %s"%(s))262 253 except: 263 254 docinfo['countTocEntries'] = 0 … … 266 257 try: 267 258 docinfo['countTocEntries'] = int(s1) 268 #logging.debug("TEXT ENTRIES: %s"%(s1))269 259 except: 270 260 docinfo['countTocEntries'] = 0 … … 302 292 if mode == "text": 303 293 # first div contains text 304 #mode = viewMode305 294 pagedivs = dom.xpath("/div") 306 295 if len(pagedivs) > 0: … … 407 396 numdivs = pagedom.xpath("//div[@class='queryResultHits']") 408 397 tocSearch = int(getTextFromNode(numdivs[0])) 409 #logging.debug("documentViewer (gettoc) tocSearch: %s"%(tocSearch))410 398 tc=int((tocSearch/10)+1) 411 #logging.debug("documentViewer (gettoc) tc: %s"%(tc))412 399 return tc 413 400 414 401 def getToc(self, mode="text", docinfo=None): 415 402 """loads table of contents and stores in docinfo""" 416 #logging.debug("documentViewer (gettoc) mode: %s"%(mode))417 403 if mode == "none": 418 404 return docinfo … … 466 452 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)) 467 453 text = page.replace('mode=image','mode=texttool') 468 #logging.debug("documentViewer (characterNormalization) characterNormalization: %s"%(characterNormalization))469 #logging.debug("TEXT %s"%(text))470 454 return text 471 455
Note: See TracChangeset
for help on using the changeset viewer.