3300f091c1e9ed4542c758744d57319e315bda60
[Plinn.git] / profiles / default / workflows / default_workflow / definition.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <dc-workflow workflow_id="default_workflow"
3 title="Plinn default workflow" description=""
4 state_variable="review_state"
5 initial_state="private" manager_bypass="False">
6 <permission>Access contents information</permission>
7 <permission>Change portal events</permission>
8 <permission>Change portal topics</permission>
9 <permission>Delete Owned Objects</permission>
10 <permission>Manage properties</permission>
11 <permission>Modify portal content</permission>
12 <permission>View</permission>
13 <state state_id="pending" title="Waiting for reviewer">
14 <exit-transition transition_id="publish"/>
15 <exit-transition transition_id="reject"/>
16 <exit-transition transition_id="retract"/>
17 <permission-map name="Access contents information"
18 acquired="True">
19 <permission-role>Manager</permission-role>
20 </permission-map>
21 <permission-map name="Change portal events"
22 acquired="False">
23 <permission-role>Manager</permission-role>
24 <permission-role>Reviewer</permission-role>
25 </permission-map>
26 <permission-map name="Change portal topics"
27 acquired="False">
28 <permission-role>Manager</permission-role>
29 <permission-role>Reviewer</permission-role>
30 </permission-map>
31 <permission-map name="Delete Owned Objects"
32 acquired="False">
33 <permission-role>Manager</permission-role>
34 </permission-map>
35 <permission-map name="Manage properties" acquired="False">
36 <permission-role>Manager</permission-role>
37 <permission-role>Reviewer</permission-role>
38 </permission-map>
39 <permission-map name="Modify portal content"
40 acquired="False">
41 <permission-role>Manager</permission-role>
42 <permission-role>Reviewer</permission-role>
43 </permission-map>
44 <permission-map name="View" acquired="False">
45 <permission-role>Contributor</permission-role>
46 <permission-role>Manager</permission-role>
47 <permission-role>Owner</permission-role>
48 <permission-role>Reader</permission-role>
49 <permission-role>Reviewer</permission-role>
50 </permission-map>
51 </state>
52 <state state_id="private"
53 title="Non-visible and editable only by owner">
54 <exit-transition transition_id="direct_publish"/>
55 <exit-transition transition_id="submit"/>
56 <permission-map name="Access contents information"
57 acquired="False">
58 <permission-role>Contributor</permission-role>
59 <permission-role>Manager</permission-role>
60 <permission-role>Owner</permission-role>
61 </permission-map>
62 <permission-map name="Change portal events"
63 acquired="False">
64 <permission-role>Contributor</permission-role>
65 <permission-role>Manager</permission-role>
66 <permission-role>Owner</permission-role>
67 </permission-map>
68 <permission-map name="Change portal topics"
69 acquired="False">
70 <permission-role>Contributor</permission-role>
71 <permission-role>Manager</permission-role>
72 <permission-role>Owner</permission-role>
73 </permission-map>
74 <permission-map name="Delete Owned Objects"
75 acquired="False">
76 <permission-role>Manager</permission-role>
77 <permission-role>Owner</permission-role>
78 </permission-map>
79 <permission-map name="Manage properties" acquired="False">
80 <permission-role>Contributor</permission-role>
81 <permission-role>Manager</permission-role>
82 <permission-role>Owner</permission-role>
83 </permission-map>
84 <permission-map name="Modify portal content"
85 acquired="False">
86 <permission-role>Contributor</permission-role>
87 <permission-role>Manager</permission-role>
88 <permission-role>Owner</permission-role>
89 </permission-map>
90 <permission-map name="View" acquired="False">
91 <permission-role>Contributor</permission-role>
92 <permission-role>Manager</permission-role>
93 <permission-role>Owner</permission-role>
94 <permission-role>Reader</permission-role>
95 </permission-map>
96 </state>
97 <state state_id="published" title="Public">
98 <exit-transition transition_id="reject"/>
99 <exit-transition transition_id="retract"/>
100 <permission-map name="Access contents information"
101 acquired="True">
102 <permission-role>Manager</permission-role>
103 </permission-map>
104 <permission-map name="Change portal events"
105 acquired="False">
106 <permission-role>Manager</permission-role>
107 </permission-map>
108 <permission-map name="Change portal topics"
109 acquired="False">
110 <permission-role>Manager</permission-role>
111 </permission-map>
112 <permission-map name="Delete Owned Objects"
113 acquired="False">
114 <permission-role>Manager</permission-role>
115 </permission-map>
116 <permission-map name="Manage properties" acquired="False">
117 <permission-role>Manager</permission-role>
118 </permission-map>
119 <permission-map name="Modify portal content"
120 acquired="False">
121 <permission-role>Manager</permission-role>
122 </permission-map>
123 <permission-map name="View" acquired="True">
124 <permission-role>Anonymous</permission-role>
125 <permission-role>Manager</permission-role>
126 </permission-map>
127 </state>
128 <transition transition_id="direct_publish"
129 title="Reviewer publishes content"
130 new_state="published" trigger="USER"
131 before_script="" after_script="">
132 <description>Reviewer can directly publish content if he have de Owner role (not necessarily ownership)</description>
133 <action url="%(content_url)s/content_publish_form?direct:boolean=True"
134 category="workflow" icon="">Publish</action>
135 <guard>
136 <guard-permission>Review portal content</guard-permission>
137 <guard-expression>python:user.allowed(here, ['Owner'])</guard-expression>
138 </guard>
139 </transition>
140 <transition transition_id="publish"
141 title="Reviewer publishes content"
142 new_state="published" trigger="USER"
143 before_script="" after_script="">
144 <action url="%(content_url)s/content_publish_form"
145 category="workflow" icon="">Publish</action>
146 <guard>
147 <guard-permission>Review portal content</guard-permission>
148 </guard>
149 </transition>
150 <transition transition_id="reject"
151 title="Reviewer rejects submission"
152 new_state="private" trigger="USER"
153 before_script="" after_script="">
154 <action url="%(content_url)s/content_reject_form"
155 category="workflow" icon="">Reject</action>
156 <guard>
157 <guard-permission>Review portal content</guard-permission>
158 </guard>
159 </transition>
160 <transition transition_id="retract"
161 title="Member retracts submission"
162 new_state="private" trigger="USER"
163 before_script="" after_script="">
164 <action url="%(content_url)s/content_retract_form"
165 category="workflow" icon="">Retract</action>
166 <guard>
167 <guard-permission>Request review</guard-permission>
168 <guard-expression>python:not(here.portal_membership.checkPermission('Review portal content', here))</guard-expression>
169 </guard>
170 </transition>
171 <transition transition_id="submit"
172 title="Member requests publishing"
173 new_state="pending" trigger="USER"
174 before_script="" after_script="">
175 <action url="%(content_url)s/content_submit_form"
176 category="workflow" icon="">Submit</action>
177 <guard>
178 <guard-permission>Request review</guard-permission>
179 </guard>
180 </transition>
181 <worklist worklist_id="reviewer_queue" title="">
182 <description>Reviewer tasks</description>
183 <action url="%(portal_url)s/list_pending_contents"
184 category="global" icon="">Pending (%(count)d)</action>
185 <guard>
186 <guard-expression>here/havePendingContents</guard-expression>
187 </guard>
188 <match name="review_state" values="pending"/>
189 </worklist>
190 <variable variable_id="action" for_catalog="False"
191 for_status="True" update_always="True">
192 <description>The last transition</description>
193 <default>
194
195 <expression>transition/getId|nothing</expression>
196 </default>
197 <guard>
198 </guard>
199 </variable>
200 <variable variable_id="actor" for_catalog="False"
201 for_status="True" update_always="True">
202 <description>The ID of the user who performed the last transition</description>
203 <default>
204
205 <expression>user/getId</expression>
206 </default>
207 <guard>
208 </guard>
209 </variable>
210 <variable variable_id="comments" for_catalog="False"
211 for_status="True" update_always="True">
212 <description>Comments about the last transition</description>
213 <default>
214
215 <expression>python:state_change.kwargs.get('comment', '')</expression>
216 </default>
217 <guard>
218 </guard>
219 </variable>
220 <variable variable_id="email_sent" for_catalog="False"
221 for_status="True" update_always="True">
222 <default>
223
224 <expression>python:scripts.sendNotificationEmail(state_change) or state_change.kwargs.get('email_sent', [])</expression>
225 </default>
226 <guard>
227 </guard>
228 </variable>
229 <variable variable_id="review_history" for_catalog="False"
230 for_status="False" update_always="False">
231 <description>Provides access to workflow history</description>
232 <default>
233
234 <expression>state_change/getHistory</expression>
235 </default>
236 <guard>
237 <guard-permission>Request review</guard-permission>
238 <guard-permission>Review portal content</guard-permission>
239 </guard>
240 </variable>
241 <variable variable_id="time" for_catalog="False"
242 for_status="True" update_always="True">
243 <description>Time of the last transition</description>
244 <default>
245
246 <expression>state_change/getDateTime</expression>
247 </default>
248 <guard>
249 </guard>
250 </variable>
251 <script script_id="sendNotificationEmail"
252 type="Script (Python)"
253 filename="workflows/default_workflow/scripts/sendNotificationEmail.py"
254 module="" function=""/>
255 </dc-workflow>