View Javadoc
1   /*
2    * Copyright (c) 2002-2014, Mairie de Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.plugins.calendar.business;
35  
36  import fr.paris.lutece.plugins.calendar.business.category.Category;
37  import fr.paris.lutece.portal.service.image.ImageResource;
38  
39  import java.sql.Timestamp;
40  import java.util.Collection;
41  import java.util.Date;
42  
43  
44  /**
45   * SimpleEvent
46   */
47  public class SimpleEvent implements Event
48  {
49      private static final long serialVersionUID = -1675274063314004181L;
50  
51      // Variables declarations
52      private int _nId;
53      private Date _dateEvent;
54      private Date _dateEnd;
55      private String _strTitle;
56      private String _strLocation;
57      private String _strEventClass;
58      private String _strDescription;
59      private String _strDateTimeStart;
60      private String _strDateTimeEnd;
61      private String _strStatus;
62  
63      /* since version 3.0.0. */
64      private int _nIdCalendar;
65      private int _nPriority;
66      private int _nPeriodicity;
67      private int _nOccurrence;
68      private String _strUrl;
69      private String _strLocationTown;
70      private String _strLocationZip;
71      private String _strLocationAddress;
72      private String _strMapUrl;
73      private String _strLinkUrl;
74      private int _nDocumentId;
75      private String _strPageUrl;
76      private ImageResource _imageRessource;
77      private String[] _listTags;
78      private String _strListTags;
79      private int _nTopEvent;
80      private String _strImageUrl;
81      private String _searchType;
82      private Timestamp _dateCreation;
83      private Collection<Category> _listCategories;
84      private String[] _listExcludedDays;
85  
86      /**
87       * Returns the id of the event
88       * 
89       * @return The id
90       */
91      public int getId( )
92      {
93          return _nId;
94      }
95  
96      /**
97       * Sets the Date
98       * 
99       * @param nId The id of the event
100      */
101     public void setId( int nId )
102     {
103         _nId = nId;
104     }
105 
106     /**
107      * Returns the Date
108      * 
109      * @return A Date object representing the event's date
110      */
111     public Date getDate( )
112     {
113         return _dateEvent;
114     }
115 
116     /**
117      * Sets the Date
118      * 
119      * @param dateEvent The Date
120      */
121     public void setDate( Date dateEvent )
122     {
123         _dateEvent = dateEvent;
124     }
125 
126     /**
127      * Returns the Title
128      * 
129      * @return The Title
130      */
131     public String getTitle( )
132     {
133         return _strTitle;
134     }
135 
136     /**
137      * Sets the Title
138      * 
139      * @param strTitle The Title
140      */
141     public void setTitle( String strTitle )
142     {
143         _strTitle = strTitle;
144     }
145 
146     /**
147      * Returns the Location
148      * 
149      * @return The Location
150      */
151     public String getLocation( )
152     {
153         return _strLocation;
154     }
155 
156     /**
157      * Sets the Location
158      * 
159      * @param strLocation The Location
160      */
161     public void setLocation( String strLocation )
162     {
163         _strLocation = strLocation;
164     }
165 
166     /**
167      * Returns the EventClass
168      * 
169      * @return The EventClass
170      */
171     public String getEventClass( )
172     {
173         return _strEventClass;
174     }
175 
176     /**
177      * Sets the EventClass
178      * 
179      * @param strEventClass The EventClass
180      */
181     public void setEventClass( String strEventClass )
182     {
183         _strEventClass = strEventClass;
184     }
185 
186     /**
187      * Returns the Description
188      * 
189      * @return The Description
190      */
191     public String getDescription( )
192     {
193         return _strDescription;
194     }
195 
196     /**
197      * Sets the Description
198      * 
199      * @param strDescription The Description
200      */
201     public void setDescription( String strDescription )
202     {
203         _strDescription = strDescription;
204     }
205 
206     /**
207      * Returns the DateTimeStart
208      * 
209      * @return The DateTimeStart
210      */
211     public String getDateTimeStart( )
212     {
213         return _strDateTimeStart;
214     }
215 
216     /**
217      * Sets the DateTimeStart
218      * 
219      * @param strDateTimeStart The DateTimeStart
220      */
221     public void setDateTimeStart( String strDateTimeStart )
222     {
223         _strDateTimeStart = strDateTimeStart;
224     }
225 
226     /**
227      * Returns the DateTimeEnd
228      * 
229      * @return The DateTimeEnd
230      */
231     public String getDateTimeEnd( )
232     {
233         return _strDateTimeEnd;
234     }
235 
236     /**
237      * Sets the DateTimeEnd
238      * 
239      * @param strDateTimeEnd The DateTimeEnd
240      */
241     public void setDateTimeEnd( String strDateTimeEnd )
242     {
243         _strDateTimeEnd = strDateTimeEnd;
244     }
245 
246     /**
247      * Returns the Status
248      * 
249      * @return The Status
250      */
251     public String getStatus( )
252     {
253         return _strStatus;
254     }
255 
256     /**
257      * Sets the Status
258      * 
259      * @param strStatus The Status
260      */
261     public void setStatus( String strStatus )
262     {
263         _strStatus = strStatus;
264     }
265 
266     /**
267      * Returns the Priority
268      * 
269      * @return The Priority
270      */
271     public int getPriority( )
272     {
273         return _nPriority;
274     }
275 
276     /**
277      * Sets the Priority
278      * 
279      * @param nPriority The Priority
280      */
281     public void setPriority( int nPriority )
282     {
283         _nPriority = nPriority;
284     }
285 
286     /**
287      * Returns the Url
288      * 
289      * @return The Url
290      */
291     public String getUrl( )
292     {
293         return _strUrl;
294     }
295 
296     /**
297      * Sets the Url
298      * 
299      * @param strUrl The Url
300      */
301     public void setUrl( String strUrl )
302     {
303         _strUrl = strUrl;
304     }
305 
306     /**
307      * Returns the periodicity
308      * 
309      * @return The periodicity
310      */
311     public int getPeriodicity( )
312     {
313         return _nPeriodicity;
314     }
315 
316     /**
317      * Sets the periodicity
318      * 
319      * @param nPeriodicity The periodicity
320      */
321     public void setPeriodicity( int nPeriodicity )
322     {
323         _nPeriodicity = nPeriodicity;
324     }
325 
326     /**
327      * Returns the occurrence
328      * 
329      * @return The occurrence
330      */
331     public int getOccurrence( )
332     {
333         return _nOccurrence;
334     }
335 
336     /**
337      * Sets the occurrence
338      * 
339      * @param nOccurrence The occurrence
340      */
341     public void setOccurrence( int nOccurrence )
342     {
343         _nOccurrence = nOccurrence;
344     }
345 
346     /**
347      * Returns the date end
348      * 
349      * @return The date end
350      */
351     public Date getDateEnd( )
352     {
353         return _dateEnd;
354     }
355 
356     /**
357      * Sets the Date End
358      * 
359      * @param DateEnd The Date End
360      */
361     public void setDateEnd( Date DateEnd )
362     {
363         _dateEnd = DateEnd;
364     }
365 
366     /**
367      * Returns the location Town
368      * 
369      * @return The location Town
370      */
371     public String getLocationTown( )
372     {
373         return _strLocationTown;
374     }
375 
376     /**
377      * Sets the location Town
378      * 
379      * @param strLocationTown The location Town
380      */
381     public void setLocationTown( String strLocationTown )
382     {
383         _strLocationTown = strLocationTown;
384     }
385 
386     /**
387      * Returns the location Zip
388      * 
389      * @return The location Zip
390      */
391     public String getLocationZip( )
392     {
393         return _strLocationZip;
394     }
395 
396     /**
397      * Sets the location Zip
398      * 
399      * @param strLocationZip The location Zip
400      */
401     public void setLocationZip( String strLocationZip )
402     {
403         _strLocationZip = strLocationZip;
404     }
405 
406     /**
407      * Returns the location Address
408      * 
409      * @return The location Address
410      */
411     public String getLocationAddress( )
412     {
413         return _strLocationAddress;
414     }
415 
416     /**
417      * Sets the location Address
418      * 
419      * @param strLocationAddress The location Address
420      */
421     public void setLocationAddress( String strLocationAddress )
422     {
423         _strLocationAddress = strLocationAddress;
424     }
425 
426     /**
427      * Returns the date end
428      * 
429      * @return The date end
430      */
431     public String getMapUrl( )
432     {
433         return _strMapUrl;
434     }
435 
436     /**
437      * Sets the Map Url
438      * 
439      * @param strMapUrl The Map Url
440      */
441     public void setMapUrl( String strMapUrl )
442     {
443         _strMapUrl = strMapUrl;
444     }
445 
446     /**
447      * Returns the link Url
448      * 
449      * @return The link Url
450      */
451     public String getLinkUrl( )
452     {
453         return _strLinkUrl;
454     }
455 
456     /**
457      * Sets the link Url
458      * 
459      * @param strLinkUrl The link Url
460      */
461     public void setLinkUrl( String strLinkUrl )
462     {
463         _strLinkUrl = strLinkUrl;
464     }
465 
466     /**
467      * Returns the document id
468      * 
469      * @return The document id
470      */
471     public int getDocumentId( )
472     {
473         return _nDocumentId;
474     }
475 
476     /**
477      * Sets the document id
478      * 
479      * @param nDocumentId The document id
480      */
481     public void setDocumentId( int nDocumentId )
482     {
483         _nDocumentId = nDocumentId;
484     }
485 
486     /**
487      * Returns the page Url
488      * 
489      * @return The page Url
490      */
491     public String getPageUrl( )
492     {
493         return _strPageUrl;
494     }
495 
496     /**
497      * Sets the page Url
498      * 
499      * @param strPageUrl The page Url
500      */
501     public void setPageUrl( String strPageUrl )
502     {
503         _strPageUrl = strPageUrl;
504     }
505 
506     /**
507      * Returns the top Event
508      * 
509      * @return The top Event
510      */
511     public int getTopEvent( )
512     {
513         return _nTopEvent;
514     }
515 
516     /**
517      * Sets the top Event
518      * 
519      * @param strTopEvent The top Event
520      */
521     public void setTopEvent( int strTopEvent )
522     {
523         _nTopEvent = strTopEvent;
524     }
525 
526     /**
527      * Returns the top Event
528      * 
529      * @return The top Event
530      */
531     public String[] getTags( )
532     {
533         return _listTags;
534     }
535 
536     /**
537      * Sets the tag list
538      * 
539      * @param listTags The tag list
540      */
541     public void setTags( String[] listTags )
542     {
543         _listTags = listTags;
544     }
545 
546     /**
547      * Returns the Tag list
548      * 
549      * @return The Tag list
550      */
551     public String getListTags( )
552     {
553         return _strListTags;
554     }
555 
556     /**
557      * Sets the tag list
558      * 
559      * @param strListTags The tag list
560      */
561     public void setListTags( String strListTags )
562     {
563         _strListTags = strListTags;
564     }
565 
566     /**
567      * Returns the type
568      * 
569      * @return The type
570      */
571     public String getType( )
572     {
573         return _searchType;
574     }
575 
576     /**
577      * Sets the type
578      * 
579      * @param type The type
580      */
581     public void setType( String type )
582     {
583         _searchType = type;
584     }
585 
586     /**
587      * Gets the calendar id
588      * 
589      * @return The calendar id
590      */
591     public int getIdCalendar( )
592     {
593         return _nIdCalendar;
594     }
595 
596     /**
597      * Sets the calendar id
598      * 
599      * @param idCalendar The calendar id
600      */
601     public void setIdCalendar( int idCalendar )
602     {
603         _nIdCalendar = idCalendar;
604     }
605 
606     /**
607      * Gets the event categories
608      * 
609      * @return the event categories
610      */
611     public Collection<Category> getListCategories( )
612     {
613         return _listCategories;
614     }
615 
616     /**
617      * Sets the event categories
618      * 
619      * @param categories the event categories
620      */
621     public void setListCategories( Collection<Category> categories )
622     {
623         _listCategories = categories;
624     }
625 
626     /**
627      * Returns the ImageResource
628      * 
629      * @return The ImageResource
630      */
631     public ImageResource getImageResource( )
632     {
633         return _imageRessource;
634     }
635 
636     /**
637      * Sets the ImageResource
638      * 
639      * @param imageResource the ImageResource
640      */
641     public void setImageResource( ImageResource imageResource )
642     {
643         _imageRessource = imageResource;
644     }
645 
646     /**
647      * Returns the image Url
648      * 
649      * @return The image Url
650      */
651     public String getImageUrl( )
652     {
653         return _strImageUrl;
654     }
655 
656     /**
657      * Sets the image Url
658      * 
659      * @param strImageUrl The image Url
660      */
661     public void setImageUrl( String strImageUrl )
662     {
663         _strImageUrl = strImageUrl;
664     }
665 
666     /**
667      * Returns the event date creation
668      * 
669      * @return The event date creation
670      */
671     public Timestamp getDateCreation( )
672     {
673         return _dateCreation;
674     }
675 
676     /**
677      * Sets the date event date creation
678      * 
679      * @param dateCreation The event date creation
680      */
681     public void setDateCreation( Timestamp dateCreation )
682     {
683         _dateCreation = dateCreation;
684     }
685 
686     /**
687      * Get the list of excluded days
688      * 
689      * @return the list of excluded days
690      */
691     public String[] getExcludedDays( )
692     {
693         return _listExcludedDays;
694     }
695 
696     /**
697      * Set the list of excluded days
698      * 
699      * @param listExcludedDays the list of excluded days
700      */
701     public void setExcludedDays( String[] listExcludedDays )
702     {
703         _listExcludedDays = listExcludedDays;
704     }
705 }