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.digglike.business;
35
36 import java.sql.Timestamp;
37 import java.util.ArrayList;
38 import java.util.List;
39
40 import org.apache.commons.lang.StringUtils;
41
42
43
44
45
46
47
48 public class SubmitFilter
49 {
50 public static final int SORT_BY_DATE_RESPONSE_ASC = 0;
51 public static final int SORT_BY_DATE_RESPONSE_DESC = 1;
52 public static final int SORT_BY_SCORE_ASC = 2;
53 public static final int SORT_BY_SCORE_DESC = 3;
54 public static final int SORT_BY_NUMBER_COMMENT_ASC = 4;
55 public static final int SORT_BY_NUMBER_COMMENT_DESC = 5;
56 public static final int SORT_BY_NUMBER_VOTE_ASC = 6;
57 public static final int SORT_BY_NUMBER_VOTE_DESC = 7;
58 public static final int SORT_MANUALLY = 8;
59 public static final int SORT_BY_NUMBER_VIEW_ASC = 9;
60 public static final int SORT_BY_NUMBER_VIEW_DESC = 10;
61 public static final int SORT_BY_DATE_MODIFY_ASC = 11;
62 public static final int SORT_BY_DATE_MODIFY_DESC = 12;
63 public static final int SORT_BY_PINNED_FIRST = 13;
64 public static final int ALL_INT = -1;
65 public static final int ID_TRUE = 1;
66 public static final int ID_FALSE = 0;
67 public static final int ID_ASC = 1;
68 public static final int ID_DESC = 0;
69 public static final int ID_PARENT_NULL = 0;
70 private int _nNumberVote = ALL_INT;
71 private int _nIdDigg = ALL_INT;
72 private int _nIdDiggSubmit = ALL_INT;
73 private int _nIdEntry = ALL_INT;
74 private int _nIdCategory = ALL_INT;
75 private int _nIdType = ALL_INT;
76 private int _nIdParent = ALL_INT;
77 private int _nIdReported = ALL_INT;
78 private Timestamp _tDateFirst;
79 private Timestamp _tDateLast;
80 private int _nIdDiggSubmitState = ALL_INT;
81 private int _nIdCommentSubmitState = ALL_INT;
82 private int _nIdPinned = ALL_INT;
83 private int _nIdContainsCommentDisable = ALL_INT;
84 private String _strLuteceUserKey = null;
85 private List<Integer> _listSortBy = new ArrayList<Integer>( );
86
87
88
89
90
91 public int getIdDigg( )
92 {
93 return _nIdDigg;
94 }
95
96
97
98
99
100 public void setIdDigg( int nIdDigg )
101 {
102 _nIdDigg = nIdDigg;
103 }
104
105
106
107
108
109 public boolean containsIdDigg( )
110 {
111 return ( _nIdDigg != ALL_INT );
112 }
113
114
115
116
117
118
119 public int getIdDiggSubmitState( )
120 {
121 return _nIdDiggSubmitState;
122 }
123
124
125
126
127
128 public void setIdDiggSubmitState( int idState )
129 {
130 _nIdDiggSubmitState = idState;
131 }
132
133
134
135
136
137 public boolean containsIdDiggSubmitState( )
138 {
139 return ( _nIdDiggSubmitState != ALL_INT );
140 }
141
142
143
144
145
146
147 public int getIdCommentSubmitState( )
148 {
149 return _nIdCommentSubmitState;
150 }
151
152
153
154
155
156 public void setIdCommentSubmitState( int nIdState )
157 {
158 _nIdCommentSubmitState = nIdState;
159 }
160
161
162
163
164
165 public boolean containsIdCommentSubmitState( )
166 {
167 return ( _nIdCommentSubmitState != ALL_INT );
168 }
169
170
171
172
173
174 public int getIdDiggSubmit( )
175 {
176 return _nIdDiggSubmit;
177 }
178
179
180
181
182
183 public void setIdDiggSubmit( int nIdDiggSubmit )
184 {
185 _nIdDiggSubmit = nIdDiggSubmit;
186 }
187
188
189
190
191
192 public boolean containsIdDiggSubmit( )
193 {
194 return ( _nIdDiggSubmit != ALL_INT );
195 }
196
197
198
199
200
201 public int getIdEntry( )
202 {
203 return _nIdEntry;
204 }
205
206
207
208
209
210 public void setIdEntry( int nIdEntry )
211 {
212 _nIdEntry = nIdEntry;
213 }
214
215
216
217
218
219 public boolean containsIdEntry( )
220 {
221 return ( _nIdEntry != ALL_INT );
222 }
223
224
225
226
227
228 public Timestamp getDateFirst( )
229 {
230 return _tDateFirst;
231 }
232
233
234
235
236
237 public void setDateFirst( Timestamp begin )
238 {
239 _tDateFirst = begin;
240 }
241
242
243
244
245
246 public boolean containsDateFirst( )
247 {
248 return ( _tDateFirst != null );
249 }
250
251
252
253
254
255 public Timestamp getDateLast( )
256 {
257 return _tDateLast;
258 }
259
260
261
262
263
264 public void setDateLast( Timestamp end )
265 {
266 _tDateLast = end;
267 }
268
269
270
271
272
273 public boolean containsDateLast( )
274 {
275 return ( _tDateLast != null );
276 }
277
278
279
280
281
282 public List<Integer> getSortBy( )
283 {
284 return _listSortBy;
285 }
286
287
288
289
290
291 public void setSortBy( List<Integer> listSortBy )
292 {
293 _listSortBy = listSortBy;
294 }
295
296
297
298
299
300 public boolean containsSortBy( )
301 {
302 return ( ( _listSortBy != null ) && ( _listSortBy.size( ) != 0 ) );
303 }
304
305
306
307
308
309 public boolean containsSortBy( Integer nSort )
310 {
311 if ( ( nSort != null ) && ( _listSortBy != null ) && ( _listSortBy.size( ) != 0 ) )
312 {
313 for ( Integer nSortBy : _listSortBy )
314 {
315 if ( nSortBy.equals( nSort ) )
316 {
317 return true;
318 }
319 }
320 }
321
322 return false;
323 }
324
325
326
327
328
329
330 public boolean convertIdBoolean( int nIdBoolean )
331 {
332 if ( nIdBoolean == ID_TRUE )
333 {
334 return true;
335 }
336
337 return false;
338 }
339
340
341
342
343
344 public int getIdCategory( )
345 {
346 return _nIdCategory;
347 }
348
349
350
351
352
353 public void setIdCategory( int nIdCategory )
354 {
355 _nIdCategory = nIdCategory;
356 }
357
358
359
360
361
362 public boolean containsIdCategory( )
363 {
364 return ( _nIdCategory != ALL_INT );
365 }
366
367
368
369
370
371
372 public int getIdReported( )
373 {
374 return _nIdReported;
375 }
376
377
378
379
380
381
382 public void setIdReported( int nIdReported )
383 {
384 _nIdReported = nIdReported;
385 }
386
387
388
389
390
391 public boolean containsIdReported( )
392 {
393 return ( _nIdReported != ALL_INT );
394 }
395
396
397
398
399
400 public int getNumberVote( )
401 {
402 return _nNumberVote;
403 }
404
405
406
407
408
409 public void setNumberVote( int nNumberVote )
410 {
411 _nNumberVote = nNumberVote;
412 }
413
414
415
416
417
418 public boolean containsNumberVote( )
419 {
420 return ( _nNumberVote != ALL_INT );
421 }
422
423
424
425
426 public void setLuteceUserKey( String strLuteceUserKey )
427 {
428 this._strLuteceUserKey = strLuteceUserKey;
429 }
430
431
432
433
434 public String getLuteceUserKey( )
435 {
436 return _strLuteceUserKey;
437 }
438
439
440
441
442
443 public boolean containsLuteceUserKey( )
444 {
445 return ( !StringUtils.isEmpty( _strLuteceUserKey) );
446 }
447
448
449
450
451
452 public int getIdParent( )
453 {
454 return _nIdParent;
455 }
456
457
458
459
460
461 public void setIdParent( int nIdParent )
462 {
463 _nIdParent = nIdParent;
464 }
465
466
467
468
469
470 public boolean containsIdParent( )
471 {
472 return ( _nIdParent != ALL_INT );
473 }
474
475
476
477
478
479
480 public int getIdPinned( )
481 {
482 return _nIdPinned;
483 }
484
485
486
487
488
489
490 public void setIdPinned( int nIdPinned )
491 {
492 _nIdPinned = nIdPinned;
493 }
494
495
496
497
498
499 public boolean containsIdPinned( )
500 {
501 return ( _nIdPinned != ALL_INT );
502 }
503
504
505
506
507
508 public int getIdType( )
509 {
510 return _nIdType;
511 }
512
513
514
515
516
517 public void setIdType( int nIdType )
518 {
519 _nIdType = nIdType;
520 }
521
522
523
524
525
526 public boolean containsIdType( )
527 {
528 return ( _nIdType != ALL_INT );
529 }
530
531
532
533
534
535
536 public int getIdContainsCommentDisable( )
537 {
538 return _nIdContainsCommentDisable;
539 }
540
541
542
543
544
545
546
547 public void setIdContainsCommentDisable( int nIdContainsCommentDisable )
548 {
549 this._nIdContainsCommentDisable = nIdContainsCommentDisable;
550 }
551
552
553
554
555
556 public boolean containsIdContainsCommentDisable( )
557 {
558 return ( _nIdContainsCommentDisable != ALL_INT );
559 }
560 }