Back to index

plone3  3.1.7
__init__.py
Go to the documentation of this file.
00001 # -*- coding: utf-8 -*-
00002 ## CMFPlacefulWorkflow
00003 ## Copyright (C)2005 Ingeniweb
00004 
00005 ## This program is free software; you can redistribute it and/or modify
00006 ## it under the terms of the GNU General Public License as published by
00007 ## the Free Software Foundation; either version 2 of the License, or
00008 ## (at your option) any later version.
00009 
00010 ## This program is distributed in the hope that it will be useful,
00011 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 ## GNU General Public License for more details.
00014 
00015 ## You should have received a copy of the GNU General Public License
00016 ## along with this program; see the file COPYING. If not, write to the
00017 ## Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 """
00019 Initialization
00020 """
00021 __version__ = "$Revision: 62604 $"
00022 # $Source: /cvsroot/ingeniweb/CMFPlacefulWorkflow/__init__.py,v $
00023 # $Id: __init__.py 62604 2008-04-13 20:50:14Z hannosch $
00024 __docformat__ = 'restructuredtext'
00025 
00026 import PlacefulWorkflowTool
00027 import DefaultWorkflowPolicy
00028 import WorkflowPolicyConfig
00029 
00030 from AccessControl import ModuleSecurityInfo
00031 from Products.CMFCore import utils, DirectoryView
00032 
00033 install_globals = globals()          # Used only in the Extensions/Install.py script
00034 
00035 tools = (PlacefulWorkflowTool.PlacefulWorkflowTool, )
00036 
00037 DirectoryView.registerDirectory('skins', globals())
00038 
00039 # Initialization method
00040 def initialize(context):
00041     utils.registerIcon(
00042         DefaultWorkflowPolicy.DefaultWorkflowPolicyDefinition,
00043         'images/workflow_policy.gif',
00044         globals())
00045 
00046     context.registerClass(
00047         PlacefulWorkflowTool.PlacefulWorkflowTool,
00048         meta_type="Placeful Workflow Tool",
00049         constructors=(PlacefulWorkflowTool.addPlacefulWorkflowTool,),
00050         icon = 'tool.gif')
00051 
00052     context.registerClass(
00053         WorkflowPolicyConfig.WorkflowPolicyConfig,
00054         permission='Add Workflow Policy',
00055         constructors=(WorkflowPolicyConfig.manage_addWorkflowPolicyConfigForm,
00056                       WorkflowPolicyConfig.manage_addWorkflowPolicyConfig),
00057         icon='www/WorkflowPolicyConfig_icon.gif',
00058     )
00059 
00060     utils.ToolInit( 'CMF Placeful Workflow Tool'
00061                   , tools=tools
00062                   , icon='tool.gif'
00063                   ).initialize( context )
00064 
00065 ModuleSecurityInfo('Products.CMFPlacefulWorkflow').declarePublic('CMFPlacefulWorkflowMessageFactory')
00066 
00067 # Import "CMFPlacefulWorkflowMessageFactory as _" to create messages
00068 # Zope 3.1-style messagefactory module
00069 # BBB: Zope 2.8 / Zope X3.0
00070 try:
00071     from zope.i18nmessageid import MessageFactory
00072 except ImportError:
00073     from messagefactory_ import CMFPlacefulWorkflowMessageFactory
00074 else:
00075     CMFPlacefulWorkflowMessageFactory = MessageFactory('cmfplacefulworkflow')
00076