--- documentViewer/documentViewer.py 2007/06/15 14:16:27 1.29 +++ documentViewer/documentViewer.py 2007/06/29 15:44:40 1.31 @@ -339,9 +339,15 @@ class documentViewer(Folder): bibmap=metaData.generateMappingForType(bibtype) # if there is no mapping bibmap is empty (mapping sometimes has empty fields) if len(bibmap) > 0 and len(bibmap['author'][0]) > 0: - docinfo['author']=getTextFromNode(dom.xpath("//bib/%s"%bibmap['author'][0])[0]) - docinfo['title']=getTextFromNode(dom.xpath("//bib/%s"%bibmap['title'][0])[0]) - docinfo['year']=getTextFromNode(dom.xpath("//bib/%s"%bibmap['year'][0])[0]) + try: + docinfo['author']=getTextFromNode(dom.xpath("//bib/%s"%bibmap['author'][0])[0]) + except: pass + try: + docinfo['title']=getTextFromNode(dom.xpath("//bib/%s"%bibmap['title'][0])[0]) + except: pass + try: + docinfo['year']=getTextFromNode(dom.xpath("//bib/%s"%bibmap['year'][0])[0]) + except: pass logging.debug("documentViewer (getbibinfofromindexmeta) using mapping for %s"%bibtype) try: docinfo['lang']=getTextFromNode(dom.xpath("//bib/lang")[0]) @@ -419,14 +425,17 @@ class documentViewer(Folder): textUrl=getTextFromNode(textUrls[0]) if urlparse.urlparse(textUrl)[0]=="": #keine url textUrl=os.path.join(archivePath,textUrl) - + # fix URLs starting with /mpiwg/online + if textUrl.startswith("/mpiwg/online"): + textUrl = textUrl.replace("/mpiwg/online",'',1) + docinfo['textURL'] = textUrl presentationUrls=dom.xpath("//texttool/presentation") docinfo = self.getBibinfoFromIndexMeta(url,docinfo=docinfo,dom=dom) # get info von bib tag if presentationUrls and (len(presentationUrls)>0): # ueberschreibe diese durch presentation informationen - # presentation url ergiebt sich ersetzen von index.meta in der url der fŸr die Metadaten + # presentation url ergiebt sich ersetzen von index.meta in der url der fuer die Metadaten # durch den relativen Pfad auf die presentation infos presentationUrl=url.replace('index.meta',getTextFromNode(presentationUrls[0])) docinfo = self.getBibinfoFromTextToolPresentation(presentationUrl,docinfo=docinfo,dom=dom)