Annotation of ECHO_content/ECHO_collection.py_4.3.03, revision 1.1.1.1

1.1       casties     1: from OFS.Folder import Folder
                      2: from AccessControl import ClassSecurityInfo
                      3: from Globals import InitializeClass
                      4: from Products.PageTemplates.PageTemplateFile import PageTemplateFile
                      5: from Products.PageTemplates.PageTemplate import PageTemplate
                      6: from Globals import Persistent
                      7: from Acquisition import Implicit
                      8: 
                      9: class ECHO_collection(Folder, Persistent, Implicit):
                     10:     """ECHO Collection"""
                     11:     security=ClassSecurityInfo()
                     12:     meta_type='ECHO_collection'
                     13: 
                     14:     
                     15:     class scientificInformation(Persistent,Implicit):
                     16:         """subclass scientificInformation"""
                     17:         security=ClassSecurityInfo()
                     18:         
                     19: 
                     20:         class scientificClassification(Persistent,Implicit):
                     21:             """subclass"""
                     22:             security=ClassSecurityInfo()
                     23:             
                     24:             def __init__(self,context,science,practice):
                     25:                 self.context=context
                     26:                 self.science=science
                     27:                 self.practice=practice
                     28: 
                     29:             security.declarePublic('get_context')
                     30:             def get_context(self):
                     31:                 return self.context
                     32: 
                     33:             security.declarePublic('get_science')
                     34:             def get_science(self):
                     35:                 return self.science
                     36: 
                     37:             security.declarePublic('get_practice')
                     38:             def get_practice(self):
                     39:                 return self.practice
                     40:                 
                     41: 
                     42:             
                     43:         def __init__(self,source_type,period,scientific_classification):
                     44: 
                     45:             self.source_type=source_type
                     46:             self.period=period
                     47:             self.scientific_classification=scientific_classification
                     48: 
                     49:         security.declarePublic('get_source_type')
                     50:         def get_source_type(self):
                     51:             return self.source_type
                     52: 
                     53:         security.declarePublic('get_period')
                     54:         def get_period(self):
                     55:             return self.period
                     56: 
                     57:         security.declarePublic('get_scientific_classification')
                     58:         def get_scientific_classification(self):
                     59:             return self.scientific_classification
                     60: 
                     61:     security.declarePublic('printall')
                     62:     def printall(self):
                     63:             return self.scientific_information.__dict__.keys()
                     64:         
                     65:     def __init__(self,id,title,label,description,content_type,responsible,scientific_information):
                     66:         self.id = id
                     67:         """Festlegen der ID"""
                     68: 
                     69:         self.label = label
                     70:         self.title=title
                     71:         self.description=description
                     72:         self.content_type=content_type
                     73:         self.responsible=responsible
                     74:         self.scientific_information=scientific_information
                     75: 
                     76:     manage_options = Folder.manage_options+(
                     77:         {'label':'Main Config','action':'ECHO_Collection_config'},
                     78:         )
                     79:         
                     80:     security.declarePublic('ECHO_Collection_config')
                     81:     def ECHO_Collection_config(self):
                     82:         """Main configuration"""
                     83:         pt=PageTemplateFile('products/ECHO_content/ChangeECHO_Collection.zpt').__of__(self)
                     84:         return pt()
                     85: 
                     86:     security.declarePublic('changeECHO_Collection')
                     87:     def changeECHO_Collection(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,RESPONSE=None):
                     88:         """Änderung der Properties"""
                     89: 
                     90:         self.label = label
                     91:         self.title=title
                     92:         self.description=description
                     93:         self.content_type=content_type
                     94:         self.responsible=responsible
                     95: 
                     96:         self.scientific_information.source_type=source_type
                     97:         self.scientific_information.period=period
                     98:         self.scientific_information.scientific_classification.context=context
                     99:         self.scientific_information.scientific_classification.science=science
                    100:         self.scientific_information.scientific_classification.practice=practice
                    101:         
                    102:         if RESPONSE is not None:
                    103:             RESPONSE.redirect('manage_main')
                    104:             
                    105:     security.declarePublic('index_html')
                    106:     def index_html(self):
                    107:         """standard page"""
                    108:         
                    109:         pt=PageTemplateFile('products/ECHO_content/ECHO_content_standard.zpt').__of__(self)
                    110:         return pt()
                    111: 
                    112:     def getSubCols(self):
                    113:         ids=[]
                    114:         for entry in self.__dict__.keys():
                    115:             object=getattr(self,entry)
                    116:             print "OB:",object
                    117:             
                    118:             try:
                    119:                 print "MT:",object.meta_type
                    120:                 if object.meta_type=='ECHO_collection':
                    121:                     print "HI"
                    122:                     ids.append(object)
                    123:                     print "ID",ids
                    124:             except:
                    125:                 """nothing"""
                    126:         return ids
                    127:                 
                    128:         
                    129:     
                    130: def manage_AddECHO_collectionForm(self):
                    131:         """Nothing yet"""
                    132:         pt=PageTemplateFile('products/ECHO_content/AddECHO_collectionForm.zpt').__of__(self)
                    133:         return pt()
                    134: 
                    135: def manage_AddECHO_collection(self,context,science,practice,source_type,period,id,title,label,description,content_type,responsible,RESPONSE=None):
                    136:     """nothing yet"""
                    137:     scientificClassification=ECHO_collection.scientificInformation.scientificClassification(context,science,practice)
                    138:     
                    139:     scientificInformation=ECHO_collection.scientificInformation(source_type,period,scientificClassification)
                    140:     
                    141:     newObj=ECHO_collection(id,title,label,description,content_type,responsible,scientificInformation)
                    142:     self._setObject(id,newObj)
                    143: 
                    144:     if RESPONSE is not None:
                    145:         RESPONSE.redirect('manage_main')

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