1 | <?xml version="1.0"?>
|
---|
2 | <cps-workflow workflow_id="workspace_content_wf"
|
---|
3 | title="CPS Workflow Definition"
|
---|
4 | state_variable="review_state"
|
---|
5 | meta_type="CPS Workflow">
|
---|
6 | <permission>Modify portal content</permission>
|
---|
7 | <permission>View</permission>
|
---|
8 | <permission>WebDAV Lock items</permission>
|
---|
9 | <permission>WebDAV Unlock items</permission>
|
---|
10 | <state state_id="draft" title="Draft">
|
---|
11 | <exit-transition transition_id="checkin_draft"/>
|
---|
12 | <exit-transition transition_id="abandon_draft"/>
|
---|
13 | <exit-transition transition_id="unlock"/>
|
---|
14 | <permission-map name="Modify portal content"
|
---|
15 | acquired="False">
|
---|
16 | <permission-role>Manager</permission-role>
|
---|
17 | <permission-role>WorkspaceManager</permission-role>
|
---|
18 | <permission-role>Owner</permission-role>
|
---|
19 | </permission-map>
|
---|
20 | <permission-map name="View" acquired="False">
|
---|
21 | <permission-role>Manager</permission-role>
|
---|
22 | <permission-role>WorkspaceManager</permission-role>
|
---|
23 | <permission-role>WorkspaceMember</permission-role>
|
---|
24 | <permission-role>Owner</permission-role>
|
---|
25 | </permission-map>
|
---|
26 | <permission-map name="WebDAV Lock items" acquired="False">
|
---|
27 | <permission-role>Manager</permission-role>
|
---|
28 | <permission-role>WorkspaceManager</permission-role>
|
---|
29 | <permission-role>Owner</permission-role>
|
---|
30 | </permission-map>
|
---|
31 | <permission-map name="WebDAV Unlock items"
|
---|
32 | acquired="False">
|
---|
33 | <permission-role>Manager</permission-role>
|
---|
34 | <permission-role>WorkspaceManager</permission-role>
|
---|
35 | <permission-role>Owner</permission-role>
|
---|
36 | </permission-map>
|
---|
37 | </state>
|
---|
38 | <state state_id="locked" title="Locked">
|
---|
39 | <exit-transition transition_id="unlock"/>
|
---|
40 | <permission-map name="Modify portal content"
|
---|
41 | acquired="False">
|
---|
42 | </permission-map>
|
---|
43 | <permission-map name="View" acquired="False">
|
---|
44 | <permission-role>Manager</permission-role>
|
---|
45 | <permission-role>WorkspaceManager</permission-role>
|
---|
46 | <permission-role>WorkspaceMember</permission-role>
|
---|
47 | <permission-role>WorkspaceReader</permission-role>
|
---|
48 | </permission-map>
|
---|
49 | <permission-map name="WebDAV Lock items" acquired="False">
|
---|
50 | </permission-map>
|
---|
51 | <permission-map name="WebDAV Unlock items"
|
---|
52 | acquired="False">
|
---|
53 | </permission-map>
|
---|
54 | </state>
|
---|
55 | <state state_id="work" title="Work">
|
---|
56 | <exit-transition transition_id="copy_submit"/>
|
---|
57 | <exit-transition transition_id="checkout_draft"/>
|
---|
58 | <exit-transition transition_id="cut_copy_paste"/>
|
---|
59 | <exit-transition transition_id="modify"/>
|
---|
60 | <exit-transition transition_id="translate"/>
|
---|
61 | <exit-transition transition_id="delete_translation"/>
|
---|
62 | <permission-map name="Modify portal content"
|
---|
63 | acquired="False">
|
---|
64 | <permission-role>Manager</permission-role>
|
---|
65 | <permission-role>Owner</permission-role>
|
---|
66 | <permission-role>WorkspaceManager</permission-role>
|
---|
67 | <permission-role>WorkspaceMember</permission-role>
|
---|
68 | </permission-map>
|
---|
69 | <permission-map name="View" acquired="False">
|
---|
70 | <permission-role>Manager</permission-role>
|
---|
71 | <permission-role>WorkspaceManager</permission-role>
|
---|
72 | <permission-role>WorkspaceMember</permission-role>
|
---|
73 | <permission-role>WorkspaceReader</permission-role>
|
---|
74 | </permission-map>
|
---|
75 | <permission-map name="WebDAV Lock items" acquired="False">
|
---|
76 | <permission-role>Manager</permission-role>
|
---|
77 | <permission-role>Owner</permission-role>
|
---|
78 | <permission-role>WorkspaceManager</permission-role>
|
---|
79 | <permission-role>WorkspaceMember</permission-role>
|
---|
80 | </permission-map>
|
---|
81 | <permission-map name="WebDAV Unlock items"
|
---|
82 | acquired="False">
|
---|
83 | <permission-role>Manager</permission-role>
|
---|
84 | <permission-role>Owner</permission-role>
|
---|
85 | <permission-role>WorkspaceManager</permission-role>
|
---|
86 | <permission-role>WorkspaceMember</permission-role>
|
---|
87 | </permission-map>
|
---|
88 | </state>
|
---|
89 | <transition transition_id="abandon_draft"
|
---|
90 | title="Abandon draft" new_state=""
|
---|
91 | trigger="USER"
|
---|
92 | before_script="unlock_locked_before_abandon"
|
---|
93 | after_script="">
|
---|
94 | <action url="%(content_url)s/content_abandon_draft_form"
|
---|
95 | category="workflow">action_abandon_draft</action>
|
---|
96 | <guard>
|
---|
97 | <guard-role>Manager</guard-role>
|
---|
98 | <guard-role>WorkspaceManager</guard-role>
|
---|
99 | <guard-role>Owner</guard-role>
|
---|
100 | </guard>
|
---|
101 | <transition-behavior behavior_id="delete"/>
|
---|
102 | </transition>
|
---|
103 | <transition transition_id="checkin_draft"
|
---|
104 | title="Checkin draft" new_state="locked"
|
---|
105 | trigger="USER" before_script="" after_script="">
|
---|
106 | <action url="%(content_url)s/content_checkin_draft_form"
|
---|
107 | category="workflow">action_checkin_draft</action>
|
---|
108 | <guard>
|
---|
109 | <guard-role>Manager</guard-role>
|
---|
110 | <guard-role>WorkspaceManager</guard-role>
|
---|
111 | <guard-role>Owner</guard-role>
|
---|
112 | </guard>
|
---|
113 | <transition-behavior behavior_id="checkin"/>
|
---|
114 | <checkin-allowed-transition transition_id="unlock"/>
|
---|
115 | </transition>
|
---|
116 | <transition transition_id="checkout_draft"
|
---|
117 | title="Checkout content into a draft"
|
---|
118 | new_state="locked" trigger="USER"
|
---|
119 | before_script="" after_script="">
|
---|
120 | <action url="%(content_url)s/content_checkout_draft_form"
|
---|
121 | category="workflow">action_checkout_draft</action>
|
---|
122 | <guard>
|
---|
123 | <guard-role>Manager</guard-role>
|
---|
124 | <guard-role>WorkspaceManager</guard-role>
|
---|
125 | <guard-role>WorkspaceMember</guard-role>
|
---|
126 | </guard>
|
---|
127 | <transition-behavior behavior_id="checkout"/>
|
---|
128 | <checkout-allowed-initial-transition
|
---|
129 | transition_id="checkout_draft_in"/>
|
---|
130 | </transition>
|
---|
131 | <transition transition_id="checkout_draft_in"
|
---|
132 | title="Draft is created" new_state="draft"
|
---|
133 | trigger="USER" before_script="" after_script="">
|
---|
134 |
|
---|
135 | <guard>
|
---|
136 | </guard>
|
---|
137 | <transition-behavior behavior_id="initial-checkout"/>
|
---|
138 | <transition-behavior behavior_id="freeze"/>
|
---|
139 | </transition>
|
---|
140 | <transition transition_id="copy_submit"
|
---|
141 | title="Copy content into a section for Publishing"
|
---|
142 | new_state="" trigger="USER" before_script=""
|
---|
143 | after_script="">
|
---|
144 | <action url="%(content_url)s/content_submit_form"
|
---|
145 | category="workflow">action_submit</action>
|
---|
146 | <guard>
|
---|
147 | <guard-role>Manager</guard-role>
|
---|
148 | <guard-role>WorkspaceManager</guard-role>
|
---|
149 | <guard-role>WorkspaceMember</guard-role>
|
---|
150 | </guard>
|
---|
151 | <transition-behavior behavior_id="clone"/>
|
---|
152 | <clone-allowed-transition transition_id="submit"/>
|
---|
153 | <clone-allowed-transition transition_id="publish"/>
|
---|
154 | </transition>
|
---|
155 | <transition transition_id="create" title="Initial creation"
|
---|
156 | new_state="work" trigger="USER"
|
---|
157 | before_script="" after_script="">
|
---|
158 |
|
---|
159 | <guard>
|
---|
160 | <guard-role>Manager</guard-role>
|
---|
161 | <guard-role>WorkspaceManager</guard-role>
|
---|
162 | <guard-role>WorkspaceMember</guard-role>
|
---|
163 | </guard>
|
---|
164 | <transition-behavior behavior_id="initial-create"/>
|
---|
165 | </transition>
|
---|
166 | <transition transition_id="cut_copy_paste"
|
---|
167 | title="Cut/Copy/Paste" new_state=""
|
---|
168 | trigger="USER" before_script="" after_script="">
|
---|
169 |
|
---|
170 | <guard>
|
---|
171 | <guard-role>Manager</guard-role>
|
---|
172 | <guard-role>WorkspaceManager</guard-role>
|
---|
173 | <guard-role>WorkspaceMember</guard-role>
|
---|
174 | </guard>
|
---|
175 | <transition-behavior behavior_id="allow-sub-move"/>
|
---|
176 | <transition-behavior behavior_id="allow-sub-delete"/>
|
---|
177 | <transition-behavior behavior_id="allow-sub-copy"/>
|
---|
178 | </transition>
|
---|
179 | <transition transition_id="delete_translation"
|
---|
180 | title="Delete a translation" new_state=""
|
---|
181 | trigger="USER"
|
---|
182 | before_script="delete_language_from_proxy"
|
---|
183 | after_script="">
|
---|
184 |
|
---|
185 | <guard>
|
---|
186 | <guard-permission>Modify portal content</guard-permission>
|
---|
187 | <guard-expression>python:not state_change.object.isDefaultLanguage()</guard-expression>
|
---|
188 | </guard>
|
---|
189 | </transition>
|
---|
190 | <transition transition_id="modify" title="Edit content"
|
---|
191 | new_state="" trigger="USER" before_script=""
|
---|
192 | after_script="">
|
---|
193 | <description>This transition provides a specific entry in status history</description>
|
---|
194 |
|
---|
195 | <guard>
|
---|
196 | <guard-role>Manager</guard-role>
|
---|
197 | <guard-role>Owner</guard-role>
|
---|
198 | <guard-role>WorkspaceManager</guard-role>
|
---|
199 | <guard-role>WorkspaceMember</guard-role>
|
---|
200 | </guard>
|
---|
201 | </transition>
|
---|
202 | <transition transition_id="translate"
|
---|
203 | title="Add translation" new_state=""
|
---|
204 | trigger="USER"
|
---|
205 | before_script="add_language_to_proxy"
|
---|
206 | after_script="">
|
---|
207 |
|
---|
208 | <guard>
|
---|
209 | <guard-permission>Modify portal content</guard-permission>
|
---|
210 | </guard>
|
---|
211 | </transition>
|
---|
212 | <transition transition_id="unlock"
|
---|
213 | title="Unlock content after a draft is done"
|
---|
214 | new_state="work" trigger="USER"
|
---|
215 | before_script="" after_script="">
|
---|
216 |
|
---|
217 | <guard>
|
---|
218 | </guard>
|
---|
219 | <transition-behavior behavior_id="allow-checkin"/>
|
---|
220 | </transition>
|
---|
221 | <variable variable_id="action" for_catalog="False"
|
---|
222 | for_status="True" update_always="True">
|
---|
223 | <description>The last transition</description>
|
---|
224 | <default>
|
---|
225 |
|
---|
226 | <expression>transition/getId|nothing</expression>
|
---|
227 | </default>
|
---|
228 | <guard>
|
---|
229 | </guard>
|
---|
230 | </variable>
|
---|
231 | <variable variable_id="actor" for_catalog="False"
|
---|
232 | for_status="True" update_always="True">
|
---|
233 | <description>The ID of the user who performed</description>
|
---|
234 | <default>
|
---|
235 |
|
---|
236 | <expression>user/getId</expression>
|
---|
237 | </default>
|
---|
238 | <guard>
|
---|
239 | </guard>
|
---|
240 | </variable>
|
---|
241 | <variable variable_id="comments" for_catalog="False"
|
---|
242 | for_status="True" update_always="True">
|
---|
243 | <description>Comments about the last transition</description>
|
---|
244 | <default>
|
---|
245 |
|
---|
246 | <expression>python:state_change.kwargs.get('comment', '')</expression>
|
---|
247 | </default>
|
---|
248 | <guard>
|
---|
249 | </guard>
|
---|
250 | </variable>
|
---|
251 | <variable variable_id="dest_container" for_catalog="False"
|
---|
252 | for_status="True" update_always="True">
|
---|
253 | <description>Destination container for the last paste/publish</description>
|
---|
254 | <default>
|
---|
255 |
|
---|
256 | <expression>python:state_change.kwargs.get('dest_container', '')</expression>
|
---|
257 | </default>
|
---|
258 | <guard>
|
---|
259 | </guard>
|
---|
260 | </variable>
|
---|
261 | <variable variable_id="language_revs" for_catalog="False"
|
---|
262 | for_status="True" update_always="True">
|
---|
263 | <description>The language revisions of the proxy</description>
|
---|
264 | <default>
|
---|
265 |
|
---|
266 | <expression>state_change/getLanguageRevisions</expression>
|
---|
267 | </default>
|
---|
268 | <guard>
|
---|
269 | </guard>
|
---|
270 | </variable>
|
---|
271 | <variable variable_id="review_history" for_catalog="False"
|
---|
272 | for_status="False" update_always="False">
|
---|
273 | <description>Provides access to workflow history</description>
|
---|
274 | <default>
|
---|
275 |
|
---|
276 | <expression>state_change/getHistory</expression>
|
---|
277 | </default>
|
---|
278 | <guard>
|
---|
279 | <guard-role>Manager</guard-role>
|
---|
280 | <guard-role>WorkspaceManager</guard-role>
|
---|
281 | <guard-role>WorkspaceMember</guard-role>
|
---|
282 | <guard-role>WorkspaceReader</guard-role>
|
---|
283 | </guard>
|
---|
284 | </variable>
|
---|
285 | <variable variable_id="time" for_catalog="True"
|
---|
286 | for_status="True" update_always="True">
|
---|
287 | <description>Time of the last transition</description>
|
---|
288 | <default>
|
---|
289 |
|
---|
290 | <expression>state_change/getDateTime</expression>
|
---|
291 | </default>
|
---|
292 | <guard>
|
---|
293 | </guard>
|
---|
294 | </variable>
|
---|
295 | <script script_id="add_language_to_proxy"
|
---|
296 | type="Script (Python)"
|
---|
297 | filename="workflows/workspace_content_wf/scripts/add_language_to_proxy.py"/>
|
---|
298 | <script script_id="delete_language_from_proxy"
|
---|
299 | type="Script (Python)"
|
---|
300 | filename="workflows/workspace_content_wf/scripts/delete_language_from_proxy.py"/>
|
---|
301 | <script script_id="unlock_locked_before_abandon"
|
---|
302 | type="Script (Python)"
|
---|
303 | filename="workflows/workspace_content_wf/scripts/unlock_locked_before_abandon.py"/>
|
---|
304 | </cps-workflow>
|
---|