Annotation of OSAS/OSA_system/OSAS_metadata.py, revision 1.3

1.1       dwinter     1: # Classen zur Produktion von Metataden
                      2: 
                      3: # Classes for displaying, browsing and organizing the archive
                      4: 
                      5: import addFolder
                      6: import OSAS_add # methods for adding metadata and/or files
                      7: 
                      8: from Globals import InitializeClass
                      9: from Globals import Persistent
                     10: from OFS.Folder import Folder
                     11: from OFS.SimpleItem import SimpleItem
                     12: from Products.PageTemplates.PageTemplateFile import PageTemplateFile
                     13: from Products.PageTemplates.PageTemplate import PageTemplate
                     14: from OFS.Traversable import Traversable
                     15: from OFS.Cache import Cacheable
                     16: from OFS.History import Historical, html_diff
                     17: from Shared.DC.Scripts.Script import Script, BindingsUI
                     18: from OFS.PropertyManager import PropertyManager
                     19: from ExtensionClass import Base
                     20: from Acquisition import Implicit
                     21: 
                     22: from AccessControl import ClassSecurityInfo
                     23: 
                     24: 
                     25: 
                     26: class OSAS_add_Metadata(Folder):
                     27:     """Foldertype enthält methoden zur Halbautomatischen Erstellung von Metadatenfiles"""
                     28:     security=ClassSecurityInfo()
                     29:     
                     30:     def __init__(self,id,linklabel,description):
                     31:         """initialize a new instance"""
                     32:         self.id = id
                     33:         self.linklabel =linklabel #label fuer link auf add page
                     34:         self.description=description #description of the method for link page
                     35:         
                     36:     meta_type='OSAS_add_Metadata'
                     37: 
                     38:     manage_options = Folder.manage_options+(
                     39:         {'label':'Main Config','action':'add_Metadata_config'},
                     40:         )
                     41: 
                     42:     
                     43:     
                     44:     security.declarePublic('add_Metadata_config')
                     45:     def add_Metadata_config(self):
                     46:         """Main configuration"""
1.2       dwinter    47:         pt=PageTemplateFile('Products/OSA_system/ChangeOSAS_addMetadata.zpt').__of__(self)
1.1       dwinter    48:         return pt()
                     49:     
1.3     ! dwinter    50:     security.declarePublic('change_OSAS_addMetadata')
        !            51:     def change_OSAS_addMetadata(self,linklabel,description,RESPONSE=None):
1.1       dwinter    52:         """Change Metadata"""
1.3     ! dwinter    53:         self.linklabel=linklabel
        !            54:         self.description=description
        !            55:         
1.1       dwinter    56:         if RESPONSE is not None:
                     57:             RESPONSE.redirect('manage_main')
                     58: 
                     59:     security.declarePublic('index_html')
                     60:     def index_html(self):
                     61:         """stantard aufruf"""
                     62:         return OSAS_add.add(self,no_upload=0)
                     63: 
                     64: 
                     65:     security.declarePublic('add2')
                     66:     def add2(self):
                     67:         """ anlegen naechster schritt"""
                     68:         return OSAS_add.add2(self)
                     69: 
                     70:     def add3(self):
                     71:         """Foldername"""
                     72:         return OSAS_add.add3(self)
                     73: 
                     74:     def add6(self):
                     75:         """write new index.meta file"""
                     76:         return OSAS_add.add6(self)
                     77:     
                     78: def manage_AddOSAS_add_MetadataForm(self):
                     79:     """interface for adding the OSAS_add_Metadata"""
1.2       dwinter    80:     pt=PageTemplateFile('Products/OSA_system/AddOSAS_metadata.zpt').__of__(self)
1.1       dwinter    81:     return pt()
                     82: 
                     83: def manage_AddOSAS_add_Metadata(self,id,linklabel,description,RESPONSE=None):
                     84:     """add the OSAS_root"""
                     85:     newObj=OSAS_add_Metadata(id,linklabel,description)
                     86:     self.Destination()._setObject(id,newObj)
                     87:     if RESPONSE is not None:
                     88:         RESPONSE.redirect('manage_main')
                     89: 
                     90:             
                     91: InitializeClass(OSAS_add_Metadata)
                     92: 

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