products/CpsDemoPortal

view factory.py @ 2:09662502fd06

Added the missing CPSTramline:minimal profile
author M.-A. Darche <ma.darche@aful.org>
date Mon, 13 Dec 2010 10:49:49 +0000
parents 94ca912fb3aa
children
line source
1 # (C) Copyright 2010 CPS-CMS community <http://cps-cms.org/>
2 # Authors:
3 # M.-A. Darche <cps@cynode.org>
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 """CPS demo portal factory."""
19 from Products.CPSDefault.metafactory import CPSSiteMetaConfigurator
21 #
22 # Callables for meta profiles
23 #
25 def removeCookieCrumbler(site):
26 site.manage_delObjects(['cookie_authentication'])
28 class SiteConfigurator(CPSSiteMetaConfigurator):
29 """CPS demo portal configurator"""
31 meta_profiles = {
32 'CPS_DEMO': {'title' : 'Common set of components',
33 'extensions': ('CPSRSS:default',
34 'CPSSubscriptions:default',
35 'CPSDefault:folder_advanced_display',
36 'CPSTramline:minimal',
37 'CPSTramline:cpsdefault-all',
38 'CpsDemoPortal:default',
39 ),
40 'optional' : False,
41 'parameters' : {'attributes': ('smtp_host',
42 'smtp_port',
43 'smtp_pwd',
44 'smtp_uid'),
45 'class': 'Products.MailHost.'
46 'MailHost.MailHost',
47 'rpath' : 'MailHost'},
48 }
49 }
50 metas_order = ('CPS_DEMO',
51 )
52 form_heading = "Add CPS demo portal"
53 post_action = 'addConfiguredCpsDemoPortal'
55 _cpsconfigurator = SiteConfigurator()
57 # GR: straight from CPSDefault.factory
58 # Do the following dance because bound methods don't play well with
59 # constructors registered for products.
61 def addConfiguredCpsDemoPortalForm(dispatcher):
62 """Form to add a CPS Site from ZMI.
63 """
64 return _cpsconfigurator.addConfiguredSiteForm(dispatcher)
66 def addConfiguredCpsDemoPortal(dispatcher, REQUEST=None, **kw):
67 """Add a CPSSite according to profile and extensions.
68 """
69 if REQUEST is not None:
70 kw.update(REQUEST.form)
71 return _cpsconfigurator.addConfiguredSite(dispatcher,
72 REQUEST=REQUEST, **kw)