Skip to content

Commit 39d3fe1

Browse files
committed
use Yaml syntax shortcut for name-only tags in 2.0, refs #797
1 parent 8e3f621 commit 39d3fe1

File tree

1 file changed

+132
-44
lines changed
  • bundles/org.zikula.modulestudio.generator/src/org/zikula/modulestudio/generator/cartridges/zclassic/controller

1 file changed

+132
-44
lines changed

bundles/org.zikula.modulestudio.generator/src/org/zikula/modulestudio/generator/cartridges/zclassic/controller/ServiceDefinitions.xtend

+132-44
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,12 @@ class ServiceDefinitions {
127127
- "@zikula_users_module.current_user"
128128
«ENDIF»
129129
- "@«modPrefix».controller_helper"
130-
tags:
131-
- { name: zikula.link_container }
130+
«IF targets('2.0'
131+
tags: ['zikula.link_container']
132+
«ELSE»
133+
tags:
134+
- { name: zikula.link_container }
135+
«ENDIF»
132136
'''
133137
134138
def private entityFactory(Application it) '''
@@ -179,8 +183,12 @@ class ServiceDefinitions {
179183
«IF !targets('1.5'
180184
- "@translator.default"
181185
«ENDIF»
182-
tags:
183-
- { name: doctrine.event_subscriber }
186+
«IF targets('2.0'
187+
tags: ['doctrine.event_subscriber']
188+
«ELSE»
189+
tags:
190+
- { name: doctrine.event_subscriber }
191+
«ENDIF»
184192

185193
«FOR className : getSubscriberNames»
186194
«modPrefix».«className.toLowerCase»_listener:
@@ -199,8 +207,12 @@ class ServiceDefinitions {
199207
- "@gedmo_doctrine_extensions.listener.ip_traceable"
200208
- "@request_stack"
201209
«ENDIF»
202-
tags:
203-
- { name: kernel.event_subscriber }
210+
«IF targets('2.0'
211+
tags: ['kernel.event_subscriber']
212+
«ELSE»
213+
tags:
214+
- { name: kernel.event_subscriber }
215+
«ENDIF»
204216

205217
«ENDFOR»
206218
«IF targets('1.5'
@@ -211,8 +223,12 @@ class ServiceDefinitions {
211223
«IF needsApproval»
212224
- "@«modPrefix».notification_helper"
213225
«ENDIF»
214-
tags:
215-
- { name: kernel.event_subscriber }
226+
«IF targets('2.0'
227+
tags: ['kernel.event_subscriber']
228+
«ELSE»
229+
tags:
230+
- { name: kernel.event_subscriber }
231+
«ENDIF»
216232

217233
«ENDIF»
218234
«IF getSubscriberNames.contains('IpTrace'
@@ -281,47 +297,71 @@ class ServiceDefinitions {
281297

282298
«modPrefix».form.type.field.array:
283299
class: «nsBase»Field\ArrayType
284-
tags:
285-
- { name: form.type }
300+
«IF targets('2.0'
301+
tags: ['form.type']
302+
«ELSE»
303+
tags:
304+
- { name: form.type }
305+
«ENDIF»
286306
«ENDIF»
287307
«IF hasColourFields»
288308

289309
«modPrefix».form.type.field.colour:
290310
class: «nsBase»Field\ColourType
291-
tags:
292-
- { name: form.type }
311+
«IF targets('2.0'
312+
tags: ['form.type']
313+
«ELSE»
314+
tags:
315+
- { name: form.type }
316+
«ENDIF»
293317
«ENDIF»
294318
«IF hasGeographical»
295319

296320
«modPrefix».form.type.field.geo:
297321
class: «nsBase»Field\GeoType
298-
tags:
299-
- { name: form.type }
322+
«IF targets('2.0'
323+
tags: ['form.type']
324+
«ELSE»
325+
tags:
326+
- { name: form.type }
327+
«ENDIF»
300328
«ENDIF»
301329
«IF hasMultiListFields»
302330

303331
«modPrefix».form.type.field.multilist:
304332
class: «nsBase»Field\MultiListType
305333
arguments:
306334
- "@«modPrefix».listentries_helper"
307-
tags:
308-
- { name: form.type }
335+
«IF targets('2.0'
336+
tags: ['form.type']
337+
«ELSE»
338+
tags:
339+
- { name: form.type }
340+
«ENDIF»
309341
«ENDIF»
310342
«IF hasTranslatable»
311343

312344
«modPrefix».form.type.field.translation:
313345
class: «nsBase»Field\TranslationType
314-
tags:
315-
- { name: form.type }
346+
«IF targets('2.0'
347+
tags: ['form.type']
348+
«ELSE»
349+
tags:
350+
- { name: form.type }
351+
«ENDIF»
316352
«ENDIF»
317353
«IF hasTrees»
318354

319355
«modPrefix».form.type.field.entitytree:
320356
class: «nsBase»Field\EntityTreeType
321357
arguments:
322358
- "@«modPrefix».entity_display_helper"
323-
tags:
324-
- { name: form.type }
359+
«IF targets('2.0'
360+
tags: ['form.type']
361+
«ELSE»
362+
tags:
363+
- { name: form.type }
364+
«ENDIF»
325365
«ENDIF»
326366
«IF hasUploads»
327367

@@ -332,17 +372,25 @@ class ServiceDefinitions {
332372
- "@request_stack"
333373
- "@«modPrefix».image_helper"
334374
- "@«modPrefix».upload_helper"
335-
tags:
336-
- { name: form.type }
375+
«IF targets('2.0'
376+
tags: ['form.type']
377+
«ELSE»
378+
tags:
379+
- { name: form.type }
380+
«ENDIF»
337381
«ENDIF»
338382
«IF needsUserAutoCompletion»
339383

340384
«modPrefix».form.type.field.user:
341385
class: «nsBase»Field\UserType
342386
arguments:
343387
- "@zikula_users_module.user_repository"
344-
tags:
345-
- { name: form.type }
388+
«IF targets('2.0'
389+
tags: ['form.type']
390+
«ELSE»
391+
tags:
392+
- { name: form.type }
393+
«ENDIF»
346394
«ENDIF»
347395
«IF needsAutoCompletion»
348396

@@ -351,8 +399,12 @@ class ServiceDefinitions {
351399
arguments:
352400
- "@router"
353401
- "@«modPrefix».entity_factory"
354-
tags:
355-
- { name: form.type }
402+
«IF targets('2.0'
403+
tags: ['form.type']
404+
«ELSE»
405+
tags:
406+
- { name: form.type }
407+
«ENDIF»
356408
«ENDIF»
357409
'''
358410
@@ -384,8 +436,12 @@ class ServiceDefinitions {
384436
«IF needsFeatureActivationHelper»
385437
- "@«modPrefix».feature_activation_helper"
386438
«ENDIF»
387-
tags:
388-
- { name: form.type }
439+
«IF targets('2.0'
440+
tags: ['form.type']
441+
«ELSE»
442+
tags:
443+
- { name: form.type }
444+
«ENDIF»
389445
«ENDFOR»
390446
«ENDIF»
391447
«IF hasEditActions»
@@ -424,8 +480,12 @@ class ServiceDefinitions {
424480
«ENDIF»
425481
calls:
426482
- [setLockingApi, ["@?zikula_pagelock_module.api.locking"]]
427-
tags:
428-
- { name: form.type }
483+
«IF targets('2.0'
484+
tags: ['form.type']
485+
«ELSE»
486+
tags:
487+
- { name: form.type }
488+
«ENDIF»
429489
«ENDIF»
430490

431491
«modPrefix».form.type.«entity.name.formatForDB»:
@@ -450,8 +510,12 @@ class ServiceDefinitions {
450510
«IF needsFeatureActivationHelper»
451511
- "@«modPrefix».feature_activation_helper"
452512
«ENDIF»
453-
tags:
454-
- { name: form.type }
513+
«IF targets('2.0'
514+
tags: ['form.type']
515+
«ELSE»
516+
tags:
517+
- { name: form.type }
518+
«ENDIF»
455519
«ENDFOR»
456520
«ENDIF»
457521
«IF hasDeleteActions && !targets('1.5'
@@ -460,17 +524,25 @@ class ServiceDefinitions {
460524
class: «nsBase.replace('Type\\', ''DeleteEntityType
461525
arguments:
462526
- "@translator.default"
463-
tags:
464-
- { name: form.type }
527+
«IF targets('2.0'
528+
tags: ['form.type']
529+
«ELSE»
530+
tags:
531+
- { name: form.type }
532+
«ENDIF»
465533
«ENDIF»
466534
«IF generateListBlock»
467535

468536
«modPrefix».form.type.block.itemlist:
469537
class: «nsBase.replace('Form\\Type\\', ''Block\Form\Type\ItemListBlockType
470538
arguments:
471539
- "@translator.default"
472-
tags:
473-
- { name: form.type }
540+
«IF targets('2.0'
541+
tags: ['form.type']
542+
«ELSE»
543+
tags:
544+
- { name: form.type }
545+
«ENDIF»
474546
«ENDIF»
475547
«IF generateExternalControllerAndFinder»
476548
«FOR entity : getAllEntities.filter[hasDisplayAction]»
@@ -482,8 +554,12 @@ class ServiceDefinitions {
482554
«IF needsFeatureActivationHelper»
483555
- "@«modPrefix».feature_activation_helper"
484556
«ENDIF»
485-
tags:
486-
- { name: form.type }
557+
«IF targets('2.0'
558+
tags: ['form.type']
559+
«ELSE»
560+
tags:
561+
- { name: form.type }
562+
«ENDIF»
487563
«ENDFOR»
488564
«ENDIF»
489565
«IF needsConfig»
@@ -496,8 +572,12 @@ class ServiceDefinitions {
496572
«IF hasUserGroupSelectors»
497573
- "@zikula_groups_module.group_repository"
498574
«ENDIF»
499-
tags:
500-
- { name: form.type }
575+
«IF targets('2.0'
576+
tags: ['form.type']
577+
«ELSE»
578+
tags:
579+
- { name: form.type }
580+
«ENDIF»
501581
«ENDIF»
502582
'''
503583
@@ -756,8 +836,12 @@ class ServiceDefinitions {
756836
- "@«modPrefix».listentries_helper"
757837
«ENDIF»
758838
public: false
759-
tags:
760-
- { name: twig.extension }
839+
«IF targets('2.0'
840+
tags: ['twig.extension']
841+
«ELSE»
842+
tags:
843+
- { name: twig.extension }
844+
«ENDIF»
761845
'''
762846
763847
def private logger(Application it) '''
@@ -769,7 +853,11 @@ class ServiceDefinitions {
769853
# Log processor
770854
«modPrefix».log.processor:
771855
class: Monolog\Processor\PsrLogMessageProcessor
772-
tags:
773-
- { name: monolog.processor }
856+
«IF targets('2.0'
857+
tags: ['monolog.processor']
858+
«ELSE»
859+
tags:
860+
- { name: monolog.processor }
861+
«ENDIF»
774862
'''
775863
}

0 commit comments

Comments
 (0)