--- documentViewer/documentViewer.py 2007/04/20 14:46:05 1.23 +++ documentViewer/documentViewer.py 2007/05/04 13:17:02 1.26 @@ -80,6 +80,7 @@ class documentViewer(Folder): image_main = PageTemplateFile('zpt/image_main', globals()) head_main = PageTemplateFile('zpt/head_main', globals()) docuviewer_css = PageTemplateFile('css/docuviewer.css', globals()) + info_xml = PageTemplateFile('zpt/info_xml', globals()) security.declareProtected('View management screens','changeDocumentViewerForm') changeDocumentViewerForm = PageTemplateFile('zpt/changeDocumentViewer', globals()) @@ -108,9 +109,9 @@ class documentViewer(Folder): def index_html(self,mode,url,viewMode="auto",start=None,pn=1): ''' view it - @param mode: defines which type of document is behind url (text,images or auto) + @param mode: defines how to access the document behind url @param url: url which contains display information - @param viewMode: if images display images, if text display text, default is images + @param viewMode: if images display images, if text display text, default is images (text,images or auto) ''' @@ -133,7 +134,6 @@ class documentViewer(Folder): else: viewMode="images" - return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode) @@ -152,6 +152,17 @@ class documentViewer(Folder): url=self.REQUEST['URL1']+"?"+ps return url + + def getInfo_xml(self,url,mode): + """returns info about the document as XML""" + + if not self.digilibBaseUrl: + self.digilibBaseUrl = self.findDigilibUrl() or "http://nausikaa.mpiwg-berlin.mpg.de/digitallibrary" + + docinfo = self.getDocinfo(mode=mode,url=url) + pt = getattr(self.template, 'info_xml') + return pt(docinfo=docinfo) + def getStyle(self, idx, selected, style=""): """returns a string with the given style and append 'sel' if path == selected.""" @@ -160,7 +171,7 @@ class documentViewer(Folder): return style + 'sel' else: return style - + def isAccessible(self, docinfo): """returns if access to the resource is granted""" @@ -399,7 +410,6 @@ class documentViewer(Folder): textUrl=os.path.join(archivePath,textUrl) docinfo['textURL'] = textUrl - presentationUrls=dom.xpath("//texttool/presentation") docinfo = self.getBibinfoFromIndexMeta(url,docinfo=docinfo,dom=dom) # get info von bib tag @@ -408,11 +418,9 @@ class documentViewer(Folder): # presentation url ergiebt sich ersetzen von index.meta in der url der fŸr 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) - - + docinfo = self.getAuthinfoFromIndexMeta(url,docinfo=docinfo,dom=dom) # get access info return docinfo