Back to index

plone3  3.1.7
__init__.py
Go to the documentation of this file.
00001 #########################################################################
00002 # Copyright (c) 2003, 2004, 2005 Alberto Berti, Gregoire Weber. 
00003 # All Rights Reserved.
00004 # 
00005 # This file is part of CMFEditions.
00006 # 
00007 # CMFEditions is free software; you can redistribute it and/or modify
00008 # it under the terms of the GNU General Public License as published by
00009 # the Free Software Foundation; either version 2 of the License, or
00010 # (at your option) any later version.
00011 # 
00012 # CMFEditions is distributed in the hope that it will be useful,
00013 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 # GNU General Public License for more details.
00016 # 
00017 # You should have received a copy of the GNU General Public License
00018 # along with CMFEditions; if not, write to the Free Software
00019 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00020 #########################################################################
00021 """CMFEditions Globals
00022 
00023 $Id: __init__.py,v 1.17 2005/02/07 22:09:08 gregweb Exp $
00024 """
00025 __version__ = "$Revision: 1.17 $"
00026 
00027 from AccessControl import ModuleSecurityInfo
00028 from Globals import package_home
00029 
00030 from Products.CMFCore import utils
00031 from Products.CMFCore.DirectoryView import registerDirectory
00032 
00033 from Products.CMFEditions import UniqueIdHandlerTool
00034 from Products.CMFEditions import ModifierRegistryTool
00035 from Products.CMFEditions import ArchivistTool
00036 from Products.CMFEditions import ZVCStorageTool
00037 from Products.CMFEditions import CopyModifyMergeRepositoryTool
00038 from Products.CMFEditions import ReferenceFactoriesTool
00039 from Products.CMFEditions import KeepLastNVersionsTool
00040 
00041 from Products.CMFEditions import StandardModifiers
00042 
00043 PACKAGE_HOME = package_home(globals())
00044 
00045 tools = (
00046     UniqueIdHandlerTool.UniqueIdHandlerTool,
00047     ModifierRegistryTool.ModifierRegistryTool,
00048     ArchivistTool.ArchivistTool,
00049     ZVCStorageTool.ZVCStorageTool,
00050     CopyModifyMergeRepositoryTool.CopyModifyMergeRepositoryTool,
00051     ReferenceFactoriesTool.ReferenceFactoriesTool,
00052     KeepLastNVersionsTool.KeepLastNVersionsTool,
00053     )
00054 
00055 # This is used by a script (external method) that can be run
00056 # to set up CMFEditions in an existing CMF Site instance.
00057 product_globals = globals()
00058 
00059 registerDirectory('skins', product_globals)
00060 registerDirectory('skins/CMFEditions', product_globals)
00061 
00062 # Set up a MessageFactory for the cmfeditions domain
00063 from zope.i18nmessageid import MessageFactory
00064 CMFEditionsMessageFactory = MessageFactory('cmfeditions')
00065 ModuleSecurityInfo('Products.CMFEditions').declarePublic('CMFEditionsMessageFactory')
00066 ModuleSecurityInfo('Products.CMFEditions.interfaces.IArchivist').declarePublic('ArchivistUnregisteredError')
00067 ModuleSecurityInfo('Products.CMFEditions.interfaces.IModifier').declarePublic('FileTooLargeToVersionError')
00068 
00069 def initialize(context):
00070     utils.ToolInit(meta_type='CMF Editions Tool', tools=tools,
00071                    icon='tool.gif').initialize(context)
00072         
00073     # initialize standard modifiers to make them addable through the ZMI
00074     StandardModifiers.initialize(context)