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