Diff for /OSAS/OSA_system/OSAS_Root.py between versions 1.8 and 1.17

version 1.8, 2004/05/08 21:09:11 version 1.17, 2004/10/29 14:24:32
Line 1 Line 1
   from OFS.SimpleItem import SimpleItem
 from time import localtime,strftime  from time import localtime,strftime
 from Acquisition import Implicit  from Acquisition import Implicit
 from OFS.Folder import Folder  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 xml.dom.minidom
   
   class OSAS_ViewerObject(Folder):
       """Beschreibung eines Viewers"""
       meta_type="OSAS_ViewerObject"
       
       def __init__(self,id,title,prefix):
           """init"""
           self.id=id
           self.title=title
           self.prefix=prefix
   
       manage_options = Folder.manage_options+(
           {'label':'Main Config','action':'changeViewerObjectForm'},
           )
   
       def changeViewerObjectForm(self):
           """Main configuration"""
           pt=PageTemplateFile('Products/OSA_system/zpt/changeViewerObjectForm.zpt').__of__(self)
           return pt()
   
       def changeViewerObject(self,title,prefix):
           """Change RootFolderName"""
           self.title=title
           self.prefix=prefix
   
           
           if RESPONSE is not None:
               RESPONSE.redirect('manage_main')
   
   
   def manage_AddOSAS_ViewerObjectForm(self):
       """interface for adding the viewer Object"""
       pt=PageTemplateFile('Products/OSA_system/zpt/AddOSAS_ViewerObject.zpt').__of__(self)
       return pt()
   
   def manage_AddOSAS_ViewerObject(self,id,title,prefix,RESPONSE=None):
       """add the OSAS_root"""
       newObj=OSAS_ViewerObject(id,title,prefix)
       self._setObject(id,newObj)
       if RESPONSE is not None:
           RESPONSE.redirect('manage_main')
   
   
 class OSAS_Root(Folder,Implicit):  class OSAS_Root(Folder,Implicit):
     """Implicit Folder of the  Storage Systems"""      """Implicit Folder of the  Storage Systems"""
Line 20  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 setDigILibURL(self):      def setDigILibURL(self):
         """set"""          """set"""
         self.DigILibURL=""          self.DigILibURL=""
Line 51  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)
         fh=file(path)          path=re.sub('http://'+self.REQUEST['HTTP_HOST'],'',index_meta_url)
   
           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')
       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)

Removed from v.1.8  
changed lines
  Added in v.1.17


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