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.form.business;
35
36 import fr.paris.lutece.portal.service.rbac.RBACResource;
37 import fr.paris.lutece.portal.service.regularexpression.RegularExpressionRemovalListenerService;
38 import fr.paris.lutece.portal.service.workgroup.AdminWorkgroupResource;
39 import fr.paris.lutece.portal.service.workgroup.WorkgroupRemovalListenerService;
40
41 import java.sql.Timestamp;
42
43 import java.util.Date;
44 import java.util.List;
45
46
47
48
49
50
51
52 public class Form implements AdminWorkgroupResource, RBACResource
53 {
54 public static final String RESOURCE_TYPE = "FORM_FORM_TYPE";
55 public static final int STATE_ENABLE = 1;
56 public static final int STATE_DISABLE = 0;
57 private static FormWorkgroupRemovalListener _listenerWorkgroup;
58 private static FormRegularExpressionRemovalListener _listenerRegularExpression;
59 private int _nIdForm;
60 private String _strTitle;
61 private String _strDescription;
62 private String _strWelcomeMessage;
63 private String _strUnavailabilityMessage;
64 private String _strRequirement;
65 private String _strWorkgroup;
66 private int _nIdMailingList;
67 private boolean _bActiveCaptcha;
68 private boolean _bActiveStoreAdresse;
69 private boolean _bLimitNumberResponse;
70 private boolean _bActiveRequirement;
71 private boolean _bSupportHTTPS;
72 private String _strLibelleValidateButton;
73 private String _strLibelleResetButton;
74 private Date _tDateBeginDisponibility;
75 private Date _tDateEndDisponibility;
76 private Timestamp _tDateCreation;
77 private boolean _nActive;
78 private boolean _bAutoPublicationActive;
79 private Recap _recap;
80 private List<FormAction> _listActions;
81 private int _nFormPageId;
82 private String _strInfoComplementary1;
83 private String _strInfoComplementary2;
84 private String _strInfoComplementary3;
85 private String _strInfoComplementary4;
86 private String _strInfoComplementary5;
87
88
89
90
91 public static void init( )
92 {
93
94 if ( _listenerWorkgroup == null )
95 {
96 _listenerWorkgroup = new FormWorkgroupRemovalListener( );
97 WorkgroupRemovalListenerService.getService( ).registerListener( _listenerWorkgroup );
98 }
99
100 if ( _listenerRegularExpression == null )
101 {
102 _listenerRegularExpression = new FormRegularExpressionRemovalListener( );
103 RegularExpressionRemovalListenerService.getService( ).registerListener( _listenerRegularExpression );
104 }
105 }
106
107
108
109
110
111 public int getIdMailingList( )
112 {
113 return _nIdMailingList;
114 }
115
116
117
118
119
120 public void setIdMailingList( int mailingListId )
121 {
122 _nIdMailingList = mailingListId;
123 }
124
125
126
127
128
129 public boolean isActiveCaptcha( )
130 {
131 return _bActiveCaptcha;
132 }
133
134
135
136
137
138 public void setActiveCaptcha( boolean activeCaptcha )
139 {
140 _bActiveCaptcha = activeCaptcha;
141 }
142
143
144
145
146
147 public boolean isActiveStoreAdresse( )
148 {
149 return _bActiveStoreAdresse;
150 }
151
152
153
154
155
156 public void setActiveStoreAdresse( boolean activeStoreAdrese )
157 {
158 _bActiveStoreAdresse = activeStoreAdrese;
159 }
160
161
162
163
164
165 public boolean isActiveRequirement( )
166 {
167 return _bActiveRequirement;
168 }
169
170
171
172
173
174 public void setActiveRequirement( boolean activeRequirement )
175 {
176 _bActiveRequirement = activeRequirement;
177 }
178
179
180
181
182
183 public String getLibelleValidateButton( )
184 {
185 return _strLibelleValidateButton;
186 }
187
188
189
190
191
192 public void setLibelleValidateButton( String libelleValidateButton )
193 {
194 _strLibelleValidateButton = libelleValidateButton;
195 }
196
197
198
199
200
201 public Date getDateEndDisponibility( )
202 {
203 return _tDateEndDisponibility;
204 }
205
206
207
208
209
210 public void setDateEndDisponibility( Date dateEndDisponibility )
211 {
212 _tDateEndDisponibility = dateEndDisponibility;
213 }
214
215
216
217
218
219 public String getRequirement( )
220 {
221 return _strRequirement;
222 }
223
224
225
226
227
228 public void setRequirement( String requirement )
229 {
230 _strRequirement = requirement;
231 }
232
233
234
235
236
237 public String getTitle( )
238 {
239 return _strTitle;
240 }
241
242
243
244
245
246 public void setTitle( String strTitle )
247 {
248 this._strTitle = strTitle;
249 }
250
251
252
253
254
255 public String getDescription( )
256 {
257 return _strDescription;
258 }
259
260
261
262
263
264 public void setDescription( String description )
265 {
266 this._strDescription = description;
267 }
268
269
270
271
272
273 public String getWelcomeMessage( )
274 {
275 return _strWelcomeMessage;
276 }
277
278
279
280
281
282 public void setWelcomeMessage( String strWelcomeMessage )
283 {
284 this._strWelcomeMessage = strWelcomeMessage;
285 }
286
287
288
289
290
291 public String getUnavailabilityMessage( )
292 {
293 return _strUnavailabilityMessage;
294 }
295
296
297
298
299
300 public void setUnavailabilityMessage( String unavailabilityMessage )
301 {
302 _strUnavailabilityMessage = unavailabilityMessage;
303 }
304
305
306
307
308
309 public String getWorkgroup( )
310 {
311 return _strWorkgroup;
312 }
313
314
315
316
317
318 public void setWorkgroup( String workGroup )
319 {
320 _strWorkgroup = workGroup;
321 }
322
323
324
325
326
327 public int getIdForm( )
328 {
329 return _nIdForm;
330 }
331
332
333
334
335
336 public void setIdForm( int idForm )
337 {
338 _nIdForm = idForm;
339 }
340
341
342
343
344
345 public boolean isActive( )
346 {
347 return _nActive;
348 }
349
350
351
352
353
354 public void setActive( boolean active )
355 {
356 _nActive = active;
357 }
358
359
360
361
362
363 public boolean isLimitNumberResponse( )
364 {
365 return _bLimitNumberResponse;
366 }
367
368
369
370
371
372 public void setLimitNumberResponse( boolean numberResponse )
373 {
374 _bLimitNumberResponse = numberResponse;
375 }
376
377
378
379
380
381 public Timestamp getDateCreation( )
382 {
383 return _tDateCreation;
384 }
385
386
387
388
389
390 public void setDateCreation( Timestamp dateCreation )
391 {
392 _tDateCreation = dateCreation;
393 }
394
395
396
397
398
399 public Recap getRecap( )
400 {
401 return _recap;
402 }
403
404
405
406
407
408 public void setRecap( Recap recap )
409 {
410 this._recap = recap;
411 }
412
413
414
415
416
417 public String getResourceTypeCode( )
418 {
419 return RESOURCE_TYPE;
420 }
421
422
423
424
425
426 public String getResourceId( )
427 {
428 return "" + _nIdForm;
429 }
430
431
432
433
434
435 public List<FormAction> getActions( )
436 {
437 return _listActions;
438 }
439
440
441
442
443
444 public void setActions( List<FormAction> formActions )
445 {
446 _listActions = formActions;
447 }
448
449
450
451
452
453 public int getFormPageId( )
454 {
455 return _nFormPageId;
456 }
457
458
459
460
461
462 public void setFormPageId( int formPageId )
463 {
464 _nFormPageId = formPageId;
465 }
466
467
468
469
470
471 public void setDateBeginDisponibility( Date _tDateBeginDisponibility )
472 {
473 this._tDateBeginDisponibility = _tDateBeginDisponibility;
474 }
475
476
477
478
479
480 public Date getDateBeginDisponibility( )
481 {
482 return _tDateBeginDisponibility;
483 }
484
485
486
487
488
489 public void setAutoPublicationActive( boolean _bAutoPublicationActive )
490 {
491 this._bAutoPublicationActive = _bAutoPublicationActive;
492 }
493
494
495
496
497
498 public boolean isAutoPublicationActive( )
499 {
500 return _bAutoPublicationActive;
501 }
502
503
504
505
506
507 public boolean isAutoPublished( )
508 {
509 return ( getDateBeginDisponibility( ) != null ) || ( getDateEndDisponibility( ) != null );
510 }
511
512
513
514
515
516 public void setLibelleResetButton( String _strLibelleResetButton )
517 {
518 this._strLibelleResetButton = _strLibelleResetButton;
519 }
520
521
522
523
524
525 public String getLibelleResetButton( )
526 {
527 return _strLibelleResetButton;
528 }
529
530
531
532
533
534 public String getInfoComplementary1( )
535 {
536 return _strInfoComplementary1;
537 }
538
539
540
541
542
543 public void setInfoComplementary1( String strInfoComplementary1 )
544 {
545 _strInfoComplementary1 = strInfoComplementary1;
546 }
547
548
549
550
551
552 public String getInfoComplementary2( )
553 {
554 return _strInfoComplementary2;
555 }
556
557
558
559
560
561 public void setInfoComplementary2( String strInfoComplementary2 )
562 {
563 _strInfoComplementary2 = strInfoComplementary2;
564 }
565
566
567
568
569
570 public String getInfoComplementary3( )
571 {
572 return _strInfoComplementary3;
573 }
574
575
576
577
578
579 public void setInfoComplementary3( String strInfoComplementary3 )
580 {
581 _strInfoComplementary3 = strInfoComplementary3;
582 }
583
584
585
586
587
588 public String getInfoComplementary4( )
589 {
590 return _strInfoComplementary4;
591 }
592
593
594
595
596
597 public void setInfoComplementary4( String strInfoComplementary4 )
598 {
599 _strInfoComplementary4 = strInfoComplementary4;
600 }
601
602
603
604
605
606 public String getInfoComplementary5( )
607 {
608 return _strInfoComplementary5;
609 }
610
611
612
613
614
615 public void setInfoComplementary5( String strInfoComplementary5 )
616 {
617 _strInfoComplementary5 = strInfoComplementary5;
618 }
619
620
621
622
623
624 public void setSupportHTTPS( boolean bSupportHTTPS )
625 {
626 this._bSupportHTTPS = bSupportHTTPS;
627 }
628
629
630
631
632
633 public boolean isSupportHTTPS( )
634 {
635 return _bSupportHTTPS;
636 }
637 }