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

java.lang.Object
  extended by fr.paris.lutece.plugins.calendar.business.CalendarHome

public class CalendarHome
extends java.lang.Object

This class provides instances management methods (selectEventsList, findByPrimaryKey, findAgendasList ...) for Calendar objects ( AgendaResource, Events, ...)


Constructor Summary
CalendarHome()
           
 
Method Summary
static void createAgenda(AgendaResource agenda, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new agenda in the table calendar_agendas.
static void createEvent(SimpleEvent event, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.lang.String strUserLogin)
          Insert a new event in the table calendar_events.
static AgendaResource findAgendaResource(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns an instance of a AgendaResource whose identifier is specified in parameter
static java.util.List<AgendaResource> findAgendaResourcesList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of AgendaResources
static java.util.List<java.lang.Integer> findCalendarIds(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of calendar IDs
static SimpleEvent findEvent(int nEventId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of SimpleEvent from the table
static java.util.List<Event> findEventsByFilter(CalendarFilter filter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of Events
static java.util.List<SimpleEvent> findEventsList(int nAgendaId, int nSortEvents, int nNextDays, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of events
static java.util.List<SimpleEvent> findEventsList(int nAgendaId, int nSortEvents, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of Events
static java.util.List<SimpleEvent> findEventsListByUserLogin(int nAgendaId, int nSortEvents, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.lang.String strUserLogin)
          Load the list of Events
static OccurrenceEvent findOccurrence(int nOccurrenceId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the data of Occurrence from the table
static java.util.List<OccurrenceEvent> findOccurrencesByIdList(int nAgendaId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of Occurrences ordered by occurrences id
static java.util.List<OccurrenceEvent> findOccurrencesList(int nAgendaId, int nEventId, int nSortEvents, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of Occurrences linked with an event
static java.util.List<OccurrenceEvent> findOccurrencesList(int nAgendaId, int nSortEvents, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of Occurrences
static java.util.List<SimpleEvent> findTopEventList(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Load the list of top Events
static fr.paris.lutece.portal.service.image.ImageResource getImageResource(int nCategoryId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Return the image resource for the specified category id
static int getOccurrenceNumber(int nEventId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns the number of occurrence for an event
static int getRepetitionDays(int nEventId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns the number of days within which the events will occur
static boolean hasOccurrenceEvent(java.util.Calendar calendar, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Return 1 if the day contains an event 0 otherwise
static void removeAgenda(int nAgendaId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete an agenda from the table calendar_agendas
static void removeEvent(int nAgendaId, int nEventId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete an Event from the table calendar_events
static void removeOccurrence(int nOccurrenceId, int nEventId, int nAgendaId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete an Event from the table calendar_events
static void updateAgenda(AgendaResource agenda, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the agenda in the table calendar_agendas
static void updateEvent(SimpleEvent event, boolean bPeriodiciteUpdated, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the event in the table calendar_event
static void updateOccurrence(OccurrenceEvent occurrence, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update the occurrence in the table calendar_events_occurrences
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalendarHome

public CalendarHome()
Method Detail

createAgenda

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

Parameters:
agenda - The AgendaResource object
plugin - The Plugin using this data access service

updateAgenda

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

Parameters:
agenda - The reference of AgendaResource
plugin - The Plugin using this data access service

removeAgenda

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

Parameters:
nAgendaId - The agenda Id
plugin - The Plugin using this data access service

findAgendaResourcesList

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

Parameters:
plugin - The plugin
Returns:
The Collection of the AgendaResources

findAgendaResource

public static AgendaResource findAgendaResource(int nKey,
                                                fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns an instance of a AgendaResource whose identifier is specified in parameter

Parameters:
nKey - The Primary key of the contact
plugin - The Plugin object
Returns:
an instance of AgendaResource

createEvent

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

Parameters:
event - the event
plugin - The Plugin using this data access service
strUserLogin - user login
Throws:
fr.paris.lutece.portal.service.util.AppException - AppException

updateEvent

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

Parameters:
strTitle - The title of the event
event - The reference of SimpleEvent
strDate - the old event date
plugin - The Plugin using this data access service
Throws:
fr.paris.lutece.portal.service.util.AppException - Exception thrown if an error is detected

removeEvent

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

Parameters:
strDate - The date
strTitle - The title
nAgendaId - The agenda Id
plugin - The Plugin using this data access service

findEvent

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

Parameters:
nEventId - The event id
plugin - The plugin
Returns:
the instance of the SimpleEvent

findEventsList

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

Parameters:
nSortEvents - An integer used for sorting issues
plugin - The plugin
nAgendaId - The identifier of the agenda
Returns:
The Collection of the Events

findEventsListByUserLogin

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

Parameters:
nSortEvents - An integer used for sorting issues
plugin - The plugin
nAgendaId - The identifier of the agenda
strUserLogin - user login
Returns:
The Collection of the Events

findOccurrencesList

public static java.util.List<OccurrenceEvent> findOccurrencesList(int nAgendaId,
                                                                  int nEventId,
                                                                  int nSortEvents,
                                                                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of Occurrences linked with an event

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

findOccurrencesList

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

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

findOccurrencesByIdList

public static java.util.List<OccurrenceEvent> findOccurrencesByIdList(int nAgendaId,
                                                                      fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the list of Occurrences ordered by occurrences id

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

findOccurrence

public static OccurrenceEvent findOccurrence(int nOccurrenceId,
                                             fr.paris.lutece.portal.service.plugin.Plugin plugin)
Load the data of Occurrence from the table

Parameters:
nOccurrenceId - The occurrence id
plugin - The plugin
Returns:
the instance of the OccurrenceEvent

updateOccurrence

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

Parameters:
occurrence - The reference of OccurrenceEvent
plugin - The Plugin using this data access service

getRepetitionDays

public static int getRepetitionDays(int nEventId,
                                    fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns the number of days within which the events will occur

Parameters:
nEventId - The id of the event
plugin - Plugin
Returns:
Returns the number of days

getOccurrenceNumber

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

Parameters:
nEventId - The id of the event
Returns:
Returns the number of occurrence

removeOccurrence

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

Parameters:
nOccurrenceId - The occurrence id
plugin - The Plugin using this data access service

getImageResource

public static fr.paris.lutece.portal.service.image.ImageResource getImageResource(int nCategoryId,
                                                                                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Return the image resource for the specified category id

Parameters:
nCategoryId - The identifier of Category object
plugin - Plugin
Returns:
ImageResource

findEventsByFilter

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

Parameters:
plugin - The plugin
filter - The CalendarFilter Object
Returns:
The Collection of the Events

findTopEventList

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

Parameters:
plugin - The plugin

hasOccurrenceEvent

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

Parameters:
calendar - The day
plugin - The plugin
Returns:
1 if the day contains an event 0 otherwise

findEventsList

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

Parameters:
nAgendaId - the agenda ID
nSortEvents - An integer used for sorting issues
nNextDays - the number of days
plugin - plugin
Returns:
the list of events

findCalendarIds

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

Parameters:
plugin - Plugin
Returns:
the list of calendar ids


Copyright © 2012 Mairie de Paris. All Rights Reserved.