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.business.history;
35
36 import fr.paris.lutece.portal.business.user.AdminUser;
37 import fr.paris.lutece.portal.business.user.AdminUserHome;
38 import fr.paris.lutece.portal.service.i18n.I18nService;
39 import fr.paris.lutece.portal.service.i18n.Localizable;
40
41 import java.util.Locale;
42
43
44
45
46 public class HistoryEvent implements Localizable
47 {
48 private static final String USER_UNKNOWN = "unknown user";
49
50
51 private int _nIdDocument;
52 private java.sql.Timestamp _eventDate;
53 private String _strEventUser;
54 private String _strEventMessageKey;
55 private String _strDocumentStateKey;
56 private String _strSpace;
57 private Locale _locale;
58
59
60
61
62
63
64 public int getIdDocument( )
65 {
66 return _nIdDocument;
67 }
68
69
70
71
72
73
74
75 public void setIdDocument( int nIdDocument )
76 {
77 _nIdDocument = nIdDocument;
78 }
79
80
81
82
83
84
85 public String getSpace( )
86 {
87 return _strSpace;
88 }
89
90
91
92
93
94
95
96 public void setSpace( String strSpace )
97 {
98 _strSpace = strSpace;
99 }
100
101
102
103
104
105
106 public java.sql.Timestamp getDate( )
107 {
108 return _eventDate;
109 }
110
111
112
113
114
115
116
117 public void setDate( java.sql.Timestamp eventDate )
118 {
119 _eventDate = eventDate;
120 }
121
122
123
124
125
126
127 public String getEventUser( )
128 {
129 return _strEventUser;
130 }
131
132
133
134
135
136
137
138 public void setEventUser( String strEventUser )
139 {
140 _strEventUser = strEventUser;
141 }
142
143
144
145
146
147
148 public String getEventMessageKey( )
149 {
150 return _strEventMessageKey;
151 }
152
153
154
155
156
157
158
159 public void setEventMessageKey( String strEventMessageKey )
160 {
161 _strEventMessageKey = strEventMessageKey;
162 }
163
164
165
166
167
168
169 public String getDescription( )
170 {
171 String strUser = USER_UNKNOWN;
172 AdminUser user = AdminUserHome.findUserByLogin( _strEventUser );
173
174 if ( user != null )
175 {
176 strUser = user.getFirstName( ) + " " + user.getLastName( );
177 }
178
179 String [ ] args = {
180 strUser, I18nService.getLocalizedString( _strDocumentStateKey, _locale ), _strSpace
181 };
182
183 return I18nService.getLocalizedString( _strEventMessageKey, args, _locale );
184 }
185
186
187
188
189
190
191
192 public void setLocale( Locale locale )
193 {
194 _locale = locale;
195 }
196
197
198
199
200
201
202 public String getDocumentStateKey( )
203 {
204 return _strDocumentStateKey;
205 }
206
207
208
209
210
211
212
213 public void setDocumentStateKey( String strDocumentStateKey )
214 {
215 _strDocumentStateKey = strDocumentStateKey;
216 }
217 }