Annotation of OSAS/OSA_system/OSAS_addfiles.py, revision 1.3
1.1 dwinter 1: # Methoden und Classen zum Hinzufuegen von Dokumenten
2:
1.3 ! dwinter 3: import urllib
1.1 dwinter 4: import OSAS_add
5: from OFS.Folder import Folder
6: from AccessControl import ClassSecurityInfo
7: from Globals import InitializeClass
8: from Products.PageTemplates.PageTemplateFile import PageTemplateFile
9: from Products.PageTemplates.PageTemplate import PageTemplate
10:
11: class OSAS_add_Document(Folder):
12: """Hinzufuegen eines Dokumentes zum Storage"""
13: security=ClassSecurityInfo()
14:
15: def __init__(self,id):
16: """initialize a new instance"""
17: self.id = id
18:
19:
20: meta_type='OSAS_add_Document'
21: manage_options = Folder.manage_options+(
22: {'label':'Main Config','action':'add_Document_config'},
23: )
24:
25:
26:
27: security.declarePublic('add_Document_config')
28: def add_Document_config(self):
29: """Main configuration"""
30: pt=PageTemplateFile('products/OSA_system/ChangeOSAS_addDocument.zpt').__of__(self)
31: return pt()
32:
33: security.declarePublic('change_OSAS_add_Document')
34: def change_OSAS_add_Document(self,RESPONSE=None):
35: """Change"""
36: # self.RootFolderName=RootFolderName
37: if RESPONSE is not None:
38: RESPONSE.redirect('manage_main')
39:
40: security.declarePublic('index_html')
41: def index_html(self):
42: """stantard aufruf"""
43: return OSAS_add.add(self,no_upload=1)
44:
45:
46: security.declarePublic('add2')
47: def add2(self):
48: """ anlegen naechster schritt"""
49: return OSAS_add.add2(self)
50:
51: def add3(self):
52: """Foldername"""
53: return OSAS_add.add3(self)
54:
55: def add4(self):
56: """Applet"""
57: return OSAS_add.add4(self)
58:
59: def add5(self):
60: """Foldername"""
61: return OSAS_add.add5(self)
62:
63: def add6(self):
64: """write new index.meta file"""
65: return OSAS_add.add6(self)
66:
67:
68: def addImages(self,path):
69: """Hinzufügen eines neuen Imagesfolders"""
70: return OSAS_add.addImages(self,path)
71:
72: def addImages2(self):
73: """Upload des neuen Imagefolders"""
1.2 dwinter 74: return OSAS_add.addImages2(self)
75:
1.1 dwinter 76:
77: def manage_AddOSAS_add_DocumentForm(self):
78: """interface for adding the OSAS_add_Metadata"""
79: pt=PageTemplateFile('products/OSA_system/AddOSAS_document.zpt').__of__(self)
80: return pt()
81:
82: def manage_AddOSAS_add_Document(self,id,RESPONSE=None):
83: """add the OSAS_root"""
84: newObj=OSAS_add_Document(id)
85: self.Destination()._setObject(id,newObj)
86: if RESPONSE is not None:
87: RESPONSE.redirect('manage_main')
88:
89:
90: InitializeClass(OSAS_add_Document)
91:
1.2 dwinter 92:
93: class OSAS_add_Text(Folder):
94: """Hinzufuegen eines Text-Dokumentes zum Storage"""
95: security=ClassSecurityInfo()
96:
97: def __init__(self,id):
98: """initialize a new instance"""
99: self.id = id
100:
101:
102: meta_type='OSAS_add_Text'
103: manage_options = Folder.manage_options+(
104: {'label':'Main Config','action':'add_Text_config'},
105: )
106:
107:
108:
109: security.declarePublic('add_Text_config')
110: def add_Text_config(self):
111: """Main configuration"""
112: pt=PageTemplateFile('products/OSA_system/ChangeOSAS_addText.zpt').__of__(self)
113: return pt()
114:
115: security.declarePublic('change_OSAS_add_Text')
116: def change_OSAS_add_Text(self,RESPONSE=None):
117: """Change"""
118: # self.RootFolderName=RootFolderName
119: if RESPONSE is not None:
120: RESPONSE.redirect('manage_main')
121:
122: def addText(self,path):
123: """Add a fulltext"""
124: return OSAS_add.addText(self,path)
125:
126: def addText2(self):
127: """Read the file and store it"""
128: return OSAS_add.addText2(self)
129: def manage_AddOSAS_add_TextForm(self):
130: """interface for adding the OSAS_add_Metadata"""
131: pt=PageTemplateFile('products/OSA_system/AddOSAS_text.zpt').__of__(self)
132: return pt()
133:
134: def manage_AddOSAS_add_Text(self,id,RESPONSE=None):
135: """add the OSAS_root"""
136: newObj=OSAS_add_Text(id)
137: self.Destination()._setObject(id,newObj)
138: if RESPONSE is not None:
139: RESPONSE.redirect('manage_main')
140:
141:
142: InitializeClass(OSAS_add_Text)
1.3 ! dwinter 143:
! 144: class OSAS_add_contextData(Folder):
! 145: """Einfuegen eines Documentes in eine Collection"""
! 146:
! 147: security=ClassSecurityInfo()
! 148:
! 149:
! 150: meta_type='OSAS_add_contextData'
! 151:
! 152: def __init__(self,id,collection):
! 153: self.id=id
! 154: self.collection=collection
! 155:
! 156: def generateTree(self,depth=3):
! 157: """Erzeugt HTML-Tree der Collection"""
! 158:
! 159:
! 160: def getChilds(id,depth,items):
! 161: list=[]
! 162: for object in item:
! 163: if (depth==object[2])&(id==object[0]):
! 164: list.append[object]
! 165:
! 166:
! 167: exec("items=self.getPhysicalRoot()."+self.collection+".getCollectionTree()")
! 168:
! 169:
! 170:
! 171:
! 172:
! 173:
! 174: return a[1][0].id
! 175:
! 176: def addContextData(self):
! 177: pt=PageTemplateFile('products/OSA_system/contextDataMain.zpt').__of__(self)
! 178:
! 179:
! 180: manage_options = Folder.manage_options+(
! 181: {'label':'Main Config','action':'add_contextData_config'},
! 182: )
! 183:
! 184:
! 185: def add_contextData_config(self):
! 186: """Main configuration"""
! 187: pt=PageTemplateFile('products/OSA_system/ChangeOSAS_add_contextData.zpt').__of__(self)
! 188: return pt()
! 189:
! 190:
! 191: def change_OSAS_add_contextData(self,collection,RESPONSE=None):
! 192: """Change"""
! 193: self.collection=collection
! 194: if RESPONSE is not None:
! 195: RESPONSE.redirect('manage_main')
! 196:
! 197: def manage_AddOSAS_add_contextDataForm(self):
! 198: """interface for adding the OSAS_add_Metadata"""
! 199: pt=PageTemplateFile('products/OSA_system/AddOSAS_contextData.zpt').__of__(self)
! 200: return pt()
! 201:
! 202: def manage_AddOSAS_add_contextData(self,id,collection,RESPONSE=None):
! 203: """add the OSAS_root"""
! 204: newObj=OSAS_add_contextData(id,collection)
! 205: self.Destination()._setObject(id,newObj)
! 206: if RESPONSE is not None:
! 207: RESPONSE.redirect('manage_main')
! 208:
! 209:
! 210: InitializeClass(OSAS_add_contextData)
1.2 dwinter 211:
212: class OSAS_add_Presentation(Folder):
213: """Hinzufügen der Presentationsinformationen"""
214: security=ClassSecurityInfo()
215:
216: def __init__(self,id):
217: """initialize a new instance"""
218: self.id = id
219:
220:
221: meta_type='OSAS_add_Presentation'
222: manage_options = Folder.manage_options+(
223: {'label':'Main Config','action':'add_Presentation_config'},
224: )
225:
226:
227:
228: security.declarePublic('add_Presentation_config')
229: def add_Presentation_config(self):
230: """Main configuration"""
231: pt=PageTemplateFile('products/OSA_system/ChangeOSAS_addPresentation.zpt').__of__(self)
232: return pt()
233:
234: security.declarePublic('change_OSAS_add_Presentation')
235: def change_OSAS_add_Presentation(self,RESPONSE=None):
236: """Change"""
237: # self.RootFolderName=RootFolderName
238: if RESPONSE is not None:
239: RESPONSE.redirect('manage_main')
240:
241: def addPresentation(self,path):
242: """Hinzufügen der Presenationsinformation"""
243: return OSAS_add.addPresentation(self,path)
244:
245: def addPresentation2(self):
246: """Eingabe von Metadateninformationen"""
247: return OSAS_add.addPresentation2(self)
248:
249: def manage_AddOSAS_add_PresentationForm(self):
250: """interface for adding the OSAS_add_Metadata"""
251: pt=PageTemplateFile('products/OSA_system/AddOSAS_presentation.zpt').__of__(self)
252: return pt()
253:
254: def manage_AddOSAS_add_Presentation(self,id,RESPONSE=None):
255: """add the OSAS_root"""
256: newObj=OSAS_add_Presentation(id)
257: self.Destination()._setObject(id,newObj)
258: if RESPONSE is not None:
259: RESPONSE.redirect('manage_main')
260:
261:
262: InitializeClass(OSAS_add_Presentation)
263:
264: class OSAS_combineTextImage(Folder):
265: """Hinzufügen der Combine Text und Image"""
266: security=ClassSecurityInfo()
267:
268: def __init__(self,id):
269: """initialize a new instance"""
270: self.id = id
271:
272:
273: meta_type='OSAS_combineTextImage'
274: manage_options = Folder.manage_options+(
275: {'label':'Main Config','action':'combineTextImage_config'},
276: )
277:
278:
279:
280: security.declarePublic('combineTextImage_config')
281: def combineTextImage_config(self):
282: """Main configuration"""
283: pt=PageTemplateFile('products/OSA_system/ChangeOSAS_combineTextImage.zpt').__of__(self)
284: return pt()
285:
286: security.declarePublic('change_OSAS_combineTextImage')
287: def change_OSAS_combineTextImage(self,RESPONSE=None):
288: """Change"""
289: # self.RootFolderName=RootFolderName
290: if RESPONSE is not None:
291: RESPONSE.redirect('manage_main')
292:
293: security.declarePublic('combineTextImage')
294: def combineTextImage(self,path):
295: """Hinzufügen der Presenationsinformation"""
296: return OSAS_add.combineTextImage(self,path)
297:
298: def combineTextImage2(self,path):
299: """Eingabe von Metadateninformationen"""
300: return OSAS_add.combineTextImage2(self,path)
301:
302:
303: def manage_AddOSAS_combineTextImageForm(self):
304: """interface for adding the OSAS_add_Metadata"""
305: pt=PageTemplateFile('products/OSA_system/AddOSAS_combineTextImage.zpt').__of__(self)
306: return pt()
307:
308: def manage_AddOSAS_combineTextImage(self,id,RESPONSE=None):
309: """add the OSAS_root"""
310: newObj=OSAS_combineTextImage(id)
311: self.Destination()._setObject(id,newObj)
312: if RESPONSE is not None:
313: RESPONSE.redirect('manage_main')
314:
315:
316: InitializeClass(OSAS_combineTextImage)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>