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.calendar.modules.ical;
35
36 import fr.paris.lutece.plugins.calendar.business.Event;
37 import fr.paris.lutece.plugins.calendar.service.Utils;
38 import fr.paris.lutece.portal.service.image.ImageResource;
39
40 import java.util.Date;
41
42
43
44
45
46
47 public class ICalEvent implements Event
48 {
49 private static final long serialVersionUID = -5892714649982713744L;
50
51
52 private static final int DATE_ONLY_LENGTH = 8;
53 private static final int DATE_TIME_LENGTH = 15;
54
55
56 private Date _dateEvent;
57 private String _strDescription;
58 private String _strLocation;
59 private String _strStartHour;
60 private String _strStartMinute;
61 private String _strEndHour;
62 private String _strEndMinute;
63 private String _strTitle;
64 private String _strEventClass;
65 private String _strDateTimeStart;
66 private String _strDateTimeEnd;
67 private String _strCategories;
68 private String _strStatus;
69 private int _nPriority;
70 private String _strUrl;
71 private int _nPeriodicity;
72 private int _nOccurrence;
73 private String _strLocationTown;
74 private String _strLocationZip;
75 private String _strLocationAddress;
76 private String _strMapUrl;
77 private String _strLinkUrl;
78 private int _nDocumentId;
79 private String _strPageUrl;
80 private ImageResource _imageRessource;
81 private int _nTopEvent;
82 private Date _dateEnd;
83 private Date _dateCreation;
84 private int _nId;
85 private String _searchType;
86
87
88
89
90
91
92
93
94 public int getId( )
95 {
96 return _nId;
97 }
98
99
100
101
102
103
104 public Date getDate( )
105 {
106 return _dateEvent;
107 }
108
109
110
111
112
113
114 public String getTitle( )
115 {
116 return _strTitle;
117 }
118
119
120
121
122
123
124 public String getEventClass( )
125 {
126 return _strEventClass;
127 }
128
129
130
131
132
133
134 public String getLocation( )
135 {
136 return _strLocation;
137 }
138
139
140
141
142
143
144 public String getDescription( )
145 {
146 return _strDescription;
147 }
148
149
150
151
152
153
154 public String getDateTimeStart( )
155 {
156 return _strDateTimeStart;
157 }
158
159
160
161
162
163
164 public String getDateTimeEnd( )
165 {
166 return _strDateTimeEnd;
167 }
168
169
170
171
172
173
174 public String getCategories( )
175 {
176 return _strCategories;
177 }
178
179
180
181
182
183
184 public String getStatus( )
185 {
186 return _strStatus;
187 }
188
189
190
191
192
193
194 public int getPriority( )
195 {
196 return _nPriority;
197 }
198
199
200
201
202
203
204 public String getUrl( )
205 {
206 return _strUrl;
207 }
208
209
210
211
212 public int getPeriodicity( )
213 {
214 return _nPeriodicity;
215 }
216
217
218
219
220 public int getOccurrence( )
221 {
222 return _nOccurrence;
223 }
224
225
226
227
228
229
230 public Date getDateEnd( )
231 {
232 return _dateEnd;
233 }
234
235
236
237
238
239
240 public String getLocationTown( )
241 {
242 return _strLocationTown;
243 }
244
245
246
247
248
249
250 public String getLocationAddress( )
251 {
252 return _strLocationAddress;
253 }
254
255
256
257
258
259
260 public String getMapUrl( )
261 {
262 return _strMapUrl;
263 }
264
265
266
267
268
269
270 public String getLinkUrl( )
271 {
272 return _strLinkUrl;
273 }
274
275
276
277
278
279
280 public int getDocumentId( )
281 {
282 return _nDocumentId;
283 }
284
285
286
287
288
289
290 public String getPageUrl( )
291 {
292 return _strPageUrl;
293 }
294
295
296
297
298
299
300 public int getTopEvent( )
301 {
302 return _nTopEvent;
303 }
304
305
306
307
308
309
310
311 public void setPeriodicity( int nPeriodicity )
312 {
313 _nPeriodicity = nPeriodicity;
314 }
315
316
317
318
319
320 public void setOccurrence( int nOccurrence )
321 {
322 _nOccurrence = nOccurrence;
323 }
324
325
326
327
328
329
330 void setDateTimeStart( String strDateTimeStart )
331 {
332 if ( strDateTimeStart.length( ) == DATE_ONLY_LENGTH )
333 {
334 _dateEvent = Utils.getDate( strDateTimeStart );
335 }
336 else if ( strDateTimeStart.length( ) == DATE_TIME_LENGTH )
337 {
338 _dateEvent = Utils.getDate( strDateTimeStart );
339 _strStartHour = strDateTimeStart.substring( 9, 11 );
340 _strStartMinute = strDateTimeStart.substring( 11, 13 );
341 _strDateTimeStart = _strStartHour + ":" + _strStartMinute;
342 }
343 }
344
345
346
347
348
349
350 void setDateTimeEnd( String strDateTimeEnd )
351 {
352 if ( strDateTimeEnd.length( ) == DATE_TIME_LENGTH )
353 {
354 _dateEvent = Utils.getDate( strDateTimeEnd );
355 _strEndHour = strDateTimeEnd.substring( 9, 11 );
356 _strEndMinute = strDateTimeEnd.substring( 11, 13 );
357 _strDateTimeEnd = _strEndHour + ":" + _strEndMinute;
358 }
359 }
360
361
362
363
364
365
366 void setTitle( String strTitle )
367 {
368 _strTitle = strTitle;
369 }
370
371
372
373
374
375
376 void setLocation( String strLocation )
377 {
378 _strLocation = strLocation;
379 }
380
381
382
383
384
385
386 public void setEventClass( String strEventClass )
387 {
388 _strEventClass = strEventClass;
389 }
390
391
392
393
394
395
396 void setDescription( String strDescription )
397 {
398 _strDescription = strDescription;
399 }
400
401
402
403
404
405
406 void setCategories( String strCategories )
407 {
408 _strCategories = strCategories;
409 }
410
411
412
413
414
415
416 public void setStatus( String strStatus )
417 {
418 _strStatus = strStatus;
419 }
420
421
422
423
424
425
426 public void setPriority( int nPriority )
427 {
428 _nPriority = nPriority;
429 }
430
431
432
433
434
435
436 public void setUrl( String strUrl )
437 {
438 _strUrl = strUrl;
439 }
440
441
442
443
444
445 public void setDateEnd( Date dateEnd )
446 {
447 _dateEnd = dateEnd;
448 }
449
450
451
452
453
454
455 public void setLocationTown( String strLocationTown )
456 {
457 _strLocationTown = strLocationTown;
458 }
459
460
461
462
463
464
465 public String getLocationZip( )
466 {
467 return _strLocationZip;
468 }
469
470
471
472
473
474
475 public void setLocationZip( String strLocationZip )
476 {
477 _strLocationZip = strLocationZip;
478 }
479
480
481
482
483
484
485 public void setLocationAddress( String strLocationAddress )
486 {
487 _strLocationAddress = strLocationAddress;
488 }
489
490
491
492
493
494
495 public void setMapUrl( String strMapUrl )
496 {
497 _strMapUrl = strMapUrl;
498 }
499
500
501
502
503
504
505 public void setLinkUrl( String strLinkUrl )
506 {
507 _strLinkUrl = strLinkUrl;
508 }
509
510
511
512
513
514
515 public void setDocumentId( int nDocumentId )
516 {
517 _nDocumentId = nDocumentId;
518 }
519
520
521
522
523
524
525 public void setPageUrl( String strPageUrl )
526 {
527 _strPageUrl = strPageUrl;
528 }
529
530
531
532
533
534
535 public void setTopEvent( int strTopEvent )
536 {
537 _nTopEvent = strTopEvent;
538 }
539
540
541
542
543
544
545 public void setId( int nId )
546 {
547 _nId = nId;
548 }
549
550
551
552
553
554
555 public String getType( )
556 {
557 return _searchType;
558 }
559
560
561
562
563
564
565 public void setType( String type )
566 {
567 _searchType = type;
568 }
569
570
571
572
573
574
575 public ImageResource getImageResource( )
576 {
577 return _imageRessource;
578 }
579
580
581
582
583
584
585 public void setImageResource( ImageResource imageResource )
586 {
587 _imageRessource = imageResource;
588 }
589
590
591
592
593
594
595 public Date getDateCreation( )
596 {
597 return _dateCreation;
598 }
599
600
601
602
603
604
605 public void setDateCreation( Date dateCreation )
606 {
607 _dateCreation = dateCreation;
608 }
609
610
611
612
613 public int getIdCalendar( )
614 {
615 return 0;
616 }
617 }