Back to index

plone3  3.1.7
ZopeVersion.py
Go to the documentation of this file.
00001 ##############################################################################
00002 #
00003 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
00004 # 
00005 # This software is subject to the provisions of the Zope Public License,
00006 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
00007 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
00008 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00009 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
00010 # FOR A PARTICULAR PURPOSE
00011 # 
00012 ##############################################################################
00013 
00014 __version__='$Revision: 1.6 $'[11:-2]
00015 
00016 from Globals import DTMLFile, InitializeClass
00017 import OFS, AccessControl
00018 import Version
00019 
00020 
00021 class ZopeVersion(
00022     Version.Version,
00023     AccessControl.Role.RoleManager,
00024     OFS.SimpleItem.Item
00025     ):
00026     """The ZopeVersion class builds on the core Version class to provide
00027        the Zope management interface and other product trappings."""
00028 
00029     security = AccessControl.ClassSecurityInfo()
00030     security.setDefaultAccess('deny')
00031 
00032     meta_type = 'Version'
00033 
00034     manage_options=(
00035         ( {'label': 'Information',  'action':'manage_main',
00036            'help': ('ZopeVersionControl', 'Version-Manage.stx')},
00037           {'label': 'Properties', 'action':'manage_properties_form',
00038            'help': ('ZopeVersionControl', 'Version-Properties.stx')},
00039         ) +
00040         AccessControl.Role.RoleManager.manage_options +
00041         OFS.SimpleItem.Item.manage_options
00042         )
00043 
00044     icon='misc_/ZopeVersionControl/Version.gif'
00045 
00046     security.declareProtected('View management screens', 'manage_main')
00047     manage_main = DTMLFile('dtml/VersionManageMain', globals())
00048     manage_main._setName('manage_main')
00049     manage = manage_main
00050 
00051     security.declareProtected(
00052         'View management screens', 'manage_properties_form'
00053         )
00054     manage_properties_form = DTMLFile('dtml/VersionProperties', globals())
00055 
00056     security.declareProtected('Manage repositories', 'manage_edit')
00057     def manage_edit(self, REQUEST=None):
00058         """Change object properties."""
00059         if REQUEST is not None:
00060             message="Saved changes."
00061             return self.manage_properties_form(
00062                 self, REQUEST, manage_tabs_message=message
00063 
00064                 )
00065 
00066 InitializeClass(ZopeVersion)