1: from time import localtime,strftime
2: from Acquisition import Implicit
3: from OFS.Folder import Folder
4: from Products.PageTemplates.PageTemplateFile import PageTemplateFile
5: from Products.PageTemplates.PageTemplate import PageTemplate
6:
7: class OSAS_Root(Folder,Implicit):
8: """Implicit Folder of the Storage Systems"""
9: def __init__(self,id,RootFolderName,DigILibURL):
10: """initialize a new instance"""
11: self.id = id
12: self.RootFolderName = RootFolderName
13: self.DigILibURL=DigILibURL
14:
15: meta_type="OSAS_Root"
16:
17: manage_options = Folder.manage_options+(
18: {'label':'Main Config','action':'Root_config'},
19: )
20:
21: def Root_config(self):
22: """Main configuration"""
23: pt=PageTemplateFile('Products/OSA_system/zpt/ConfigOSAS_Root.zpt').__of__(self)
24: return pt()
25:
26: def change_OSAS_Root(self,RootFolderName,DigILibURL,RESPONSE=None):
27: """Change RootFolderName"""
28: self.RootFolderName=RootFolderName
29: self.DigILibURL=DigILibURL
30:
31: if RESPONSE is not None:
32: RESPONSE.redirect('manage_main')
33:
34: def date(self):
35: """gives formatted date"""
36: return strftime("%d.%m.%Y",localtime())
37:
38: def manage_AddOSAS_RootForm(self):
39: """interface for adding the OSAS_root"""
40: pt=PageTemplateFile('Products/OSA_system/zpt/AddOSAS_Root.zpt').__of__(self)
41: return pt()
42:
43: def manage_AddOSAS_Root(self,id,RootFolderName,DigILibURL,RESPONSE=None):
44: """add the OSAS_root"""
45: newObj=OSAS_Root(id,RootFolderName,DigILibURL)
46: self._setObject(id,newObj)
47: if RESPONSE is not None:
48: RESPONSE.redirect('manage_main')
49:
50:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>