-
Notifications
You must be signed in to change notification settings - Fork 5
/
meta.py
152 lines (121 loc) · 4.35 KB
/
meta.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
from opengever.base.model import GROUP_ID_LENGTH
from opengever.base.model import UNIT_ID_LENGTH
from opengever.setup.directives import deployment_directive
from opengever.setup.directives import ldap_directive
from zope.configuration.exceptions import ConfigurationError
from zope.configuration.fields import Tokens
from zope.interface import Interface
from zope.schema import Bool
from zope.schema import TextLine
def register_deployment(context, **kwargs):
title = kwargs.get('title')
policyless = kwargs.get('is_policyless', False)
if policyless:
if kwargs.get('admin_unit_id') is not None:
raise ConfigurationError(
'Disallowed parameter:',
'admin_unit_id',
'Not allowed in policyless setup style.')
else:
if kwargs.get('admin_unit_id') is None:
raise ConfigurationError(
'Missing parameter:',
'admin_unit_id',
'Required unless policyless setup style is used.')
context.action(title, deployment_directive, (title, ), kw=kwargs)
class IDeploymentDirective(Interface):
title = TextLine(
title=u'Plone Deployment title',
description=u'Displayed in deployment selection dropdown.',
required=True)
policy_profile = TextLine(
title=u'Policy Profile',
required=True)
additional_profiles = Tokens(
title=u'Additional profiles',
description=u'Generic setup profile names (without profile- prefix)',
default=None,
required=False,
value_type=TextLine()
)
admin_unit_id = TextLine(
title=u'AdminUnit ID',
description=u'AdminUnit corresponding to this plone site',
required=False,
max_length=UNIT_ID_LENGTH)
mail_domain = TextLine(
title=u'Mail domain',
default=u'localhost',
required=True)
mail_from_address = TextLine(
title=u'Mail from address',
description=u'E-Mail address used as Plone-Site sender address',
default=u'noreply@opengever.4teamwork.ch',
required=True)
is_default = Bool(
title=u'Is Default',
description=u'Whether this option should be pre-selected in setup.',
default=False,
required=True)
is_policyless = Bool(
title=u'Is policyless',
description=u'Whether this is a policyless deployment.',
default=False,
required=False)
reader_group = TextLine(
title=u'Reader group',
required=False,
max_length=GROUP_ID_LENGTH)
rolemanager_group = TextLine(
title=u'Rolemanager group',
required=False,
max_length=GROUP_ID_LENGTH)
administrator_group = TextLine(
title=u'Administrator group',
required=False,
max_length=GROUP_ID_LENGTH)
limited_admin_group = TextLine(
title=u'Limited admin group',
required=False,
max_length=GROUP_ID_LENGTH)
archivist_group = TextLine(
title=u'Archivist group',
required=False,
max_length=GROUP_ID_LENGTH)
records_manager_group = TextLine(
title=u'Records manager group',
required=False,
max_length=GROUP_ID_LENGTH)
api_group = TextLine(
title=u'API group',
required=False,
max_length=GROUP_ID_LENGTH)
workspace_creator_group = TextLine(
title=u'Workspace creator group',
required=False,
max_length=GROUP_ID_LENGTH)
workspace_user_group = TextLine(
title=u'Workspace user group',
required=False,
max_length=GROUP_ID_LENGTH)
workspace_client_user_group = TextLine(
title=u'Workspace client group',
required=False,
max_length=GROUP_ID_LENGTH)
def register_ldap(context, **kwargs):
title = kwargs.get('title')
context.action(title, ldap_directive, (title, ), kw=kwargs)
class ILDAPDirective(Interface):
title = TextLine(
title=u'LDAP Deployment title',
description=u'Displayed in LDAP selection dropdown.',
required=True)
ldap_profile = TextLine(
title=u'LDAP Profile',
description=u'Profile id of the LDAP configuration profile',
required=True)
is_default = Bool(
title=u'Is Default',
description=u'Whether this option should be pre-selected in setup.',
default=False,
required=True)