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.dbpage.business;
35
36 import fr.paris.lutece.portal.service.resource.Resource;
37 import fr.paris.lutece.portal.service.role.RoleRemovalListenerService;
38
39
40 /**
41 * This class represents the business object DbPageDatabaseSection
42 */
43 public class DbPageDatabaseSection implements Resource
44 {
45 private static final String EMPTY_STRING = "";
46 private static DbPageDatabaseSectionRoleRemovalListener _listenerRole;
47 private String _strColumn;
48 private String _strPool;
49 private String _strSql;
50 private String _strTemplatePath;
51 private String _strTitle;
52 private int _nIdOrder;
53 private int _nIdPage;
54 private String _strRole;
55
56 // Variables declarations
57 private int _nIdSection;
58 private String _strIdType;
59
60 /**
61 * Initialize the DbPage
62 */
63 public static void init( )
64 {
65 // Create removal listeners and register them
66 if ( _listenerRole == null )
67 {
68 _listenerRole = new DbPageDatabaseSectionRoleRemovalListener( );
69 RoleRemovalListenerService.getService( ).registerListener( _listenerRole );
70 }
71 }
72
73 /**
74 * Sets the Column
75 *
76 * @param strColumn The Column
77 */
78 public void setColumn( String strColumn )
79 {
80 _strColumn = ( strColumn == null ) ? EMPTY_STRING : strColumn;
81 }
82
83 /**
84 * Returns the Column
85 *
86 * @return The Column
87 */
88 public String getColumn( )
89 {
90 return _strColumn;
91 }
92
93 /**
94 * Sets the Id
95 *
96 * @param nIdSection The Id
97 */
98 public void setId( int nIdSection )
99 {
100 _nIdSection = nIdSection;
101 }
102
103 /**
104 * Returns the Id
105 *
106 * @return The Id
107 */
108 public int getId( )
109 {
110 return _nIdSection;
111 }
112
113 /**
114 * Sets the IdPage
115 *
116 * @param nIdPage The IdPage
117 */
118 public void setIdPage( int nIdPage )
119 {
120 _nIdPage = nIdPage;
121 }
122
123 /**
124 * Returns the IdPage
125 *
126 * @return The IdPage
127 */
128 public int getIdPage( )
129 {
130 return _nIdPage;
131 }
132
133 /**
134 * Sets the IdType
135 *
136 * @param strIdType The IdType
137 */
138 public void setIdType( String strIdType )
139 {
140 _strIdType = strIdType;
141 }
142
143 /**
144 * Returns the IdType
145 *
146 * @return The IdType
147 */
148 public String getIdType( )
149 {
150 return _strIdType;
151 }
152
153 /**
154 * Sets the Order
155 *
156 * @param nIdOrder The Order
157 */
158 public void setOrder( int nIdOrder )
159 {
160 _nIdOrder = nIdOrder;
161 }
162
163 /**
164 * Returns the Order
165 *
166 * @return The Order
167 */
168 public int getOrder( )
169 {
170 return _nIdOrder;
171 }
172
173 /**
174 * Sets the Pool
175 *
176 * @param strPool The Pool
177 */
178 public void setPool( String strPool )
179 {
180 _strPool = strPool;
181 }
182
183 /**
184 * Returns the Pool
185 *
186 * @return The Pool
187 */
188 public String getPool( )
189 {
190 return _strPool;
191 }
192
193 /**
194 * Sets the Sql
195 *
196 * @param strSql The Sql
197 */
198 public void setSql( String strSql )
199 {
200 _strSql = ( strSql == null ) ? EMPTY_STRING : strSql;
201 }
202
203 /**
204 * Returns the Sql
205 *
206 * @return The Sql
207 */
208 public String getSql( )
209 {
210 return _strSql;
211 }
212
213 /**
214 * Sets the Template
215 *
216 * @param strTemplatePath The Template path
217 */
218 public void setTemplatePath( String strTemplatePath )
219 {
220 _strTemplatePath = strTemplatePath;
221 }
222
223 /**
224 * Returns the Template
225 *
226 * @return The Template
227 */
228 public String getTemplatePath( )
229 {
230 return _strTemplatePath;
231 }
232
233 /**
234 * Sets the Title
235 *
236 * @param strTitle The Title
237 */
238 public void setTitle( String strTitle )
239 {
240 _strTitle = strTitle;
241 }
242
243 /**
244 * Returns the Title
245 *
246 * @return The Title
247 */
248 public String getTitle( )
249 {
250 return _strTitle;
251 }
252
253 /**
254 * Returns the Role
255 *
256 * @return The Role
257 */
258 public String getRole( )
259 {
260 return _strRole;
261 }
262
263 /**
264 * Sets the Role
265 *
266 * @param strRole The Role
267 */
268 public void setRole( String strRole )
269 {
270 _strRole = strRole;
271 }
272 }