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.appstore.business;
35
36 import fr.paris.lutece.portal.service.resource.IExtendableResource;
37
38 /**
39 * This is the business class for the object Application
40 */
41 public class Application implements IExtendableResource
42 {
43 public static final String RESOURCE_TYPE = "APP";
44 public static final String RESOURCE_TYPE_DESCRIPTION = "Appstore Application";
45
46 // Variables declarations
47 public static final int NOT_PUBLISHED = 0;
48 public static final int PUBLISHED = 1;
49 public static final int PUBLISHED_NEW = 2;
50 private int _nIdApplication;
51 private String _strTitle;
52 private String _strDescription;
53 private int _nIdCategory;
54 private String _strCategory;
55 private int _nOrder;
56 private int _nIdIcon;
57 private String _strPomUrl;
58 private String _strWebappUrl;
59 private String _strSqlScriptUrl;
60 private String _strArtifactId;
61 private String _strPresentation;
62 private String _strInstallation;
63 private String _strVersion;
64 private int _nBuildStatus;
65 private int _nPublishStatus;
66
67 /**
68 * Returns the IdApplication
69 *
70 * @return The IdApplication
71 */
72 public int getId( )
73 {
74 return _nIdApplication;
75 }
76
77 /**
78 * Sets the IdApplication
79 *
80 * @param nIdApplication
81 * The IdApplication
82 */
83 public void setId( int nIdApplication )
84 {
85 _nIdApplication = nIdApplication;
86 }
87
88 /**
89 * Returns the Title
90 *
91 * @return The Title
92 */
93 public String getTitle( )
94 {
95 return _strTitle;
96 }
97
98 /**
99 * Sets the Title
100 *
101 * @param strTitle
102 * The Title
103 */
104 public void setTitle( String strTitle )
105 {
106 _strTitle = strTitle;
107 }
108
109 /**
110 * Returns the Description
111 *
112 * @return The Description
113 */
114 public String getDescription( )
115 {
116 return _strDescription;
117 }
118
119 /**
120 * Sets the Description
121 *
122 * @param strDescription
123 * The Description
124 */
125 public void setDescription( String strDescription )
126 {
127 _strDescription = strDescription;
128 }
129
130 /**
131 * Returns the IdCategory
132 *
133 * @return The IdCategory
134 */
135 public int getIdCategory( )
136 {
137 return _nIdCategory;
138 }
139
140 /**
141 * Sets the IdCategory
142 *
143 * @param nIdCategory
144 * The IdCategory
145 */
146 public void setIdCategory( int nIdCategory )
147 {
148 _nIdCategory = nIdCategory;
149 }
150
151 /**
152 * Returns the Category
153 *
154 * @return The Category
155 */
156 public String getCategory( )
157 {
158 return _strCategory;
159 }
160
161 /**
162 * Sets the Category
163 *
164 * @param strCategory
165 * The Category
166 */
167 public void setCategory( String strCategory )
168 {
169 _strCategory = strCategory;
170 }
171
172 /**
173 * Returns the ApplicationOrder
174 *
175 * @return The ApplicationOrder
176 */
177 public int getOrder( )
178 {
179 return _nOrder;
180 }
181
182 /**
183 * Sets the ApplicationOrder
184 *
185 * @param nApplicationOrder
186 * The ApplicationOrder
187 */
188 public void setOrder( int nApplicationOrder )
189 {
190 _nOrder = nApplicationOrder;
191 }
192
193 /**
194 * Returns the IdIcon
195 *
196 * @return The IdIcon
197 */
198 public int getIdIcon( )
199 {
200 return _nIdIcon;
201 }
202
203 /**
204 * Sets the IdIcon
205 *
206 * @param nIdIcon
207 * The IdIcon
208 */
209 public void setIdIcon( int nIdIcon )
210 {
211 _nIdIcon = nIdIcon;
212 }
213
214 /**
215 * Returns the PomUrl
216 *
217 * @return The PomUrl
218 */
219 public String getPomUrl( )
220 {
221 return _strPomUrl;
222 }
223
224 /**
225 * Sets the PomUrl
226 *
227 * @param strPomUrl
228 * The PomUrl
229 */
230 public void setPomUrl( String strPomUrl )
231 {
232 _strPomUrl = strPomUrl;
233 }
234
235 /**
236 * Returns the WebappUrl
237 *
238 * @return The WebappUrl
239 */
240 public String getWebappUrl( )
241 {
242 return _strWebappUrl;
243 }
244
245 /**
246 * Sets the WebappUrl
247 *
248 * @param strWebappUrl
249 * The WebappUrl
250 */
251 public void setWebappUrl( String strWebappUrl )
252 {
253 _strWebappUrl = strWebappUrl;
254 }
255
256 /**
257 * Returns the SqlScriptUrl
258 *
259 * @return The SqlScriptUrl
260 */
261 public String getSqlScriptUrl( )
262 {
263 return _strSqlScriptUrl;
264 }
265
266 /**
267 * Sets the SqlScriptUrl
268 *
269 * @param strSqlScriptUrl
270 * The SqlScriptUrl
271 */
272 public void setSqlScriptUrl( String strSqlScriptUrl )
273 {
274 _strSqlScriptUrl = strSqlScriptUrl;
275 }
276
277 /**
278 * Returns the ArtifactId
279 *
280 * @return The ArtifactId
281 */
282 public String getArtifactId( )
283 {
284 return _strArtifactId;
285 }
286
287 /**
288 * Sets the ArtifactId
289 *
290 * @param strArtifactId
291 * The ArtifactId
292 */
293 public void setArtifactId( String strArtifactId )
294 {
295 _strArtifactId = strArtifactId;
296 }
297
298 /**
299 * Returns the Presentation
300 *
301 * @return The Presentation
302 */
303 public String getPresentation( )
304 {
305 return _strPresentation;
306 }
307
308 /**
309 * Sets the Presentation
310 *
311 * @param strPresentation
312 * The Presentation
313 */
314 public void setPresentation( String strPresentation )
315 {
316 _strPresentation = strPresentation;
317 }
318
319 /**
320 * Returns the Installation
321 *
322 * @return The Installation
323 */
324 public String getInstallation( )
325 {
326 return _strInstallation;
327 }
328
329 /**
330 * Sets the Installation
331 *
332 * @param strInstallation
333 * The Installation
334 */
335 public void setInstallation( String strInstallation )
336 {
337 _strInstallation = strInstallation;
338 }
339
340 /**
341 * Returns the Version
342 *
343 * @return The Version
344 */
345 public String getVersion( )
346 {
347 return _strVersion;
348 }
349
350 /**
351 * Sets the Version
352 *
353 * @param strVersion
354 * The Version
355 */
356 public void setVersion( String strVersion )
357 {
358 _strVersion = strVersion;
359 }
360
361 /**
362 * Returns the BuildStatus
363 *
364 * @return The BuildStatus
365 */
366 public int getBuildStatus( )
367 {
368 return _nBuildStatus;
369 }
370
371 /**
372 * Sets the BuildStatus
373 *
374 * @param nBuildStatus
375 * The BuildStatus
376 */
377 public void setBuildStatus( int nBuildStatus )
378 {
379 _nBuildStatus = nBuildStatus;
380 }
381
382 /**
383 * Returns the PublishStatus
384 *
385 * @return The PublishStatus
386 */
387 public int getPublishStatus( )
388 {
389 return _nPublishStatus;
390 }
391
392 /**
393 * Sets the PublishStatus
394 *
395 * @param nPublishStatus
396 * The PublishStatus
397 */
398 public void setPublishStatus( int nPublishStatus )
399 {
400 _nPublishStatus = nPublishStatus;
401 }
402
403 @Override
404 public String getIdExtendableResource( )
405 {
406 return Integer.toString( _nIdApplication );
407 }
408
409 @Override
410 public String getExtendableResourceType( )
411 {
412 return RESOURCE_TYPE;
413 }
414
415 @Override
416 public String getExtendableResourceName( )
417 {
418 return _strTitle;
419 }
420
421 @Override
422 public String getExtendableResourceDescription( )
423 {
424 return _strDescription;
425 }
426
427 @Override
428 public String getExtendableResourceImageUrl( )
429 {
430 return "image?resource_type=appstore_icon_img&id=" + _nIdIcon;
431 }
432 }