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 setDigILibURL(self):
22: """set"""
23: self.DigILibURL=""
24:
25: def Root_config(self):
26: """Main configuration"""
27: pt=PageTemplateFile('Products/OSA_system/zpt/ConfigOSAS_Root.zpt').__of__(self)
28: return pt()
29:
30: def change_OSAS_Root(self,RootFolderName,DigILibURL,RESPONSE=None):
31: """Change RootFolderName"""
32: self.RootFolderName=RootFolderName
33: self.DigILibURL=DigILibURL
34:
35: if RESPONSE is not None:
36: RESPONSE.redirect('manage_main')
37:
38: def date(self):
39: """gives formatted date"""
40: return strftime("%d.%m.%Y",localtime())
41:
42: def manage_AddOSAS_RootForm(self):
43: """interface for adding the OSAS_root"""
44: pt=PageTemplateFile('Products/OSA_system/zpt/AddOSAS_Root.zpt').__of__(self)
45: return pt()
46:
47: def manage_AddOSAS_Root(self,id,RootFolderName,DigILibURL,RESPONSE=None):
48: """add the OSAS_root"""
49: newObj=OSAS_Root(id,RootFolderName,DigILibURL)
50: self._setObject(id,newObj)
51: if RESPONSE is not None:
52: RESPONSE.redirect('manage_main')
53:
54:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>