Diff for /documentViewer/documentViewer.py between versions 1.175.2.1 and 1.175.2.2

version 1.175.2.1, 2011/07/14 17:43:56 version 1.175.2.2, 2011/07/15 09:02:26
Line 499  class documentViewer(Folder): Line 499  class documentViewer(Folder):
             docinfo = {}              docinfo = {}
                   
         for x in range(cut):          for x in range(cut):
                  
                 path=getParentDir(path)                  path=getParentDir(path)
                 
         infoUrl=self.digilibBaseUrl+"/dirInfo-xml.jsp?mo=dir&fn="+path          infoUrl=self.digilibBaseUrl+"/dirInfo-xml.jsp?mo=dir&fn="+path
Line 630  class documentViewer(Folder): Line 629  class documentViewer(Folder):
                   
         logging.debug("documentViewer (getbibinfofromindexmeta cutted) path: %s"%(path))          logging.debug("documentViewer (getbibinfofromindexmeta cutted) path: %s"%(path))
         # put in all raw bib fields as dict "bib"          # put in all raw bib fields as dict "bib"
         bib = dom.find(".//bib/*")          bib = dom.find(".//bib")
         #bib = dom.xpath("//bib/*")          #bib = dom.xpath("//bib/*")
         if bib and len(bib)>0:          if bib is not None:
             bibinfo = {}              bibinfo = {}
             for e in bib:              for e in bib:
                 bibinfo[e.localName] = getTextFromNode(e)                  bibinfo[e.tag] = getText(e)
                   
             docinfo['bib'] = bibinfo              docinfo['bib'] = bibinfo
                   
         # extract some fields (author, title, year) according to their mapping          # extract some fields (author, title, year) according to their mapping
         metaData=self.metadata.main.meta.bib          metaData=self.metadata.main.meta.bib
         bib = dom.find(".//bib")  
         bibtype=bib.get("type")          bibtype=bib.get("type")
         #bibtype=dom.xpath("//bib/@type")          #bibtype=dom.xpath("//bib/@type")
         if not bibtype:          if not bibtype:
Line 712  class documentViewer(Folder): Line 711  class documentViewer(Folder):
         return docinfo          return docinfo
           
             
       # TODO: is this needed?
     def getNameFromIndexMeta(self,path,docinfo=None,dom=None,cut=0):      def getNameFromIndexMeta(self,path,docinfo=None,dom=None,cut=0):
         """gets name info from the index.meta file at path or given by dom"""          """gets name info from the index.meta file at path or given by dom"""
         if docinfo is None:          if docinfo is None:
Line 739  class documentViewer(Folder): Line 739  class documentViewer(Folder):
         archivePath = None          archivePath = None
         archiveName = None          archiveName = None
           
         archiveName = getTextFromNode(dom.find("name"))          archiveName = getText(dom.find("name"))
         if not archiveName:          if not archiveName:
             logging.warning("documentViewer (getdocinfofromtexttool) resource/name missing in: %s" % (url))              logging.warning("documentViewer (getdocinfofromtexttool) resource/name missing in: %s" % (url))
                   
         archivePath = getTextFromNode(dom.find("archive-path"))          archivePath = getText(dom.find("archive-path"))
         if archivePath:          if archivePath:
             # clean up archive path              # clean up archive path
             if archivePath[0] != '/':              if archivePath[0] != '/':
Line 807  class documentViewer(Folder): Line 807  class documentViewer(Folder):
                     
         presentationUrl = getText(dom.find(".//texttool/presentation"))          presentationUrl = getText(dom.find(".//texttool/presentation"))
         docinfo = self.getBibinfoFromIndexMeta(url, docinfo=docinfo, dom=dom)   # get info von bib tag          docinfo = self.getBibinfoFromIndexMeta(url, docinfo=docinfo, dom=dom)   # get info von bib tag
           # TODO: is this needed here?
         docinfo = self.getNameFromIndexMeta(url, docinfo=docinfo, dom=dom)          docinfo = self.getNameFromIndexMeta(url, docinfo=docinfo, dom=dom)
                   
                   
Line 830  class documentViewer(Folder): Line 831  class documentViewer(Folder):
         """gets the bibliographical information from the preseantion entry in texttools          """gets the bibliographical information from the preseantion entry in texttools
         """          """
         dom=self.getPresentationInfoXML(url)          dom=self.getPresentationInfoXML(url)
         try:  
             docinfo['author']=getText(dom.find(".//author"))              docinfo['author']=getText(dom.find(".//author"))
         except:  
             pass  
         try:  
             docinfo['title']=getText(dom.find(".//title"))              docinfo['title']=getText(dom.find(".//title"))
         except:  
             pass  
         try:  
             docinfo['year']=getText(dom.find(".//date"))              docinfo['year']=getText(dom.find(".//date"))
         except:  
             pass  
         return docinfo          return docinfo
           
     def getDocinfoFromImagePath(self,path,docinfo=None,cut=0):      def getDocinfoFromImagePath(self,path,docinfo=None,cut=0):

Removed from v.1.175.2.1  
changed lines
  Added in v.1.175.2.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>