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.newsletter.business;
35
36 import fr.paris.lutece.plugins.newsletter.service.NewsletterTemplateRemovalService;
37 import fr.paris.lutece.portal.service.rbac.RBACResource;
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
44
45
46 public class NewsLetter implements AdminWorkgroupResource, RBACResource
47 {
48
49
50
51 public static final String RESOURCE_TYPE = "NEWSLETTER";
52 private static final String EMPTY_STRING = "";
53 private static NewsletterWorkgroupRemovalListener _listenerWorkgroup;
54
55
56
57 private int _nId;
58 private String _strName;
59 private String _strDescription;
60 private Timestamp _dateLastSending;
61 private String _strHtml;
62 private int _nNewsLetterTemplateId;
63 private boolean _bIsValidationActive;
64 private boolean _bIsCaptchaActive;
65 private String _strWorkgroup;
66 private String _strTestRecipients;
67 private String _strUnsubscribe;
68 private String _strNewsletterSenderMail;
69 private String _strNewsletterSenderName;
70 private String _strTermOfService;
71 private String _strSubject;
72 private int _nNbSections;
73
74
75
76
77 public static synchronized void init( )
78 {
79
80 if ( _listenerWorkgroup == null )
81 {
82 _listenerWorkgroup = new NewsletterWorkgroupRemovalListener( );
83 WorkgroupRemovalListenerService.getService( ).registerListener( _listenerWorkgroup );
84 }
85 NewsletterTemplateRemovalService.getService( ).registerListener( new NewsletterTemplateRemovalListener( ) );
86 }
87
88
89
90
91
92
93 public int getId( )
94 {
95 return _nId;
96 }
97
98
99
100
101
102
103
104 public void setId( int nId )
105 {
106 _nId = nId;
107 }
108
109
110
111
112
113
114 public String getTestSubject( )
115 {
116 return _strSubject;
117 }
118
119
120
121
122
123
124
125 public void setTestSubject( String strTestSubject )
126 {
127 _strSubject = strTestSubject;
128 }
129
130
131
132
133
134
135
136
137 public void setValidationActive( boolean bIsValidationActive )
138 {
139 _bIsValidationActive = bIsValidationActive;
140 }
141
142
143
144
145
146
147 public boolean isValidationActive( )
148 {
149 return _bIsValidationActive;
150 }
151
152
153
154
155
156
157
158
159 public void setCaptchaActive( boolean bIsCaptchaActive )
160 {
161 _bIsCaptchaActive = bIsCaptchaActive;
162 }
163
164
165
166
167
168
169 public boolean isCaptchaActive( )
170 {
171 return _bIsCaptchaActive;
172 }
173
174
175
176
177
178
179 public String getName( )
180 {
181 return _strName;
182 }
183
184
185
186
187
188
189
190 public void setName( String strName )
191 {
192 _strName = ( strName == null ) ? EMPTY_STRING : strName;
193 }
194
195
196
197
198
199
200 public String getDescription( )
201 {
202 return _strDescription;
203 }
204
205
206
207
208
209
210
211 public void setDescription( String strDescription )
212 {
213 _strDescription = ( strDescription == null ) ? EMPTY_STRING : strDescription;
214 }
215
216
217
218
219
220
221 public String getUnsubscribe( )
222 {
223 return _strUnsubscribe;
224 }
225
226
227
228
229
230
231
232 public void setUnsubscribe( String strUnsubscribe )
233 {
234 _strUnsubscribe = ( strUnsubscribe == null ) ? EMPTY_STRING : strUnsubscribe;
235 }
236
237
238
239
240
241
242
243 public void setDateLastSending( Timestamp dateLastSending )
244 {
245 _dateLastSending = dateLastSending;
246 }
247
248
249
250
251
252
253 public Timestamp getDateLastSending( )
254 {
255 return _dateLastSending;
256 }
257
258
259
260
261
262
263 public String getHtml( )
264 {
265 return _strHtml;
266 }
267
268
269
270
271
272
273
274 public void setHtml( String strHtml )
275 {
276 _strHtml = ( strHtml == null ) ? EMPTY_STRING : strHtml;
277 }
278
279
280
281
282
283
284 public String getTOS( )
285 {
286 return _strTermOfService;
287 }
288
289
290
291
292
293
294
295 public void setTOS( String strTermOfService )
296 {
297 _strTermOfService = strTermOfService;
298 }
299
300
301
302
303
304
305 public int getNewsLetterTemplateId( )
306 {
307 return _nNewsLetterTemplateId;
308 }
309
310
311
312
313
314
315
316 public void setNewsLetterTemplateId( int nNewsLetterTemplateId )
317 {
318 _nNewsLetterTemplateId = nNewsLetterTemplateId;
319 }
320
321
322
323
324
325
326 public String getWorkgroup( )
327 {
328 return _strWorkgroup;
329 }
330
331
332
333
334
335
336
337 public void setWorkgroup( String strWorkgroup )
338 {
339 _strWorkgroup = strWorkgroup;
340 }
341
342
343
344
345
346
347 public String getTestRecipients( )
348 {
349 return _strTestRecipients;
350 }
351
352
353
354
355
356
357
358 public void setTestRecipients( String strTestRecipients )
359 {
360 _strTestRecipients = strTestRecipients;
361 }
362
363
364
365
366
367
368 public String getNewsletterSenderMail( )
369 {
370 return _strNewsletterSenderMail;
371 }
372
373
374
375
376
377
378
379 public void setNewsletterSenderMail( String strNewsletterSenderMail )
380 {
381 _strNewsletterSenderMail = strNewsletterSenderMail;
382 }
383
384
385
386
387
388
389 public String getNewsletterSenderName( )
390 {
391 return _strNewsletterSenderName;
392 }
393
394
395
396
397
398
399
400 public void setNewsletterSenderName( String strNewsletterSenderName )
401 {
402 _strNewsletterSenderName = strNewsletterSenderName;
403 }
404
405
406
407
408
409
410 public String getResourceId( )
411 {
412 return "" + getId( );
413 }
414
415
416
417
418
419
420 public String getResourceTypeCode( )
421 {
422 return RESOURCE_TYPE;
423 }
424
425
426
427
428
429
430 public int getNbSections( )
431 {
432 return _nNbSections;
433 }
434
435
436
437
438
439
440
441 public void setNbSections( int nNbSections )
442 {
443 this._nNbSections = nNbSections;
444 }
445 }