Diff for /OSAS/OSA_system/OSAS_Root.py between versions 1.10 and 1.15

version 1.10, 2004/06/22 06:39:04 version 1.15, 2004/08/19 19:01:17
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
Line 5  from Products.PageTemplates.PageTemplate Line 6  from Products.PageTemplates.PageTemplate
 from Products.PageTemplates.PageTemplate import PageTemplate  from Products.PageTemplates.PageTemplate import PageTemplate
 import urllib  import urllib
 import re  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 21  class OSAS_Root(Folder,Implicit): Line 65  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 52  class OSAS_Root(Folder,Implicit): Line 98  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"
               print xmlneu
               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://'+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.mpiwg-berlin.mpg.de:8080','',path) # falls foxridge als server
     path=re.sub('http://foxridge.mpiwg-berlin.mpg.de','',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
   
         fh=open(path,'w')          fh=open(path,'w')
   
         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.10  
changed lines
  Added in v.1.15


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