Index: documentViewer.py
===================================================================
--- documentViewer.py	(revision 49)
+++ documentViewer.py	(revision 50)
@@ -18,4 +18,5 @@
 import cgi
 import urllib
+import logging
 import zLOG
 import urlparse 
@@ -60,5 +61,5 @@
 class documentViewer(Folder):
     """document viewer"""
-    textViewerUrl="http://127.0.0.1:8080/HFQP/testXSLT/getPage?"
+    #textViewerUrl="http://127.0.0.1:8080/HFQP/testXSLT/getPage?"
     
     meta_type="Document viewer"
@@ -228,4 +229,33 @@
         if dom is None:
             raise IOError("Unable to read index meta from %s"%(url))
+                 
+        return dom
+    
+    def getPresentationInfoXML(self, url):
+        """returns dom of info.xml document at url"""
+        num_retries = 3
+        dom = None
+        metaUrl = None
+        if url.startswith("http://"):
+            # real URL
+            metaUrl = url
+        else:
+            # online path
+            server=self.digilibBaseUrl+"/servlet/Texter?fn="
+            metaUrl=server+url.replace("/mpiwg/online","")
+           
+        
+        for cnt in range(num_retries):
+            try:
+                # patch dirk encoding fehler treten dann nicht mehr auf
+                # dom = NonvalidatingReader.parseUri(metaUrl)
+                txt=urllib.urlopen(metaUrl).read()
+                dom = Parse(txt)
+                break
+            except:
+                zLOG.LOG("ERROR documentViewer (getPresentationInfoXML)", zLOG.INFO,"%s (%s)"%sys.exc_info()[0:2])
+                
+        if dom is None:
+            raise IOError("Unable to read infoXMLfrom %s"%(url))
                  
         return dom
@@ -346,9 +376,27 @@
            docinfo['textURL'] = textUrl
                      
-       docinfo = self.getBibinfoFromIndexMeta(url,docinfo=docinfo,dom=dom)
+   
+       presentationUrls=dom.xpath("//texttool/presentation")
+       if presentationUrls and (len(presentationUrls)>0):
+            # presentation url ergiebt sich ersetzen von index.meta in der url der fr 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)
+       else:
+           docinfo = self.getBibinfoFromIndexMeta(url,docinfo=docinfo,dom=dom)   
        docinfo = self.getAuthinfoFromIndexMeta(url,docinfo=docinfo,dom=dom)
        return docinfo
    
-
+   
+    def getBibinfoFromTextToolPresentation(self,url,docinfo=None,dom=None):
+        """gets the bibliographical information from the preseantion entry in texttools
+        """
+        dom=self.getPresentationInfoXML(url)
+        docinfo['author']=getTextFromNode(dom.xpath("//author")[0])
+        docinfo['title']=getTextFromNode(dom.xpath("//title")[0])
+        docinfo['year']=getTextFromNode(dom.xpath("//date")[0])
+        return docinfo
+    
     def getDocinfoFromImagePath(self,path,docinfo=None):
         """path ist the path to the images it assumes that the index.meta file is one level higher."""
@@ -371,5 +419,6 @@
         zLOG.LOG("documentViewer (getdocinfo)", zLOG.INFO,"mode: %s, url: %s"%(mode,url))
         # look for cached docinfo in session
-        if self.REQUEST.SESSION.has_key('docinfo'):
+        # XXXX Sesion abgeschaltet
+        if self.REQUEST.SESSION.has_key('docinfo_XX'):
             docinfo = self.REQUEST.SESSION['docinfo']
             # check if its still current
@@ -472,6 +521,9 @@
         """try to get the digilib URL from zogilib"""
         url = self.imageViewerUrl[:-1] + "/getScalerUrl"
-        print urlparse.urlparse(url)[0]
-        print urlparse.urljoin(self.absolute_url(),url)
+        #print urlparse.urlparse(url)[0]
+        #print urlparse.urljoin(self.absolute_url(),url)
+        logging.info("finddigiliburl: %s"%urlparse.urlparse(url)[0])
+        logging.info("finddigiliburl: %s"%urlparse.urljoin(self.absolute_url(),url))
+        
         try:
             if urlparse.urlparse(url)[0]=='': #relative path
Index: zpt/changeDocumentViewer.zpt
===================================================================
--- zpt/changeDocumentViewer.zpt	(revision 48)
+++ zpt/changeDocumentViewer.zpt	(revision 50)
@@ -17,5 +17,5 @@
         <p class="form-label">Text viewer URL</p>
         <p class="form-element"><input size="80" tal:attributes="value here/textViewerUrl" name="textViewerUrl"></p>
-        <p class="form-text">Should be an ECHO_xslt instance, full URL up to the '?' (e.g. 'http://echo.mpiwg-berlin.mpg.de/viewText/getPage?')</p>
+        <p class="form-text">Should be a displayXML instance, full URL up to the '?' (e.g. 'http://echo.mpiwg-berlin.mpg.de/viewText?')</p>
         
         <p class="form-optional">Thumbnail rows</p>
Index: zpt/image_main.zpt
===================================================================
--- zpt/image_main.zpt	(revision 46)
+++ zpt/image_main.zpt	(revision 50)
@@ -1,4 +1,4 @@
 <tal:block tal:define="docinfo options/docinfo; pageinfo options/pageinfo; mode python:options.get('viewMode','images')">
  <iframe tal:condition="python:mode=='images'" height="100%" width="100%" tal:attributes="src string:${here/imageViewerUrl}fn=${docinfo/imagePath}&pn=${pageinfo/current}"/>
- <iframe tal:condition="python:mode=='text'" height="100%" width="100%" tal:attributes="src string:${here/textViewerUrl}fn=${docinfo/textURL}&_pn=${pageinfo/current}"/>
+ <iframe tal:condition="python:mode=='text'" height="100%" width="100%" tal:attributes="src string:${here/textViewerUrl}fn=${docinfo/textURL}&pn=${pageinfo/current}"/>
 </tal:block>
