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 package fr.paris.lutece.plugins.releaser.business;
35
36 import javax.validation.constraints.*;
37
38 import org.hibernate.validator.constraints.*;
39
40 import fr.paris.lutece.portal.service.rbac.RBACResource;
41
42 import java.io.Serializable;
43 import java.util.ArrayList;
44 import java.util.HashMap;
45 import java.util.List;
46
47
48
49
50
51 public class Site extends AbstractReleaserResource implements RBACResource, Serializable
52 {
53
54
55 public static final String RESOURCE_TYPE = "site";
56
57
58 public static final String PERMISSION_RELEASE_SITE = "releaseSitePermission";
59 public static final String PERMISSION_MODIFY_SITE = "modifySitePermission";
60 public static final String PERMISSION_DELETE_SITE = "deleteSitePermission";
61
62 private HashMap<String, Boolean> permissions;
63
64
65 private static final long serialVersionUID = 1L;
66
67
68
69 private int _nId;
70
71
72 @NotEmpty( message = "#i18n{releaser.validation.site.ArtifactId.notEmpty}" )
73 @Size( max = 50, message = "#i18n{releaser.validation.site.ArtifactId.size}" )
74 private String _strArtifactId;
75
76
77 private int _nIdCluster;
78
79
80 @URL( message = "#i18n{portal.validation.message.url}" )
81 @NotEmpty( message = "#i18n{releaser.validation.site.ScmUrl.notEmpty}" )
82 @Size( max = 255, message = "#i18n{releaser.validation.site.ScmUrl.size}" )
83 private String _strScmUrl;
84
85
86 @NotEmpty( message = "#i18n{releaser.validation.site.Name.notEmpty}" )
87 @Size( max = 50, message = "#i18n{releaser.validation.site.Name.size}" )
88 private String _strName;
89
90
91 @NotEmpty( message = "#i18n{releaser.validation.site.Description.notEmpty}" )
92 @Size( max = 255, message = "#i18n{releaser.validation.site.Description.size}" )
93 private String _strDescription;
94
95
96 @Size( max = 50, message = "#i18n{releaser.validation.site.JiraKey.size}" )
97 private String _strJiraKey;
98
99
100 private String _strTagInformation;
101
102
103 private String _strCluster;
104
105
106 private List<Dependency> _listCurrentDependencies = new ArrayList<>( );
107
108
109 private List<Component> _listComponents = new ArrayList<>( );
110
111
112 private String _strCurrentVersion;
113
114
115 private String _strLastReleaseVersion;
116
117
118 private String _strNextReleaseVersion;
119
120
121 private List<String> _listTargetVersions;
122
123
124 private int _nTargetVersionIndex;
125
126
127 private String _strNextSnapshotVersion;
128
129
130 private String _strGroupId;
131
132
133 private boolean _bTheme;
134
135
136 private List<String> _listBranches;
137
138
139 private String _strBranchReleaseFrom;
140
141
142
143
144
145
146 public int getId( )
147 {
148 return _nId;
149 }
150
151
152
153
154
155
156
157 public void setId( int nId )
158 {
159 _nId = nId;
160 }
161
162
163
164
165
166
167 public String getArtifactId( )
168 {
169 return _strArtifactId;
170 }
171
172
173
174
175
176
177
178 public void setArtifactId( String strArtifactId )
179 {
180 _strArtifactId = strArtifactId;
181 }
182
183
184
185
186
187
188 public int getIdCluster( )
189 {
190 return _nIdCluster;
191 }
192
193
194
195
196
197
198
199 public void setIdCluster( int nIdCluster )
200 {
201 _nIdCluster = nIdCluster;
202 }
203
204
205
206
207
208
209 public String getScmUrl( )
210 {
211 return _strScmUrl;
212 }
213
214
215
216
217
218
219
220 public void setScmUrl( String strScmUrl )
221 {
222 _strScmUrl = strScmUrl;
223 }
224
225
226
227
228
229
230 public String getName( )
231 {
232 return _strName;
233 }
234
235
236
237
238
239
240
241 public void setName( String strName )
242 {
243 _strName = strName;
244 }
245
246
247
248
249
250
251 public String getDescription( )
252 {
253 return _strDescription;
254 }
255
256
257
258
259
260
261
262 public void setDescription( String strDescription )
263 {
264 _strDescription = strDescription;
265 }
266
267
268
269
270
271
272 public String getJiraKey( )
273 {
274 return _strJiraKey;
275 }
276
277
278
279
280
281
282
283 public void setJiraKey( String strJiraKey )
284 {
285 _strJiraKey = strJiraKey;
286 }
287
288
289
290
291
292
293
294 public void addCurrentDependency( Dependency dependency )
295 {
296 _listCurrentDependencies.add( dependency );
297 }
298
299
300
301
302
303
304 public List<Dependency> getCurrentDependencies( )
305 {
306 return _listCurrentDependencies;
307 }
308
309
310
311
312
313
314
315 public void addComponent( Component component )
316 {
317 _listComponents.add( component );
318 }
319
320
321
322
323
324
325 public List<Component> getComponents( )
326 {
327 return _listComponents;
328 }
329
330
331
332
333
334
335 public String getVersion( )
336 {
337 return _strCurrentVersion;
338 }
339
340
341
342
343
344
345
346 public void setVersion( String strVersion )
347 {
348 _strCurrentVersion = strVersion;
349 }
350
351
352
353
354
355
356 public String getCluster( )
357 {
358 return _strCluster;
359 }
360
361
362
363
364
365
366
367 public void setCluster( String strCluster )
368 {
369 _strCluster = strCluster;
370 }
371
372
373
374
375
376
377 public String getLastReleaseVersion( )
378 {
379 return _strLastReleaseVersion;
380 }
381
382
383
384
385
386
387
388 public void setLastReleaseVersion( String strLastReleaseVersion )
389 {
390 _strLastReleaseVersion = strLastReleaseVersion;
391 }
392
393
394
395
396
397
398 public String getNextReleaseVersion( )
399 {
400 return _strNextReleaseVersion;
401 }
402
403
404
405
406
407
408
409 public void setNextReleaseVersion( String strNextReleaseVersion )
410 {
411 _strNextReleaseVersion = strNextReleaseVersion;
412 }
413
414
415
416
417
418
419 public String getNextSnapshotVersion( )
420 {
421 return _strNextSnapshotVersion;
422 }
423
424
425
426
427
428
429
430 public void setNextSnapshotVersion( String strNextSnapshotVersion )
431 {
432 _strNextSnapshotVersion = strNextSnapshotVersion;
433 }
434
435
436
437
438
439
440
441 public void setTargetVersions( List<String> listTargetVersions )
442 {
443 _listTargetVersions = listTargetVersions;
444 }
445
446
447
448
449
450
451 public List<String> getTargetVersions( )
452 {
453 return _listTargetVersions;
454 }
455
456
457
458
459
460
461
462 public void setTargetVersionIndex( int nIndex )
463 {
464 _nTargetVersionIndex = nIndex;
465 }
466
467
468
469
470
471
472 public int getTargetVersionIndex( )
473 {
474 return _nTargetVersionIndex;
475 }
476
477
478
479
480
481
482 public String getTagInformation( )
483 {
484 return _strTagInformation;
485 }
486
487
488
489
490
491
492
493 public void setTagInformation( String _strTagInfotmation )
494 {
495 this._strTagInformation = _strTagInfotmation;
496 }
497
498
499
500
501
502
503 public String getGroupId( )
504 {
505 return _strGroupId;
506 }
507
508
509
510
511
512
513
514 public void setGroupId( String _strGroupId )
515 {
516 this._strGroupId = _strGroupId;
517 }
518
519
520
521
522
523
524 public boolean isTheme( )
525 {
526 return _bTheme;
527 }
528
529
530
531
532
533
534
535 public void setTheme( boolean _bTheme )
536 {
537 this._bTheme = _bTheme;
538 }
539
540 public List<String> getBranches( )
541 {
542 return _listBranches;
543 }
544
545 public void setBranches( List<String> listBranches )
546 {
547 _listBranches = listBranches;
548 }
549
550 public String getBranchReleaseFrom( )
551 {
552 return _strBranchReleaseFrom;
553 }
554
555 public void setBranchReleaseFrom( String _strBranchReleaseFrom )
556 {
557 this._strBranchReleaseFrom = _strBranchReleaseFrom;
558 }
559
560
561
562
563
564
565 @Override
566 public String getTargetVersion( )
567 {
568
569 return getNextReleaseVersion( );
570 }
571
572
573
574
575
576
577 @Override
578 public String getResourceTypeCode( )
579 {
580 return RESOURCE_TYPE;
581 }
582
583
584
585
586
587
588 @Override
589 public String getResourceId( )
590 {
591 return String.valueOf( _nId );
592 }
593
594 public HashMap<String, Boolean> getPermissions( )
595 {
596 return permissions;
597 }
598
599 public void setPermissions( HashMap<String, Boolean> permissions )
600 {
601 if ( this.permissions == null )
602 this.permissions = new HashMap<String, Boolean>( );
603 else
604 this.permissions.clear( );
605
606 if ( permissions != null )
607 {
608 this.permissions.putAll( permissions );
609 }
610 }
611
612 }