|
|
| version 1.11, 2004/06/23 05:36:08 | version 1.17, 2004/10/29 14:24:32 |
|---|---|
| Line 5 from OFS.Folder import Folder | Line 5 from OFS.Folder import Folder |
| from Products.PageTemplates.PageTemplateFile import PageTemplateFile | from Products.PageTemplates.PageTemplateFile import PageTemplateFile |
| from Products.PageTemplates.PageTemplate import PageTemplate | from Products.PageTemplates.PageTemplate import PageTemplate |
| import urllib | import urllib |
| import zLOG | |
| import re | import re |
| import xml.dom.minidom | |
| class OSAS_ViewerObject(Folder): | class OSAS_ViewerObject(Folder): |
| """Beschreibung eines Viewers""" | """Beschreibung eines Viewers""" |
| Line 64 class OSAS_Root(Folder,Implicit): | Line 66 class OSAS_Root(Folder,Implicit): |
| {'label':'Main Config','action':'Root_config'}, | {'label':'Main Config','action':'Root_config'}, |
| ) | ) |
| def getImageViewers(self): | |
| """images""" | |
| viewers=self.ZopeFind(self.standardImageViewer,obj_metatypes=['OSAS_ViewerObject']) | |
| return viewers | |
| def setDigILibURL(self): | def setDigILibURL(self): |
| Line 101 class OSAS_Root(Folder,Implicit): | Line 99 class OSAS_Root(Folder,Implicit): |
| def downloadExternalXML(self,index_meta_url,xml_url): | def downloadExternalXML(self,index_meta_url,xml_url): |
| """lade xml file""" | """lade xml file""" |
| #print "GI" | |
| #print xml_url | |
| xmlneu=urllib.urlopen(xml_url).read() | xmlneu=urllib.urlopen(xml_url).read() |
| try: | |
| dom=xml.dom.minidom.parseString(xmlneu) | |
| except: | |
| print "Error" | |
| return repr(xml_url) | |
| return "error" | |
| path=re.sub(self.REQUEST['SERVER_URL'],'',index_meta_url) | path=re.sub(self.REQUEST['SERVER_URL'],'',index_meta_url) |
| path=re.sub('http://foxridge.mpiwg-berlin.mpg.de:8080','',path) # falls foxridge als server | path=re.sub('http://'+self.REQUEST['HTTP_HOST'],'',index_meta_url) |
| path=re.sub('http://foxridge.mpiwg-berlin.mpg.de','',path) # falls foxridge als server | |
| path=re.sub('http://foxridge.mpiwg-berlin.mpg.de:8080','',path) # falls foxridge als server | |
| path=re.sub('http://foxridge.rz-berlin.mpg.de:8080','',path) # falls foxridge als server | |
| path=re.sub('http://foxridge.rz-berlin.mpg.de','',path) # falls foxridge als server | |
| path=re.sub('http://foxridge.mpiwg-berlin.mpg.de','',path) # falls foxridge als server | |
| path=re.sub('http://content.mpiwg-berlin.mpg.de','',path) # falls content als server | |
| path=re.sub('http://vision.mpiwg-berlin.mpg.de','',path) # falls vision als server | |
| path=re.sub('http://echo.mpiwg-berlin.mpg.de','',path) # falls echo | |
| # path=re.sub('//','/',path) # falls echo | |
| fh=open(path,'w') | fh=open(path,'w') |
| zLOG.LOG("OSAS",zLOG.INFO,path) | |
| fh.write(xmlneu) | fh.write(xmlneu) |
| fh.close() | fh.close() |
| return "ok" | return "ok" |
| def manage_AddOSAS_RootForm(self): | def manage_AddOSAS_RootForm(self): |
| """interface for adding the OSAS_root""" | """interface for adding the OSAS_root""" |
| pt=PageTemplateFile('Products/OSA_system/zpt/AddOSAS_Root.zpt').__of__(self) | pt=PageTemplateFile('Products/OSA_system/zpt/AddOSAS_Root.zpt').__of__(self) |