-
-
Notifications
You must be signed in to change notification settings - Fork 81
/
Contents.yml
369 lines (365 loc) · 24.7 KB
/
Contents.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
-
type: content
mode: create
content_type: xxx # Content type identifier
parent_location: x # The id of the parent location. When a non numeric string is used, it is assumed to be a location remote id
attributes:
attribute1: value1
attribute2: value2
attribute3: |
value can be
on multiple lines
and new lines are preserved on parsing
attribute4: >
value on multiple
lines, but new line is not preserved on parsing
# ezimage/ezbinaryfile/ezmedia file attribute example
attribute5:
path: 'path/to/image' # Relative path from MigrationVersions/images/ or MigrationVersions/files/, MigrationVersions/media/ or absolute path
alt_text: xyz # Optional, only used for images
filename: abc # Optional, taken from the actual file if not specified
mime_type: def # DISCOURAGED. Optional. For ezbinaryfile and ezmedia only.
# If not specified, the actual file is analyzed using the php function mime_content_type()
# NB: this seems to work only with eZPublish < 5.4 / 2014.11; it causes a bug in 2014.11,
# and started to be completely ignored in some later version...
# See bug https://github.com/kaliop-uk/ezmigrationbundle/issues/147
autoplay: false # Optional. For ezmedia only
loop: false # Optional. For ezmedia only
has_controller: false # Optional. For ezmedia only
width: 123 # Optional. For ezmedia only
height: 456 # Optional. For ezmedia only
# ezimage/ezbinaryfile/ezmedia file attribute example, using simplified form
attribute5b: '/path/to/image' # Relative path from MigrationVersions/images/ or MigrationVersions/files/ or MigrationVersions/media/, or absolute path
# ezxmltext, showing an example of using references
attribute6: '<section><paragraph><embed view="embed" size="medium" object_id="[reference:example_reference]" /></paragraph></section>'
# Adding values to an ezauthor field
attribute7:
-
name: Test Author
email: test@example.com
-
name: Another Author
email: another@example.com
# Adding values to an ezobjectrelation field
attribute8: x # content id or remote_id or string: reference:xxx
# Adding values to an ezobjectrelationlist field
attribute9: [ x, reference:xxx ] # array of content ids or remote ids or reference strings
# ezurl, using 2 different syntaxes
attribute10: http://a/great/link
attribute11:
link: http://another/link
text: the url text
# ezgmaplocation
attribute12:
latitude: 1.0
longitude: 2.0
address: 'Angel, London'
# ezgmaplocation - NULL value
attribute13:
latitude: null
longitude: null
# eztags, setting 2-or-more tags
attribute14:
# this will add one tag, identified by its id
- id: 12
# this will add one tag, identified by its remote_id
- remote_id: abc
# this will add zero or more tags, matched by keyword
- keyword: hello
# ezselection, multiple values
attribute15: [ 1, "option 2" ] # array of selection options ids or textual values
# ezselection, single value
attribute16: "option 3" # integer index or string
# ezcountry
attribute17: [IT, ESP, 41, Taiwan] # Either Alpha2, Alpha3, IDC or Name array of the countries, as defined in %ezpublish.fieldType.ezcountry.data%.
# A single value can be provided also as string instead of array
# ezmatrix, both the ezplatform and community version
attribute18: # nb: the keys must match column identifiers
- { authors: 'Author A, Author B', title: 'Lorem ipsum', release_info: '2012' }
- { authors: 'Author 1, Author 2', title: 'Lorem ipsum dolor sit amet', release_info: 'R info abc' }
always_available: true|false # Optional, will default to content type defaultAlwaysAvailable
is_hidden: true|false # Optional
lang: xxx-YY # Optional, will fallback to default language if not provided (--default-language option or 'eng-GB' by default)
location_remote_id: xxx # Optional, remote id of the new location which will be created
modification_date: zzz # Optional, set content modification date (if integer: timestamp is assumed. if string, see: http://php.net/manual/en/datetime.formats.php)
# Optionally assign object states to the content
object_states:
- xxx # int|string an object state id or identifier. If the identifier is not unique, use obj-state-gorup-identifier/obj-state-identifier
- yyy
other_parent_locations: [x, y, z] # Optional, ids of extra parent locations. When a non numeric string is used as element, it is assumed to be a location remote id
owner: xxx # user id, login or email if unique; Optional, set the content owner
priority: 0 # Optional. Set the priority of the main location
publication_date: zzz # Optional, set content publication date (if integer: timstamp is assumed. if string, see: http://php.net/manual/en/datetime.formats.php)
remote_id: custom_remote_id # Optional, will set a custom remote id
section: x # string|int Optional section id or identifier
sort_field: x # Optional. See Locations.yml for details
sort_order: ASC|DESC # Optional
version_creator: yyy # user id, login or email if unique; Optional, set the creator of the 1st version
# The list in references tells the manager to store specific values for later use by other steps in the current migration.
# NB: these are NEW VARIABLES THAT YOU ARE CREATING. They are not used in the current migration step!
references: # Optional
# short syntax:
referenceId: attributeId # (possible values and meaning are explained for the 'long syntax')
# long syntax:
-
identifier: referenceId # A string used to identify the reference
attribute: attributeId # The attribute to get the value of for the reference.
# Supports: content_id, content_remote_id,
# always_available, content_type_id, content_type_identifier, current_version_no,
# location_id, location_remote_id, main_language_code, modification_date, name, object_state.$stategroup,
# owner_id, path, publication_date, section_id as well as attributes.$name (for scalar
# attributes) and complex expressions for non-scalar attributes, such as f.e.
# attributes.objectrelationlistattr.destinationContentIds[0] (1st element in an object-relation)
# attributes.objectrelationlistattr.destinationContentIds.length(@) (nr. of elements in an object-relation)
# (for the full syntax supported, see jmespath)
overwrite: true|false # Optional, default false. If not set, and the reference already exists, an exception is thrown
if: # Optional. If set, the migration step will be skipped unless the condition is matched
"reference:_ref_name": # name of a reference to be used for the test
_operator_: value # allowed operators: eq, gt, gte, lt, lte, ne, count, length, regexp, satisfies
# It is also possible to create or update contents with multiple languages in a single pass by using the following:
-
type: content
mode: create
content_type: xxx # Content type identifier
parent_location: x # The id of the parent location. When a non numeric string is used, it is assumed to be a location remote id
attributes:
attribute1:
eng-GB: value english
fre-FR: valeur francais
attribute2:
eng-GB: 1
fre-FR: 2
# NB: Please note that when using this syntax, ALL attribute values must be specified by using a language key
-
type: content
mode: update
match: # Specify ONLY ONE of the following, to match a content or a set of contents to update
# NB: matching by content_id or content_remote_id will make the migration fail in case of a miss. However,
# matching by any other criterion will _not_ make the migration fail even when there are no matches.
# If you want to make sure that the migration aborts in case of a miss, use `expect: one` or `expect: many`
# as described below
content_id: x # int|int[]
content_remote_id: xxx # string|string[]
location_id: x # int|int[]
location_remote_id: xxx # string|string[]
attribute:
_attr_name_:
_operator_: _value_ # _operator_: eq, gt, gte, lt, lte, in, between, like; value: depending on the attribute type
attribute:
_attr_name_: empty # used to match empty fields
content_type_id: yyy # int|int[] a content type id
content_type_identifier: yyy # string|string[] a content type identifier
creation_date:
_operator_: value # _operator_: eq, gt, gte, lt, lte, value: unix timestamp
group: xxx # int|int[] a user group id or remote id
lang: xxx # language code, eg. eng-GB
modification_date:
_operator_: value # _operator_: eq, gt, gte, lt, lte, value: unix timestamp
object_state: zzz # int|int[]|string|string[] object state(s) either as id or using 'group/identifier'
owner: xxx # user id, login or email if unique
parent_location_id: x # int|int[]
parent_location_remote_id: xxx # string|string[]
query_type: # match using a user-defined QueryType. NB: this can not be used together with AND/OR/OT clauses
name: string
parameters: [a, b, c]
section: xx # int|int[]|string|string[] section id(s) or identifier(s)
subtree: /1/2/2345 # string|string[]
visibility: true # bool
relates_to: # match contents which relate to some other content(s). NB: can not be mixed in AND/OR matches
content_id/content_remote_id: # int|int[]|string|string[]
related_from: # match contents which are related to by some other content(s). NB: can not be mixed in AND/OR matches
content_id/content_remote_id: # int|int[]|string|string[]
or: # match any of the conditions below
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition can be any of ones specified above, including 'and' and 'or'
and: # match all of the conditions below
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
not: # matches elements NOT satisfying the wrapped condition
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
match_offset: 0 # optional
match_limit: 0 # optional
match_sort: # optional. If set, it has to be an array
- { sort_field: content_id|content_name|modified|published|section_identifier|section_name, sort_order: ASC|DESC }
match_tolerate_misses: false # optional. Do not fail the execution if there is no content matching, when matching by id or identifier
attributes: # the list of attribute identifier value pairs. For the format to use, see above
attribute1: value1
attribute2: value2
always_available: true|false # Optional
lang: xxx-YY # Optional, will fallback to default language if not provided (--default-language option or 'eng-GB' by default)
main_location: int|string # Optional, will set the main location. If passed a string, the location remote_id is assumed
modification_date: zzz # Optional, set content modification date (for formats, see: http://php.net/manual/en/datetime.formats.php)
new_remote_id: xxx # string Optional set a new RemoteId
# Optionally assign object states to the content
object_states:
- xxx # int|string an object state id or identifier. For the format to use, see above
owner: xxx # user id, login or email if unique; Optional, set the content owner (original creator)
publication_date: zzz # Optional, set content publication date (for formats, see: http://php.net/manual/en/datetime.formats.php)
section: x # string|int Optional section id or identifier
version_creator: yyy # user id, login or email if unique; Optional, set the creator of the new version
# The list in references tells the manager to store specific values for later use by other steps in the current migration.
# NB: these are NEW VARIABLES THAT YOU ARE CREATING. They are not used in the current migration step!
references: # Optional
# short syntax:
referenceId: attributeId # (possible values and meaning are explained for the 'long syntax')
# long syntax:
-
identifier: referenceId # A string used to identify the reference
attribute: attributeId # The attribute to get the value of for the reference
# supports: content_id, content_remote_id,
# always_available, content_type_id, content_type_identifier, current_version_no,
# location_id, location_remote_id, main_language_code, modification_date, name, object_state.$stategroup,
# owner_id, path, publication_date, section_id as well as attributes.$name (for scalar
# attributes) and complex expressions for non-scalar attributes, such as f.e.
# attributes.objectrelationlistattr.destinationContentIds[0] (1st element in an object-relation)
# attributes.objectrelationlistattr.destinationContentIds.length(@) (nr. of elements in an object-relation)
# (for the full syntax supported, see jmespath)
# 'count' can be used to set a reference to the number of items matched
overwrite: true|false # Optional, default false. If not set, and the reference already exists, an exception is thrown
expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change
# 'one': only one element should be matched; reference values will be scalars
# 'any': zero or more element should be matched; reference values will be arrays
# 'many': one or more element should be matched; reference values will be arrays
if: # Optional. If set, the migration step will be skipped unless the condition is matched
"reference:_ref_name": # name of a reference to be used for the test
_operator_: value # allowed operators: eq, gt, gte, lt, lte, ne, count, length, regexp, satisfies
-
type: content
mode: delete
match: # Specify ONLY ONE of the following, to match a content or a set of contents to remove
# NB: matching by content_id or content_remote_id will make the migration fail in case of a miss. However,
# matching by any other criterion will _not_ make the migration fail even when there are no matches.
# If you want to make sure that the migration aborts in case of a miss, use `expect: one` or `expect: many`
# as described below
content_id: x # int|int[]
content_remote_id: xxx # string|string[]
location_id: x # int|int[]
location_remote_id: xxx # string|string[]
attribute:
_attr_name_:
_operator_: value # _operator_: eq, gt, gte, lt, lte, in, between, like; value: depending on the attribute type
content_type_id: yyy # int|int[] a content type id
content_type_identifier: yyy # string|string[] a content type identifier
creation_date:
_operator_: value # _operator_: eq, gt, gte, lt, lte, value: unix timestamp
group: xxx # int|int[] a user group id or remote id
lang: xxx # language code, eg. eng-GB
modification_date:
_operator_: value # _operator_: eq, gt, gte, lt, lte, value: unix timestamp
object_state: zzz # int|int[]|string|string[] object state(s) either as id or using 'group/identifier'
owner: xxx # user id, login or email if unique
parent_location_id: x # int|int[]
parent_location_remote_id: xxx # string|string[]
query_type: # match using a user-defined QueryType. NB: this can not be used together with AND/OR/OT clauses
name: string
parameters: [a, b, c]
section: xx # int|int[]|string|string[] section id(s) or identifier(s)
subtree: /1/2/2345 # string|string[]
visibility: true # bool
relates_to: # match contents which relate to some other content(s). NB: can not be mixed in AND/OR matches
content_id/content_remote_id: # int|int[]|string|string[]
related_from: # match contents which are related to by some other content(s). NB: can not be mixed in AND/OR matches
content_id/content_remote_id: # int|int[]|string|string[]
or: # match any of the conditions below
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition can be any of ones specified above, including 'and' and 'or'
and: # match all of the conditions below
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
not: # matches elements NOT satisfying the wrapped condition
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
match_offset: 0 # optional
match_limit: 0 # optional
match_sort: # optional. If set, it has to be an array
- { sort_field: content_id|content_name|modified|published|section_identifier|section_name, sort_order: ASC|DESC }
match_tolerate_misses: false # optional. Do not fail the execution if there is no content matching, when matching by id or identifier
references: # Optional. See above for allowed values
expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change
if: # Optional. If set, the migration step will be skipped unless the condition is matched
"reference:_ref_name": # name of a reference to be used for the test
_operator_: value # allowed operators: eq, gt, gte, lt, lte, ne, count, length, regexp, satisfies
-
type: content
mode: load
match: # Specify ONLY ONE of the following, to match a content or a set of contents to load
# NB: matching by content_id or content_remote_id will make the migration fail in case of a miss. However,
# matching by any other criterion will _not_ make the migration fail even when there are no matches.
# If you want to make sure that the migration aborts in case of a miss, use `expect: one` or `expect: many`
# as described below
content_id: x # int|int[]
content_remote_id: xxx # string|string[]
location_id: x # int|int[]
location_remote_id: xxx # string|string[]
attribute:
_attr_name_:
_operator_: value # _operator_: eq, gt, gte, lt, lte, in, between, like; value: depending on the attribute type
content_type_id: yyy # int|int[] a content type id
content_type_identifier: yyy # string|string[] a content type identifier
creation_date:
_operator_: value # _operator_: eq, gt, gte, lt, lte, value: unix timestamp
group: xxx # int|int[] a user group id or remote id
lang: xxx # language code, eg. eng-GB
modification_date:
_operator_: value # _operator_: eq, gt, gte, lt, lte, value: unix timestamp
object_state: zzz # int|int[]|string|string[] object state(s) either as id or using 'group/identifier'
owner: xxx # user id, login or email if unique
parent_location_id: x # int|int[]
parent_location_remote_id: xxx # string|string[]
query_type: # match using a user-defined QueryType. NB: this can not be used together with AND/OR/OT clauses
name: string
parameters: [a, b, c]
section: xx # int|int[]|string|string[] section id(s) or identifier(s)
subtree: /1/2/2345 # string|string[]
visibility: true # bool
relates_to: # match contents which relate to some other content(s). NB: can not be mixed in AND/OR matches
content_id/content_remote_id: # int|int[]|string|string[]
related_from: # match contents which are related to by some other content(s). NB: can not be mixed in AND/OR matches
content_id/content_remote_id: # int|int[]|string|string[]
or: # match any of the conditions below
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition can be any of ones specified above, including 'and' and 'or'
and: # match all of the conditions below
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
-
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
not: # matches elements NOT satisfying the wrapped condition
_condition_: value # where _condition_ can be any of ones specified above, including 'and' and 'or'
match_offset: 0 # optional
match_limit: 0 # optional
match_sort: # optional. If set, it has to be an array
- { sort_field: content_id|content_name|modified|published|section_identifier|section_name, sort_order: ASC|DESC }
match_tolerate_misses: false # optional. Do not fail the execution if there is no content matching, when matching by id or identifier
# The list in references tells the manager to store specific values for later use by other steps in the current migration.
# NB: these are NEW VARIABLES THAT YOU ARE CREATING. They are not used in the current migration step!
references: # Optional
# short syntax:
referenceId: attributeId # (possible values and meaning are explained for the 'long syntax')
# long syntax:
-
identifier: referenceId # A string used to identify the reference
attribute: attributeId # The attribute to get the value of for the reference
# supports: content_id, content_remote_id,
# always_available, content_type_id, content_type_identifier, current_version_no,
# location_id, main_language_code, modification_date, name, object_state.$stategroup,
# owner_id, path, publication_date, section_id as well as attributes.$name (for scalar
# attributes) and complex expressions for non-scalar attributes, such as f.e.
# attributes.objectrelationlistattr.destinationContentIds[0] (1st element in an object-relation)
# attributes.objectrelationlistattr.destinationContentIds.length(@) (nr. of elements in an object-relation)
# (for the full syntax supported, see jmespath)
# 'count' can be used to set a reference to the number of items matched
overwrite: true|false # Optional, default false. If not set, and the reference already exists, an exception is thrown
expect: one|any|many # Optional. If set, the number of matched items will be validated, and the type of values set to created references will change
if: # Optional. If set, the migration step will be skipped unless the condition is matched
"reference:_ref_name": # name of a reference to be used for the test
_operator_: value # allowed operators: eq, gt, gte, lt, lte, ne, count, length, regexp, satisfies