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
47 public class HistoryEvent implements Localizable
48 {
49 private static final String USER_UNKNOWN = "unknown user";
50
51
52 private int _nIdDocument;
53 private java.sql.Timestamp _eventDate;
54 private String _strEventUser;
55 private String _strEventMessageKey;
56 private String _strDocumentStateKey;
57 private String _strSpace;
58 private Locale _locale;
59
60
61
62
63
64
65 public int getIdDocument( )
66 {
67 return _nIdDocument;
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 public void setSpace( String strSpace )
96 {
97 _strSpace = strSpace;
98 }
99
100
101
102
103
104
105 public java.sql.Timestamp getDate( )
106 {
107 return _eventDate;
108 }
109
110
111
112
113
114
115 public void setDate( java.sql.Timestamp eventDate )
116 {
117 _eventDate = eventDate;
118 }
119
120
121
122
123
124
125 public String getEventUser( )
126 {
127 return _strEventUser;
128 }
129
130
131
132
133
134
135 public void setEventUser( String strEventUser )
136 {
137 _strEventUser = strEventUser;
138 }
139
140
141
142
143
144
145 public String getEventMessageKey( )
146 {
147 return _strEventMessageKey;
148 }
149
150
151
152
153
154
155 public void setEventMessageKey( String strEventMessageKey )
156 {
157 _strEventMessageKey = strEventMessageKey;
158 }
159
160
161
162
163
164
165 public String getDescription( )
166 {
167 String strUser = USER_UNKNOWN;
168 AdminUser user = AdminUserHome.findUserByLogin( _strEventUser );
169
170 if ( user != null )
171 {
172 strUser = user.getFirstName( ) + " " + user.getLastName( );
173 }
174
175 String[] args = { strUser, I18nService.getLocalizedString( _strDocumentStateKey, _locale ), _strSpace };
176
177 return I18nService.getLocalizedString( _strEventMessageKey, args, _locale );
178 }
179
180
181
182
183
184
185 public void setLocale( Locale locale )
186 {
187 _locale = locale;
188 }
189
190
191
192
193
194
195 public String getDocumentStateKey( )
196 {
197 return _strDocumentStateKey;
198 }
199
200
201
202
203
204
205 public void setDocumentStateKey( String strDocumentStateKey )
206 {
207 _strDocumentStateKey = strDocumentStateKey;
208 }
209 }