fr.paris.lutece.plugins.calendar.business
Class CalendarDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.calendar.business.CalendarDAO
All Implemented Interfaces:
ICalendarDAO

public class CalendarDAO
extends java.lang.Object
implements ICalendarDAO

This DAO class used to fetch the calendars in the database


Constructor Summary
CalendarDAO()
           
 
Method Summary
 void deleteAgenda(int nAgendaId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete an agenda from the table calendar_agendas
 void deleteAllOccurrence(int nAgendaId, int nEventId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete an Event from the table calendar_events_occurrences
 void deleteEvent(int nAgendaId, int nEventId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete an Event from the table calendar_events
 void deleteEventUser(int nEventId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete the link between event and user
 void deleteFeature(fr.paris.lutece.portal.service.plugin.Plugin plugin, int nEventId)
           
 void deleteLinkCategories(fr.paris.lutece.portal.service.plugin.Plugin plugin, int nEventId)
           
 void deleteOccurrence(int nOccurrenceId, int nEventId, int nAgendaId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete an occurrence from the table calendar_events_occurrences
 void getFeature(fr.paris.lutece.portal.service.plugin.Plugin plugin, int nIdEvent, SimpleEvent event)
           
 SimpleEvent getNextOccurrence(SimpleEvent occurrence, java.lang.String strDateRef, int nCptDate)
          Return the next occurrence of an event regarding the frequency choisen
 int getOccurrenceNumber(int nEventId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Return the occurrence number for an event
 int getRepetitionDays(int nEventId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Return the frequency of an event
 boolean hasOccurenceEvent(java.util.Calendar calendar, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Return 1 if the day contains an event 0 otherwise
 void insertAgenda(AgendaResource agenda, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new agenda in the table calendar_agendas.
 void insertEvent(SimpleEvent event, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.lang.String strUserLogin)
          Insert a new event in the table calendar_events.
 void insertFeature(fr.paris.lutece.portal.service.plugin.Plugin plugin, SimpleEvent event)
           
 void insertOccurrence(SimpleEvent event, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new set of occurrence in the table calendar_events_occurrences.
 AgendaResource loadAgenda(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of AgendaResource from the table
 SimpleEvent loadEvent(int nEventId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of SimpleEvent from the table
 fr.paris.lutece.portal.service.image.ImageResource loadImageResource(int nCategoryId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Return the image resource corresponding to the event id
 OccurrenceEvent loadOccurrence(int nOccurenceId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of SimpleEvent from the table
 java.util.List<AgendaResource> selectAgendaResourceList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of AgendaResources
 java.util.List<Event> selectByFilter(CalendarFilter filter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of Events
 java.util.List<java.lang.Integer> selectCalendarIds(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of calendar IDs
 java.util.List<SimpleEvent> selectEventsList(int nAgendaId, int nSortEvents, int nNextDays, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of events
 java.util.List<SimpleEvent> selectEventsList(int nAgendaId, int nSortEvents, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of Events
 java.util.List<SimpleEvent> selectEventsListByUserLogin(int nAgendaId, int nSortEvents, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.lang.String strUserLogin)
          Load the list of Events
 java.sql.Date selectOccurrenceDateMin(int nIdEvent, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          SELECT the minimum date from a set of occurrences from table calendar_events_occurrences
 java.util.List<OccurrenceEvent> selectOccurrencesByIdList(int nAgendaId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of all Occurrences of a given calendar
 java.util.List<OccurrenceEvent> selectOccurrencesList(int nAgendaId, int nEventId, int nSortEvents, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of Occurrences related with a given calendar and event
 java.util.List<OccurrenceEvent> selectOccurrencesList(int nAgendaId, int nSortEvents, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of all Occurrences
 java.util.List<SimpleEvent> selectTopEventsList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of Events
 void storeAgenda(AgendaResource agenda, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the agenda in the table calendar_agendas
 void storeEvent(SimpleEvent event, fr.paris.lutece.portal.service.plugin.Plugin plugin, boolean bPeriodiciteUpdated)
          Update the event in the table calendar_event
 void storeOccurrence(OccurrenceEvent occurrence, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the occurrence in the table calendar_events_occurrences
 void updateDateEvent(int nEventId, int nAgendaId, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.sql.Date newDateEvent)
          UPDATE the event date from the table calendar_events
 void updateFeature(fr.paris.lutece.portal.service.plugin.Plugin plugin, SimpleEvent event)
           
 void updateNumberOccurrence(int nEventId, int nAgendaId, fr.paris.lutece.portal.service.plugin.Plugin plugin, int nNewNumberOccurrence)
          UPDATE the occurrence number from the table calendar_events
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalendarDAO

public CalendarDAO()
Method Detail

insertAgenda

public void insertAgenda(AgendaResource agenda,
                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new agenda in the table calendar_agendas.

Specified by:
insertAgenda in interface ICalendarDAO
Parameters:
agenda - The AgendaResource object
plugin - The Plugin using this data access service

storeAgenda

public void storeAgenda(AgendaResource agenda,
                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the agenda in the table calendar_agendas

Specified by:
storeAgenda in interface ICalendarDAO
Parameters:
agenda - The reference of AgendaResource
plugin - The Plugin using this data access service

deleteAgenda

public void deleteAgenda(int nAgendaId,
                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete an agenda from the table calendar_agendas

Specified by:
deleteAgenda in interface ICalendarDAO
Parameters:
nAgendaId - The Agenda Id
plugin - The Plugin using this data access service

insertEvent

public void insertEvent(SimpleEvent event,
                        fr.paris.lutece.portal.service.plugin.Plugin plugin,
                        java.lang.String strUserLogin)
Insert a new event in the table calendar_events.

Specified by:
insertEvent in interface ICalendarDAO
Parameters:
event - The event to be inserted
plugin - The Plugin using this data access service
strUserLogin - user login

storeEvent

public void storeEvent(SimpleEvent event,
                       fr.paris.lutece.portal.service.plugin.Plugin plugin,
                       boolean bPeriodiciteUpdated)
Update the event in the table calendar_event

Specified by:
storeEvent in interface ICalendarDAO
Parameters:
event - The reference of SimpleEvent
nAgendaId - The identifier of the agenda
plugin - The Plugin using this data access service

deleteEvent

public void deleteEvent(int nAgendaId,
                        int nEventId,
                        fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete an Event from the table calendar_events

Specified by:
deleteEvent in interface ICalendarDAO
Parameters:
nEventId - The id of the event
nAgendaId - The agenda Id
plugin - The Plugin using this data access service

loadAgenda

public AgendaResource loadAgenda(int nId,
                                 fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of AgendaResource from the table

Specified by:
loadAgenda in interface ICalendarDAO
Parameters:
nId - The identifier of AgendaResource
plugin - The plugin
Returns:
the instance of the AgendaResource

selectAgendaResourceList

public java.util.List<AgendaResource> selectAgendaResourceList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of AgendaResources

Specified by:
selectAgendaResourceList in interface ICalendarDAO
Parameters:
plugin - The plugin
Returns:
The Collection of the AgendaResources

loadEvent

public SimpleEvent loadEvent(int nEventId,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of SimpleEvent from the table

Specified by:
loadEvent in interface ICalendarDAO
Parameters:
nEventId - The id of the event
plugin - The plugin
Returns:
the instance of the SimpleEvent

selectEventsList

public java.util.List<SimpleEvent> selectEventsList(int nAgendaId,
                                                    int nSortEvents,
                                                    fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of Events

Specified by:
selectEventsList in interface ICalendarDAO
Parameters:
nSortEvents - An integer used for sorting
plugin - The plugin
nAgendaId - The identifier of the agenda
Returns:
The Collection of the Events

insertOccurrence

public void insertOccurrence(SimpleEvent event,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new set of occurrence in the table calendar_events_occurrences.

Parameters:
event - The event to be inserted
plugin - The Plugin using this data access service
arrayExcludedDays - list of excluded days

storeOccurrence

public void storeOccurrence(OccurrenceEvent occurrence,
                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update the occurrence in the table calendar_events_occurrences

Specified by:
storeOccurrence in interface ICalendarDAO
Parameters:
occurrence - The reference of OccurrenceEvent
plugin - The Plugin using this data access service

selectOccurrencesList

public java.util.List<OccurrenceEvent> selectOccurrencesList(int nAgendaId,
                                                             int nEventId,
                                                             int nSortEvents,
                                                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of Occurrences related with a given calendar and event

Specified by:
selectOccurrencesList in interface ICalendarDAO
Parameters:
nSortEvents - An integer used for sorting issues
plugin - The plugin
nAgendaId - The identifier of the agenda
nEventId - The identifier of an event
Returns:
The Collection of the Occurrences

selectOccurrencesList

public java.util.List<OccurrenceEvent> selectOccurrencesList(int nAgendaId,
                                                             int nSortEvents,
                                                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of all Occurrences

Specified by:
selectOccurrencesList in interface ICalendarDAO
Parameters:
nSortEvents - An integer used for sorting issues
plugin - The plugin
nAgendaId - The identifier of the agenda
Returns:
The Collection of the Occurrences

selectOccurrencesByIdList

public java.util.List<OccurrenceEvent> selectOccurrencesByIdList(int nAgendaId,
                                                                 fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of all Occurrences of a given calendar

Specified by:
selectOccurrencesByIdList in interface ICalendarDAO
Parameters:
nSortEvents - An integer used for sorting issues
plugin - The plugin
nAgendaId - The identifier of the agenda
Returns:
The Collection of the Occurrences

loadOccurrence

public OccurrenceEvent loadOccurrence(int nOccurenceId,
                                      fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of SimpleEvent from the table

Specified by:
loadOccurrence in interface ICalendarDAO
Parameters:
nEventId - The id of the event
plugin - The plugin
Returns:
the instance of the OccurrenceEvent

deleteAllOccurrence

public void deleteAllOccurrence(int nAgendaId,
                                int nEventId,
                                fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete an Event from the table calendar_events_occurrences

Specified by:
deleteAllOccurrence in interface ICalendarDAO
Parameters:
nEventId - The id of the occurrence
nAgendaId - The agenda Id
plugin - The Plugin using this data access service

deleteOccurrence

public void deleteOccurrence(int nOccurrenceId,
                             int nEventId,
                             int nAgendaId,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete an occurrence from the table calendar_events_occurrences

Specified by:
deleteOccurrence in interface ICalendarDAO
Parameters:
nOccurrenceId - The id of the occurrence
nAgendaId - The agenda Id
plugin - The Plugin using this data access service
nEventId - The id of the occurrence

updateDateEvent

public void updateDateEvent(int nEventId,
                            int nAgendaId,
                            fr.paris.lutece.portal.service.plugin.Plugin plugin,
                            java.sql.Date newDateEvent)
UPDATE the event date from the table calendar_events

Parameters:
nEventId - The id of the occurrence
nAgendaId - The agenda Id
plugin - The Plugin using this data access service
newDateEvent - the new java.sql.Date object

selectOccurrenceDateMin

public java.sql.Date selectOccurrenceDateMin(int nIdEvent,
                                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
SELECT the minimum date from a set of occurrences from table calendar_events_occurrences

Parameters:
nEventId - The id of the occurrence
plugin - The Plugin using this data access service

updateNumberOccurrence

public void updateNumberOccurrence(int nEventId,
                                   int nAgendaId,
                                   fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                   int nNewNumberOccurrence)
UPDATE the occurrence number from the table calendar_events

Specified by:
updateNumberOccurrence in interface ICalendarDAO
Parameters:
nEventId - The id of the occurrence
nAgendaId - The agenda Id
plugin - The Plugin using this data access service
nNewNumberOccurrence - the new number of occurrence for the event

getRepetitionDays

public int getRepetitionDays(int nEventId,
                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Return the frequency of an event

Specified by:
getRepetitionDays in interface ICalendarDAO
Parameters:
nEventId - The id of the event
plugin - Plugin
Returns:
the event frequency

getOccurrenceNumber

public int getOccurrenceNumber(int nEventId,
                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
Return the occurrence number for an event

Specified by:
getOccurrenceNumber in interface ICalendarDAO
Parameters:
nEventId - The id of the event
plugin - Plugin
Returns:
the occurrence number

getNextOccurrence

public SimpleEvent getNextOccurrence(SimpleEvent occurrence,
                                     java.lang.String strDateRef,
                                     int nCptDate)
Return the next occurrence of an event regarding the frequency choisen

Parameters:
occurrence - an Event instance to be updated
strDateRef - The reference date
nCptDate - The number to add
Returns:
SimpleEvent object with the date updated

insertFeature

public void insertFeature(fr.paris.lutece.portal.service.plugin.Plugin plugin,
                          SimpleEvent event)

updateFeature

public void updateFeature(fr.paris.lutece.portal.service.plugin.Plugin plugin,
                          SimpleEvent event)

deleteFeature

public void deleteFeature(fr.paris.lutece.portal.service.plugin.Plugin plugin,
                          int nEventId)

getFeature

public void getFeature(fr.paris.lutece.portal.service.plugin.Plugin plugin,
                       int nIdEvent,
                       SimpleEvent event)

deleteLinkCategories

public void deleteLinkCategories(fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                 int nEventId)

loadImageResource

public fr.paris.lutece.portal.service.image.ImageResource loadImageResource(int nCategoryId,
                                                                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
Return the image resource corresponding to the event id

Specified by:
loadImageResource in interface ICalendarDAO
Parameters:
nEventId - The identifier of event object
plugin - Plugin
Returns:
The image resource

selectByFilter

public java.util.List<Event> selectByFilter(CalendarFilter filter,
                                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of Events

Specified by:
selectByFilter in interface ICalendarDAO
Parameters:
plugin - The plugin
filter - The CalendarFilter Object
Returns:
The Collection of the Events

selectTopEventsList

public java.util.List<SimpleEvent> selectTopEventsList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of Events

Specified by:
selectTopEventsList in interface ICalendarDAO
Parameters:
nSortEvents - An integer used for sorting
plugin - The plugin
nAgendaId - The identifier of the agenda
Returns:
The Collection of the Events

hasOccurenceEvent

public boolean hasOccurenceEvent(java.util.Calendar calendar,
                                 fr.paris.lutece.portal.service.plugin.Plugin plugin)
Return 1 if the day contains an event 0 otherwise

Specified by:
hasOccurenceEvent in interface ICalendarDAO
Parameters:
calendar - The day
plugin - The plugin
Returns:
1 if the day contains an event 0 otherwise

selectEventsListByUserLogin

public java.util.List<SimpleEvent> selectEventsListByUserLogin(int nAgendaId,
                                                               int nSortEvents,
                                                               fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                                               java.lang.String strUserLogin)
Load the list of Events

Specified by:
selectEventsListByUserLogin in interface ICalendarDAO
Parameters:
nSortEvents - An integer used for sorting issues
plugin - The plugin
nAgendaId - The identifier of the agenda
strUserLogin -
Returns:
The Collection of the Events

deleteEventUser

public void deleteEventUser(int nEventId,
                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete the link between event and user

Specified by:
deleteEventUser in interface ICalendarDAO
Parameters:
nEventId - ID event
plugin - plugin

selectEventsList

public java.util.List<SimpleEvent> selectEventsList(int nAgendaId,
                                                    int nSortEvents,
                                                    int nNextDays,
                                                    fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of events

Specified by:
selectEventsList in interface ICalendarDAO
Parameters:
nAgendaId - the agenda ID
nSortEvents - An integer used for sorting issues
nNextDays - the number of days
plugin - plugin
Returns:
the list of events

selectCalendarIds

public java.util.List<java.lang.Integer> selectCalendarIds(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of calendar IDs

Specified by:
selectCalendarIds in interface ICalendarDAO
Parameters:
plugin - Plugin
Returns:
the list of calendar ids


Copyright © 2012 Mairie de Paris. All Rights Reserved.