source: products/qPloneComments/trunk/setuphandlers.py @ 1221

Last change on this file since 1221 was 656, checked in by crchemist, 17 years ago

Added qPloneCaptchas properties in portal_properties.

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1from Products.CMFCore.utils import getToolByName
2
3def setupVarious(context):
4    """Run the various non-Generic Setup profile import steps.
5    """
6    if context.readDataFile('qPloneComments-default.txt') is None:
7        return
8
9    portal = context.getSite()
10    logger = context.getLogger('qPloneComments')
11
12    # Add 'DiscussionManagers' group
13    gtool = getToolByName(portal, 'portal_groups')
14    existing = gtool.listGroupIds()
15    if not 'DiscussionManager' in existing:
16        gtool.addGroup('DiscussionManager', roles=['DiscussionManager'])
17        logger.info('Added DiscussionManager group to portal_groups with DiscussionManager role.')
18
19    # Remove workflow-chain for Discussion Item
20    wf_tool = getToolByName(portal, 'portal_workflow')
21    wf_tool.setChainForPortalTypes(('Discussion Item',), [])
22    logger.info('Removed workflow chain for Discussion Item type.')
23
24def removeConfiglet(context):
25    if context.readDataFile('qPloneComments-uninstall.txt') is None:
26        return
27    portal_conf=getToolByName(context.getSite(),'portal_controlpanel')
28    portal_conf.unregisterConfiglet('prefs_comments_setup_form')
Note: See TracBrowser for help on using the repository browser.