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