View Javadoc
1   /*
2    * Copyright (c) 2002-2018, 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.appointment.business.appointment;
35  
36  import java.util.HashMap;
37  import java.util.List;
38  
39  import fr.paris.lutece.plugins.appointment.web.dto.AppointmentFilterDTO;
40  import fr.paris.lutece.portal.service.plugin.Plugin;
41  
42  /**
43   * Appointment DAO Interface
44   * 
45   * @author Laurent Payen
46   *
47   */
48  public interface IAppointmentDAO
49  {
50  
51      /**
52       * The name of the bean of the DAO
53       */
54      static String BEAN_NAME = "appointment.appointmentDAO";
55  
56      /**
57       * Insert a new record in the table
58       * 
59       * @param appointment
60       *            instance of the appointment object to insert
61       * @param plugin
62       *            the plugin
63       */
64      void insert( Appointment appointment, Plugin plugin );
65  
66      /**
67       * Update the record in the table
68       * 
69       * @param appointment
70       *            the reference of the appointment
71       * @param plugin
72       *            the plugin
73       */
74      void update( Appointment appointment, Plugin plugin );
75  
76      /**
77       * Delete a record from the table
78       * 
79       * @param nIdAppointment
80       *            int identifier of the appointment to delete
81       * @param plugin
82       *            the plugin
83       */
84      void delete( int nIdAppointment, Plugin plugin );
85  
86      /**
87       * Load the data from the table
88       * 
89       * @param nIdAppointment
90       *            the identifier of the appointment
91       * @param plugin
92       *            the plugin
93       * @return the instance of the appointment
94       */
95      Appointment select( int nIdAppointment, Plugin plugin );
96  
97      /**
98       * Returns all the appointments of a user
99       * 
100      * @param nIdUser
101      *            the User Id
102      * @param plugin
103      *            the Plugin
104      * @return a list of the appointments of the user
105      */
106     List<Appointment> findByIdUser( int nIdUser, Plugin plugin );
107 
108     /**
109      * Returns the appointments of a slot
110      * 
111      * @param nIdSlot
112      *            the Slot Id
113      * @param plugin
114      *            the plugin
115      * @return a list of the appointments
116      */
117     List<Appointment> findByIdSlot( int nIdSlot, Plugin plugin );
118 
119     /**
120      * Returns the appointment with its reference
121      * 
122      * @param strReference
123      *            the appointment reference
124      * @param plugin
125      *            the plugin
126      * @return the appointment
127      */
128     Appointment findByReference( String strReference, Plugin plugin );
129 
130     /**
131      * Returns a list of all the appointment of a form
132      * 
133      * @param nIdForm
134      *            the form id
135      * @param plugin
136      *            the plugin
137      * @return a list of the appointments
138      */
139     List<Appointment> findByIdForm( int nIdForm, Plugin plugin );
140 
141     /**
142      * Returns a list of appointments matching the filter
143      * 
144      * @param appointmentFilter
145      *            the filter
146      * @param plugin
147      *            the plugin
148      * @return a list of appointments
149      */
150     List<Appointment> findByFilter( AppointmentFilterDTO appointmentFilter, Plugin plugin );
151 
152     /**
153      * Returns user's form data by idFormUser and securityKey
154      *
155      * @param idKiosque
156      *              Kiosque id
157      * @param idFormUser
158      *              User's form id
159      * @param idEntryEmail
160      *              Email id entry
161      * @param plugin
162      *              Plugin
163      * @return HashMap<String,String>
164      */
165     HashMap<String,String> getAppointmentFillParameters( Integer idKiosque, String idFormUser, Integer idEntryEmail, Plugin plugin );
166 
167     /**
168      /**
169      * Check if the user security key is ok
170      *
171      * @param idForm
172      *              Form id
173      * @param idFormUser
174      *              User form id
175      * @param securityKey
176      *              Security key
177      * @param idEntryKiosque
178      *              Entry kiosque id
179      * @param idEntryCleSecurite
180      *              Entry security key id
181      * @param plugin
182      * @return
183      */
184     boolean checkSecurityKey( String idForm, String idFormUser, String securityKey,  int idEntryKiosque, int idEntryCleSecurite, Plugin plugin );
185 
186     /**
187      * Check if the user can create a new appointment for his project
188      *
189      * @param idForm
190      *              Form id
191      * @param idFormUser
192      *              User form id
193      * @param idEntryDates
194      *               Dates entry id
195      * @param idEntryNumero
196      *               Numero key entry id
197      * @param plugin
198      *              Plugin
199      * @return boolean
200      */
201     boolean checkNbCreneauxRestants( String idForm, String idFormUser, Integer idEntryDates, Integer idEntryNumero, Plugin plugin );
202 
203     /**
204      * Check if animations have been selected by the user
205      *
206      * @param idFormUser
207      *              id form user
208      * @param animations
209      *              the animations to check
210      * @param plugin
211      *              the plugin
212      * @return boolean
213      */
214     boolean checkSelectedAnimation( String idFormUser, String[] animations, Plugin plugin );
215 
216 }