--- documentViewer/documentViewer.py 2010/10/05 12:25:32 1.101 +++ documentViewer/documentViewer.py 2010/10/08 13:09:29 1.104 @@ -532,6 +532,28 @@ class documentViewer(Folder): return docinfo + + def getNameFromIndexMeta(self,path,docinfo=None,dom=None,cut=0): + """gets name info from the index.meta file at path or given by dom""" + if docinfo is None: + docinfo = {} + + if dom is None: + for x in range(cut): + path=getParentDir(path) + dom = self.getDomFromIndexMeta(path) + + docinfo['indexMetaPath']=self.getIndexMetaPath(path); + + result= dom.xpath("//result/resultPage") + docinfo['numPages']=int(getTextFromNode(result[0])) + + if len(bibmap) > 0 and len(bibmap['author'][0]) > 0: + try: + docinfo['name']=getTextFromNode(dom.xpath("//name")) + except: pass + #logging.debug("documentViewer (getbibinfofromindexmeta) using mapping for %s"%bibtype) + return docinfo def getDocinfoFromTextTool(self, url, dom=None, docinfo=None): """parse texttool tag in index meta""" @@ -615,7 +637,7 @@ class documentViewer(Folder): docinfo['textURLPath'] = textUrl if not docinfo['imagePath']: # text-only, no page images - docinfo = self.getTextPages(docinfo) + docinfo = self.getNumTextPages(docinfo) presentationUrls = dom.xpath("//texttool/presentation") docinfo = self.getBibinfoFromIndexMeta(url, docinfo=docinfo, dom=dom) # get info von bib tag