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