1 /*
2 * Copyright (c) 2002-2022, City of 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.display;
35
36 import java.io.Serializable;
37
38 import javax.validation.constraints.Min;
39
40 import fr.paris.lutece.portal.service.image.ImageResource;
41
42 /**
43 * Business class of the Form Display
44 *
45 * @author Laurent Payen
46 *
47 */
48 public final class Display implements Serializable
49 {
50
51 /**
52 * Serial version UID
53 */
54 private static final long serialVersionUID = -4827729906365306894L;
55
56 /**
57 * Display Id
58 */
59 private int _nIdDisplay;
60
61 /**
62 * Indicate whether the title is displayed in the front office or not
63 */
64 private boolean _bIsDisplayTitleFo;
65
66 /**
67 * Indicate whether the form is displayed on the front office portlet or not
68 */
69 private boolean _bIsDisplayedOnPortlet;
70
71 /**
72 * Form Icon
73 */
74 private ImageResource _icon;
75
76 /**
77 * Number of weeks during which the form is displayed to the user
78 */
79 @Min( value = 0, message = "#i18n{appointment.validation.appointmentform.fromTimeSeizure.notEmpty}" )
80 private int _nbWeeksToDisplay;
81
82 /**
83 * Calendar Template Id of the Display Form (foreign key)
84 */
85 private int _nIdCalendarTemplate;
86
87 /**
88 * Form id (foreign key)
89 */
90 private int _nIdForm;
91
92 /**
93 * Get the Display Id
94 *
95 * @return the Display Id
96 */
97 public int getIdDisplay( )
98 {
99 return _nIdDisplay;
100 }
101
102 /**
103 * Set the Display Id
104 *
105 * @param _nIdDisplay
106 * the Id to set
107 */
108 public void setIdDisplay( int nIdDisplay )
109 {
110 this._nIdDisplay = nIdDisplay;
111 }
112
113 /**
114 * Get the display title value for the front office form
115 *
116 * @return true if the title has to be displayed
117 */
118 public boolean isDisplayTitleFo( )
119 {
120 return _bIsDisplayTitleFo;
121 }
122
123 /**
124 * Get the boolean value for displayed or not the form on the portlet
125 *
126 * @return true if the form has to be displayed on the portlet
127 */
128 public boolean isDisplayedOnPortlet( )
129 {
130 return _bIsDisplayedOnPortlet;
131 }
132
133 /**
134 * Set the boolean value to display or not the form on the portlet
135 *
136 * @param bIsDisplayedOnPortlet
137 */
138 public void setIsDisplayedOnPortlet( boolean bIsDisplayedOnPortlet )
139 {
140 this._bIsDisplayedOnPortlet = bIsDisplayedOnPortlet;
141 }
142
143 /**
144 * Set the display title boolean value
145 *
146 * @param displayTitleFo
147 * the boolean display title value to set
148 */
149 public void setDisplayTitleFo( boolean bIsDisplayTitleFo )
150 {
151 this._bIsDisplayTitleFo = bIsDisplayTitleFo;
152 }
153
154 /**
155 * Get the form icon
156 *
157 * @return the form icon
158 */
159 public ImageResource getIcon( )
160 {
161 return _icon;
162 }
163
164 /**
165 * Set the form icon
166 *
167 * @param icon
168 * the icon to set
169 */
170 public void setIcon( ImageResource icon )
171 {
172 this._icon = icon;
173 }
174
175 /**
176 * Get the number of weeks during which the form is displayed to the user
177 *
178 * @return the number of weeks
179 */
180 public int getNbWeeksToDisplay( )
181 {
182 return _nbWeeksToDisplay;
183 }
184
185 /**
186 * Set the number of weeks during which the form is displayed to the user
187 *
188 * @param nbWeeksToDisplay
189 * the number of weeks to set
190 */
191 public void setNbWeeksToDisplay( int nbWeeksToDisplay )
192 {
193 this._nbWeeksToDisplay = nbWeeksToDisplay;
194 }
195
196 /**
197 * Get the Calendar Template Id
198 *
199 * @return the Calendar Template Id
200 */
201 public int getIdCalendarTemplate( )
202 {
203 return _nIdCalendarTemplate;
204 }
205
206 /**
207 * Set the Calendar Template Id
208 *
209 * @param nIdCalendarTemplate
210 * the Calendar Template Id to set
211 */
212 public void setIdCalendarTemplate( int nIdCalendarTemplate )
213 {
214 this._nIdCalendarTemplate = nIdCalendarTemplate;
215 }
216
217 /**
218 * Get the Form Id
219 *
220 * @return the Form Id
221 */
222 public int getIdForm( )
223 {
224 return _nIdForm;
225 }
226
227 /**
228 * Set the FOrm Id
229 *
230 * @param nIdForm
231 * the Form Id to set
232 */
233 public void setIdForm( int nIdForm )
234 {
235 this._nIdForm = nIdForm;
236 }
237
238 }