1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package fr.paris.lutece.plugins.digglike.business;
35
36 import fr.paris.lutece.portal.business.regularexpression.RegularExpression;
37 import fr.paris.lutece.portal.service.plugin.Plugin;
38 import fr.paris.lutece.util.ReferenceList;
39 import fr.paris.lutece.util.html.Paginator;
40 import fr.paris.lutece.util.xml.XmlUtil;
41
42 import java.util.List;
43 import java.util.Locale;
44
45 import javax.servlet.http.HttpServletRequest;
46
47
48
49
50
51
52
53 public class Entry implements IEntry
54 {
55 public static final String TAG_ENTRY = "entry";
56 public static final String TAG_ENTRY_ID = "id";
57 public static final String TAG_TITLE = "title";
58 public static final String TAG_TYPE = "type-id";
59
60
61 protected static final String PARAMETER_TITLE = "title";
62 protected static final String PARAMETER_HELP_MESSAGE = "help_message";
63 protected static final String PARAMETER_COMMENT = "comment";
64 protected static final String PARAMETER_MANDATORY = "mandatory";
65 protected static final String PARAMETER_HEIGHT = "height";
66 protected static final String PARAMETER_WIDTH = "width";
67 protected static final String PARAMETER_VALUE = "value";
68 protected static final String PARAMETER_MAX_SIZE_ENTER = "max_size_enter";
69 protected static final String PARAMETER_SHOW_IN_DIGG_SUBMIT_LIST = "show_in_digg_submit_list";
70
71
72 protected static final String MESSAGE_MANDATORY_FIELD = "digglike.message.mandatory.field";
73 protected static final String MESSAGE_NUMERIC_FIELD = "digglike.message.numeric.field";
74 protected static final String FIELD_TITLE = "digglike.createEntry.labelTitle";
75 protected static final String FIELD_INSERT_GROUP = "digglike.modifydigglike.manageEnter.labelInsertGroup";
76 protected static final String FIELD_HELP_MESSAGE = "digglike.createEntry.labelHelpMessage";
77 protected static final String FIELD_COMMENT = "digglike.createEntry.labelComment";
78 protected static final String FIELD_VALUE = "digglike.createEntry.labelValue";
79 protected static final String FIELD_PRESENTATION = "digglike.createEntry.labelPresentation";
80 protected static final String FIELD_MANDATORY = "digglike.createEntry.labelMandatory";
81 protected static final String FIELD_WIDTH = "digglike.createEntry.labelWidth";
82 protected static final String FIELD_HEIGHT = "digglike.createEntry.labelHeight";
83 protected static final String FIELD_MAX_SIZE_ENTER = "digglike.createEntry.labelMaxSizeEnter";
84
85
86 protected static final String JSP_DOWNLOAD_FILE = "jsp/admin/plugins/digglike/DoDownloadFile.jsp";
87
88
89 protected static final String MARK_ENTRY = "entry";
90
91
92 protected static final String EMPTY_STRING = "";
93 private int _nIdEntry;
94 private Digg _digg;
95 private EntryType _entryType;
96 private String _strTitle;
97 private String _strHelpMessage;
98 private String _strComment;
99 private boolean _bMandatory;
100 private int _nPosition;
101 private String _strDefaultValue;
102 private int _nHeight = -1;
103 private int _nWidth = -1;
104 private int _nMaxSizeEnter = -1;
105 private List<RegularExpression> _listRegularExpressionList;
106 private boolean _bShowInDiggSubmitList;
107 private List<EntryAdditionalAttribute> _listEntryAdditionalAttribute;
108
109
110
111
112 public String getComment( )
113 {
114 return _strComment;
115 }
116
117
118
119
120 public EntryType getEntryType( )
121 {
122 return _entryType;
123 }
124
125
126
127
128 public String getHelpMessage( )
129 {
130 return _strHelpMessage;
131 }
132
133
134
135
136 public int getIdEntry( )
137 {
138 return _nIdEntry;
139 }
140
141
142
143
144 public int getPosition( )
145 {
146 return _nPosition;
147 }
148
149
150
151
152 public String getTitle( )
153 {
154 return _strTitle;
155 }
156
157
158
159
160 public boolean isMandatory( )
161 {
162 return _bMandatory;
163 }
164
165
166
167
168 public boolean isShowInDiggSubmitList( )
169 {
170 return _bShowInDiggSubmitList;
171 }
172
173
174
175
176
177 public void setComment( String comment )
178 {
179 _strComment = comment;
180 }
181
182
183
184
185
186 public void setEntryType( EntryType entryType )
187 {
188 _entryType = entryType;
189 }
190
191
192
193
194
195 public void setHelpMessage( String helpMessage )
196 {
197 _strHelpMessage = helpMessage;
198 }
199
200
201
202
203
204 public void setIdEntry( int idEntry )
205 {
206 _nIdEntry = idEntry;
207 }
208
209
210
211
212
213 public void setShowInDiggSubmitList( boolean show )
214 {
215 _bShowInDiggSubmitList = show;
216 }
217
218
219
220
221
222 public void setMandatory( boolean mandatory )
223 {
224 _bMandatory = mandatory;
225 }
226
227
228
229
230
231 public void setPosition( int position )
232 {
233 _nPosition = position;
234 }
235
236
237
238
239
240 public void setTitle( String title )
241 {
242 _strTitle = title;
243 }
244
245
246
247
248
249 public Digg getDigg( )
250 {
251 return _digg;
252 }
253
254
255
256
257
258 public void setDigg( Digg digg )
259 {
260 this._digg = digg;
261 }
262
263
264
265
266
267 public List<RegularExpression> getRegularExpressionList( )
268 {
269 return _listRegularExpressionList;
270 }
271
272
273
274
275
276 public void setRegularExpressionList( List<RegularExpression> regularExpressionList )
277 {
278 _listRegularExpressionList = regularExpressionList;
279 }
280
281
282
283
284
285 public String getDefaultValue( )
286 {
287 return _strDefaultValue;
288 }
289
290
291
292
293
294 public void setDefaultValue( String value )
295 {
296 _strDefaultValue = value;
297 }
298
299
300
301
302
303 public int getWidth( )
304 {
305 return _nWidth;
306 }
307
308
309
310
311
312 public void setWidth( int width )
313 {
314 this._nWidth = width;
315 }
316
317
318
319
320
321 public int getHeight( )
322 {
323 return _nHeight;
324 }
325
326
327
328
329
330 public void setHeight( int height )
331 {
332 _nHeight = height;
333 }
334
335
336
337
338
339 public int getMaxSizeEnter( )
340 {
341 return _nMaxSizeEnter;
342 }
343
344
345
346
347
348 public void setMaxSizeEnter( int maxSizeEnter )
349 {
350 _nMaxSizeEnter = maxSizeEnter;
351 }
352
353
354
355
356
357
358 public String getTemplateHtmlCodeForm( )
359 {
360 return null;
361 }
362
363
364
365
366
367 public String getTemplateHtmlCodeResponse( )
368 {
369 return EMPTY_STRING;
370 }
371
372
373
374
375
376
377
378 public String getRequestData( HttpServletRequest request, Locale locale )
379 {
380 return null;
381 }
382
383
384
385
386
387
388
389
390 public FormError getResponseData( HttpServletRequest request, List<Response> listResponse, Locale locale )
391 {
392 return null;
393 }
394
395
396
397
398
399
400
401
402
403
404 public FormError getResponseData( int nIdDiggSubmit, HttpServletRequest request, List<Response> listResponse,
405 Locale locale, Plugin plugin )
406 {
407 return null;
408 }
409
410
411
412
413
414 public String getTemplateCreate( )
415 {
416 return null;
417 }
418
419
420
421
422
423 public String getTemplateModify( )
424 {
425 return null;
426 }
427
428
429
430
431
432
433
434
435
436 public Paginator getPaginator( int nItemPerPage, String strBaseUrl, String strPageIndexParameterName,
437 String strPageIndex )
438 {
439 return null;
440 }
441
442
443
444
445
446
447
448 public ReferenceList getReferenceListRegularExpression( IEntry entry, Plugin plugin )
449 {
450 return null;
451 }
452
453
454
455
456
457 public List<EntryAdditionalAttribute> getEntryAdditionalAttributeList( )
458 {
459 return _listEntryAdditionalAttribute;
460 }
461
462
463
464
465
466 public void setEntryAdditionalAttributeList( List<EntryAdditionalAttribute> entryAdditionalAttributeList )
467 {
468 _listEntryAdditionalAttribute = entryAdditionalAttributeList;
469 }
470
471 @Override
472 public void getXml( Locale locale, StringBuffer strXml )
473 {
474 XmlUtil.beginElement( strXml, TAG_ENTRY );
475 XmlUtil.addElement( strXml, TAG_ENTRY_ID, this.getIdEntry( ) );
476 XmlUtil.addElementHtml( strXml, TAG_TITLE, this.getTitle( ) );
477
478 if ( this.getEntryType( ) != null )
479 {
480 XmlUtil.addElement( strXml, TAG_TYPE, this.getEntryType( ).getIdType( ) );
481 }
482
483 XmlUtil.endElement( strXml, TAG_ENTRY );
484 }
485 }