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.document.modules.export.dto.exportdocument;
35
36 import fr.paris.lutece.plugins.document.business.Document;
37
38 import java.text.SimpleDateFormat;
39
40
41
42
43
44 public class ExportUserDocumentDTO
45 {
46 public static final String RESOURCE_TYPE = "DOCUMENT_EXPORT";
47 private static final String DATE_FORMAT = "dd/MM/yyyy";
48 private static final String EMPTY_STRING = "";
49 private int _nIdDocument;
50 private String _strTitle;
51 private String _strType;
52 private String _strState;
53 private String _strDateValidityBegin;
54 private String _strDateValidityEnd;
55 private String _strDateCreation;
56 private String _strDateModification;
57 private String _strSpacePath;
58
59
60
61
62
63 public ExportUserDocumentDTO( Document document )
64 {
65 this._nIdDocument = document.getId( );
66 this._strTitle = document.getTitle( );
67 this._strType = document.getType( );
68 this._strState = document.getState( );
69 this.setDateValidityBegin( document.getDateValidityBegin( ) );
70 this.setDateValidityEnd( document.getDateValidityEnd( ) );
71 this.setDateCreation( document.getDateCreation( ) );
72 this.setDateModification( document.getDateModification( ) );
73 }
74
75
76
77
78
79 public String[] toTabString( )
80 {
81 String[] tabStrTemp =
82 {
83 String.valueOf( this.getId( ) ), this.getTitle( ), this.getType( ), this.getState( ),
84 this.getDateValidityBegin( ), this.getDateValidityEnd( ), this.getDateCreation( ),
85 this.getDateModification( ), this.getSpacePath( ),
86 };
87
88 return tabStrTemp;
89 }
90
91
92
93
94
95
96 public int getId( )
97 {
98 return _nIdDocument;
99 }
100
101
102
103
104
105
106 public void setId( int nIdDocument )
107 {
108 _nIdDocument = nIdDocument;
109 }
110
111
112
113
114
115
116 public String getTitle( )
117 {
118 return _strTitle;
119 }
120
121
122
123
124
125
126 public void setTitle( String strTitle )
127 {
128 _strTitle = strTitle;
129 }
130
131
132
133
134
135
136 public String getDateCreation( )
137 {
138 return _strDateCreation;
139 }
140
141
142
143
144
145
146 public void setDateCreation( String dateCreation )
147 {
148 _strDateCreation = dateCreation;
149 }
150
151
152
153
154
155
156 public final void setDateCreation( java.sql.Timestamp dateCreation )
157 {
158 if ( dateCreation == null )
159 {
160 _strDateCreation = EMPTY_STRING;
161 }
162 else
163 {
164 _strDateCreation = new SimpleDateFormat( DATE_FORMAT ).format( dateCreation );
165 }
166 }
167
168
169
170
171
172
173 public String getDateModification( )
174 {
175 return _strDateModification;
176 }
177
178
179
180
181
182
183 public void setDateModification( String dateModification )
184 {
185 _strDateModification = dateModification;
186 }
187
188
189
190
191
192
193 public final void setDateModification( java.sql.Timestamp dateModification )
194 {
195 if ( dateModification == null )
196 {
197 _strDateModification = EMPTY_STRING;
198 }
199 else
200 {
201 _strDateModification = new SimpleDateFormat( DATE_FORMAT ).format( dateModification );
202 }
203 }
204
205
206
207
208
209
210 public String getDateValidityBegin( )
211 {
212 return _strDateValidityBegin;
213 }
214
215
216
217
218
219
220 public void setDateValidityBegin( String dateValidityBegin )
221 {
222 _strDateValidityBegin = dateValidityBegin;
223 }
224
225
226
227
228
229
230 public final void setDateValidityBegin( java.sql.Timestamp dateValidityBegin )
231 {
232 if ( dateValidityBegin == null )
233 {
234 _strDateValidityBegin = EMPTY_STRING;
235 }
236 else
237 {
238 _strDateValidityBegin = new SimpleDateFormat( DATE_FORMAT ).format( dateValidityBegin );
239 }
240 }
241
242
243
244
245
246
247 public String getDateValidityEnd( )
248 {
249 return _strDateValidityEnd;
250 }
251
252
253
254
255
256
257 public void setDateValidityEnd( String dateValidityEnd )
258 {
259 _strDateValidityEnd = dateValidityEnd;
260 }
261
262
263
264
265
266
267 public final void setDateValidityEnd( java.sql.Timestamp dateValidityEnd )
268 {
269 if ( dateValidityEnd == null )
270 {
271 _strDateValidityEnd = EMPTY_STRING;
272 }
273 else
274 {
275 _strDateValidityEnd = new SimpleDateFormat( DATE_FORMAT ).format( dateValidityEnd );
276 }
277 }
278
279
280
281
282
283
284 public String getStateKey( )
285 {
286 return _strState;
287 }
288
289
290
291
292
293
294 public String getState( )
295 {
296 return _strState;
297 }
298
299
300
301
302
303
304 public void setStateKey( String strState )
305 {
306 _strState = strState;
307 }
308
309
310
311
312
313
314 public String getType( )
315 {
316 return _strType;
317 }
318
319
320
321
322
323
324 public void setType( String strType )
325 {
326 _strType = strType;
327 }
328
329
330
331
332
333
334 public String getSpacePath( )
335 {
336 return _strSpacePath;
337 }
338
339
340
341
342
343
344 public void setSpacePath( String strSpacePath )
345 {
346 _strSpacePath = strSpacePath;
347 }
348 }