1 | <?xml version="1.0"?>
|
---|
2 | <cps-workflow workflow_id="section_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="pending" title="Waiting for reviewer">
|
---|
11 | <exit-transition transition_id="accept"/>
|
---|
12 | <exit-transition transition_id="reject"/>
|
---|
13 | <permission-map name="Modify portal content"
|
---|
14 | acquired="False">
|
---|
15 | <permission-role>SectionReviewer</permission-role>
|
---|
16 | <permission-role>SectionManager</permission-role>
|
---|
17 | <permission-role>Manager</permission-role>
|
---|
18 | </permission-map>
|
---|
19 | <permission-map name="View" acquired="False">
|
---|
20 | <permission-role>SectionReviewer</permission-role>
|
---|
21 | <permission-role>SectionManager</permission-role>
|
---|
22 | <permission-role>Manager</permission-role>
|
---|
23 | <permission-role>Owner</permission-role>
|
---|
24 | </permission-map>
|
---|
25 | <permission-map name="WebDAV Lock items" acquired="False">
|
---|
26 | <permission-role>SectionReviewer</permission-role>
|
---|
27 | <permission-role>SectionManager</permission-role>
|
---|
28 | <permission-role>Manager</permission-role>
|
---|
29 | </permission-map>
|
---|
30 | <permission-map name="WebDAV Unlock items"
|
---|
31 | acquired="False">
|
---|
32 | <permission-role>SectionReviewer</permission-role>
|
---|
33 | <permission-role>SectionManager</permission-role>
|
---|
34 | <permission-role>Manager</permission-role>
|
---|
35 | </permission-map>
|
---|
36 | </state>
|
---|
37 | <state state_id="published" title="Public">
|
---|
38 | <exit-transition transition_id="unpublish"/>
|
---|
39 | <exit-transition transition_id="cut_copy_paste"/>
|
---|
40 | <exit-transition transition_id="sub_publishing"/>
|
---|
41 | <permission-map name="Modify portal content"
|
---|
42 | acquired="False">
|
---|
43 | <permission-role>Manager</permission-role>
|
---|
44 | </permission-map>
|
---|
45 | <permission-map name="View" acquired="False">
|
---|
46 | <permission-role>SectionReader</permission-role>
|
---|
47 | <permission-role>SectionReviewer</permission-role>
|
---|
48 | <permission-role>SectionManager</permission-role>
|
---|
49 | <permission-role>Manager</permission-role>
|
---|
50 | </permission-map>
|
---|
51 | <permission-map name="WebDAV Lock items" acquired="False">
|
---|
52 | <permission-role>Manager</permission-role>
|
---|
53 | </permission-map>
|
---|
54 | <permission-map name="WebDAV Unlock items"
|
---|
55 | acquired="False">
|
---|
56 | <permission-role>Manager</permission-role>
|
---|
57 | </permission-map>
|
---|
58 | </state>
|
---|
59 | <transition transition_id="accept"
|
---|
60 | title="Reviewer accepts publishing"
|
---|
61 | new_state="published" trigger="USER"
|
---|
62 | before_script=""
|
---|
63 | after_script="fixup_after_publish">
|
---|
64 | <action url="%(content_url)s/content_accept_form"
|
---|
65 | category="workflow">action_accept</action>
|
---|
66 | <guard>
|
---|
67 | <guard-role>Manager</guard-role>
|
---|
68 | <guard-role>SectionManager</guard-role>
|
---|
69 | <guard-role>SectionReviewer</guard-role>
|
---|
70 | </guard>
|
---|
71 | <transition-behavior behavior_id="merge"/>
|
---|
72 | </transition>
|
---|
73 | <transition transition_id="cut_copy_paste"
|
---|
74 | title="Cut/Copy/Paste" new_state=""
|
---|
75 | trigger="USER" before_script="" after_script="">
|
---|
76 |
|
---|
77 | <guard>
|
---|
78 | <guard-role>Manager</guard-role>
|
---|
79 | <guard-role>SectionManager</guard-role>
|
---|
80 | <guard-role>SectionReviewer</guard-role>
|
---|
81 | </guard>
|
---|
82 | <transition-behavior behavior_id="allow-sub-move"/>
|
---|
83 | <transition-behavior behavior_id="allow-sub-delete"/>
|
---|
84 | <transition-behavior behavior_id="allow-sub-copy"/>
|
---|
85 | </transition>
|
---|
86 | <transition transition_id="publish"
|
---|
87 | title="Member publishes directly"
|
---|
88 | new_state="published" trigger="USER"
|
---|
89 | before_script=""
|
---|
90 | after_script="fixup_after_publish">
|
---|
91 |
|
---|
92 | <guard>
|
---|
93 | <guard-role>Manager</guard-role>
|
---|
94 | <guard-role>SectionManager</guard-role>
|
---|
95 | <guard-role>SectionReviewer</guard-role>
|
---|
96 | </guard>
|
---|
97 | <transition-behavior behavior_id="initial-clone"/>
|
---|
98 | <transition-behavior behavior_id="freeze"/>
|
---|
99 | <transition-behavior behavior_id="merge"/>
|
---|
100 | </transition>
|
---|
101 | <transition transition_id="reject"
|
---|
102 | title="Reviewer rejects publishing"
|
---|
103 | new_state="" trigger="USER" before_script=""
|
---|
104 | after_script="">
|
---|
105 | <action url="%(content_url)s/content_reject_form"
|
---|
106 | category="workflow">action_reject</action>
|
---|
107 | <guard>
|
---|
108 | <guard-role>Manager</guard-role>
|
---|
109 | <guard-role>SectionManager</guard-role>
|
---|
110 | <guard-role>SectionReviewer</guard-role>
|
---|
111 | </guard>
|
---|
112 | <transition-behavior behavior_id="delete"/>
|
---|
113 | </transition>
|
---|
114 | <transition transition_id="sub_publishing"
|
---|
115 | title="Allow publishing of subdocuments"
|
---|
116 | new_state="" trigger="USER" before_script=""
|
---|
117 | after_script="">
|
---|
118 |
|
---|
119 | <guard>
|
---|
120 | <guard-role>Manager</guard-role>
|
---|
121 | <guard-role>SectionManager</guard-role>
|
---|
122 | <guard-role>SectionReviewer</guard-role>
|
---|
123 | <guard-role>SectionReader</guard-role>
|
---|
124 | </guard>
|
---|
125 | <transition-behavior behavior_id="allow-sub-publishing"/>
|
---|
126 | </transition>
|
---|
127 | <transition transition_id="submit"
|
---|
128 | title="Member requests publishing"
|
---|
129 | new_state="pending" trigger="USER"
|
---|
130 | before_script="" after_script="">
|
---|
131 |
|
---|
132 | <guard>
|
---|
133 | <guard-role>Manager</guard-role>
|
---|
134 | <guard-role>Member</guard-role>
|
---|
135 | </guard>
|
---|
136 | <transition-behavior behavior_id="initial-clone"/>
|
---|
137 | <transition-behavior behavior_id="freeze"/>
|
---|
138 | </transition>
|
---|
139 | <transition transition_id="unpublish"
|
---|
140 | title="Reviewer removes content from publication"
|
---|
141 | new_state="" trigger="USER" before_script=""
|
---|
142 | after_script="">
|
---|
143 | <action url="%(content_url)s/content_unpublish_form"
|
---|
144 | category="workflow">action_un_publish</action>
|
---|
145 | <guard>
|
---|
146 | <guard-role>Manager</guard-role>
|
---|
147 | <guard-role>SectionManager</guard-role>
|
---|
148 | <guard-role>SectionReviewer</guard-role>
|
---|
149 | </guard>
|
---|
150 | <transition-behavior behavior_id="delete"/>
|
---|
151 | </transition>
|
---|
152 | <variable variable_id="action" for_catalog="False"
|
---|
153 | for_status="True" update_always="True">
|
---|
154 | <description>The last transition</description>
|
---|
155 | <default>
|
---|
156 |
|
---|
157 | <expression>transition/getId|nothing</expression>
|
---|
158 | </default>
|
---|
159 | <guard>
|
---|
160 | </guard>
|
---|
161 | </variable>
|
---|
162 | <variable variable_id="actor" for_catalog="False"
|
---|
163 | for_status="True" update_always="True">
|
---|
164 | <description>The ID of the user who performed</description>
|
---|
165 | <default>
|
---|
166 |
|
---|
167 | <expression>user/getId</expression>
|
---|
168 | </default>
|
---|
169 | <guard>
|
---|
170 | </guard>
|
---|
171 | </variable>
|
---|
172 | <variable variable_id="comments" for_catalog="False"
|
---|
173 | for_status="True" update_always="True">
|
---|
174 | <description>Comments about the last transition</description>
|
---|
175 | <default>
|
---|
176 |
|
---|
177 | <expression>python:state_change.kwargs.get('comment', '')</expression>
|
---|
178 | </default>
|
---|
179 | <guard>
|
---|
180 | </guard>
|
---|
181 | </variable>
|
---|
182 | <variable variable_id="dest_container" for_catalog="False"
|
---|
183 | for_status="True" update_always="True">
|
---|
184 | <description>Destination container for the last paste/publish</description>
|
---|
185 | <default>
|
---|
186 |
|
---|
187 | <expression>python:state_change.kwargs.get('dest_container', '')</expression>
|
---|
188 | </default>
|
---|
189 | <guard>
|
---|
190 | </guard>
|
---|
191 | </variable>
|
---|
192 | <variable variable_id="language_revs" for_catalog="False"
|
---|
193 | for_status="True" update_always="True">
|
---|
194 | <description>The language revisions of the proxy</description>
|
---|
195 | <default>
|
---|
196 |
|
---|
197 | <expression>state_change/getLanguageRevisions</expression>
|
---|
198 | </default>
|
---|
199 | <guard>
|
---|
200 | </guard>
|
---|
201 | </variable>
|
---|
202 | <variable variable_id="review_history" for_catalog="False"
|
---|
203 | for_status="False" update_always="False">
|
---|
204 | <description>Provides access to workflow history</description>
|
---|
205 | <default>
|
---|
206 |
|
---|
207 | <expression>state_change/getHistory</expression>
|
---|
208 | </default>
|
---|
209 | <guard>
|
---|
210 | <guard-role>Manager</guard-role>
|
---|
211 | <guard-role>SectionManager</guard-role>
|
---|
212 | <guard-role>SectionReviewer</guard-role>
|
---|
213 | </guard>
|
---|
214 | </variable>
|
---|
215 | <variable variable_id="time" for_catalog="True"
|
---|
216 | for_status="True" update_always="True">
|
---|
217 | <description>Time of the last transition</description>
|
---|
218 | <default>
|
---|
219 |
|
---|
220 | <expression>state_change/getDateTime</expression>
|
---|
221 | </default>
|
---|
222 | <guard>
|
---|
223 | </guard>
|
---|
224 | </variable>
|
---|
225 | <script script_id="fixup_after_publish"
|
---|
226 | type="Script (Python)"
|
---|
227 | filename="workflows/section_content_wf/scripts/fixup_after_publish.py"/>
|
---|
228 | </cps-workflow>
|
---|