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.portal.service.search;
35
36 import org.apache.lucene.document.Document;
37
38
39
40
41 public class SearchItem
42 {
43 public static final String FIELD_UID = "uid";
44 public static final String FIELD_CONTENTS = "contents";
45 public static final String FIELD_TITLE = "title";
46 public static final String FIELD_SUMMARY = "summary";
47 public static final String FIELD_METADATA = "metadata";
48 public static final String FIELD_URL = "url";
49 public static final String FIELD_DATE = "date";
50 public static final String FIELD_TYPE = "type";
51 public static final String FIELD_ROLE = "role";
52 public static final String FIELD_STATE = "state";
53 public static final String FIELD_DOCUMENT_PORTLET_ID = "document_portlet_id";
54
55
56 private String _strId;
57 private String _strTitle;
58 private String _strSummary;
59 private String _strMetadata;
60 private String _strUrl;
61 private String _strLastModifiedDate;
62 private String _strType;
63 private String _strRole;
64 private String _strState;
65 private String _strDocPortletId;
66
67
68
69
70
71
72
73 public SearchItem( Document document )
74 {
75 _strId = document.get( FIELD_UID );
76 _strTitle = document.get( FIELD_TITLE );
77 _strUrl = document.get( FIELD_URL );
78 _strSummary = document.get( FIELD_SUMMARY );
79 _strMetadata = document.get( FIELD_METADATA );
80 _strLastModifiedDate = document.get( FIELD_DATE );
81 _strType = document.get( FIELD_TYPE );
82 _strDocPortletId = document.get( FIELD_DOCUMENT_PORTLET_ID );
83 _strRole = document.get( FIELD_ROLE );
84 }
85
86
87
88
89
90
91 public String getId( )
92 {
93 return _strId;
94 }
95
96
97
98
99
100
101
102 public void setId( String strId )
103 {
104 _strId = strId;
105 }
106
107
108
109
110
111
112 public String getDocPortletId( )
113 {
114 return _strDocPortletId;
115 }
116
117
118
119
120
121
122
123 public void setDocPortletId( String strDocPortletId )
124 {
125 _strDocPortletId = strDocPortletId;
126 }
127
128
129
130
131
132
133 public String getTitle( )
134 {
135 return _strTitle;
136 }
137
138
139
140
141
142
143
144 public void setTitle( String strTitle )
145 {
146 _strTitle = strTitle;
147 }
148
149
150
151
152
153
154 public String getSummary( )
155 {
156 return ( _strSummary != null ) ? _strSummary : "";
157 }
158
159
160
161
162
163
164
165 public void setSummary( String strSummary )
166 {
167 _strSummary = strSummary;
168 }
169
170
171
172
173
174
175 public String getMetadata( )
176 {
177 return ( _strMetadata != null ) ? _strMetadata : "";
178 }
179
180
181
182
183
184
185
186 public void setMetadata( String strMetadata )
187 {
188 _strSummary = strMetadata;
189 }
190
191
192
193
194
195
196 public String getUrl( )
197 {
198 return _strUrl;
199 }
200
201
202
203
204
205
206
207 public void setUrl( String strUrl )
208 {
209 _strUrl = strUrl;
210 }
211
212
213
214
215
216
217 public String getDate( )
218 {
219 return ( _strLastModifiedDate != null ) ? _strLastModifiedDate : "";
220 }
221
222
223
224
225
226
227
228 public void setDate( String strLastModifiedDate )
229 {
230 _strLastModifiedDate = strLastModifiedDate;
231 }
232
233
234
235
236
237
238 public String getType( )
239 {
240 return _strType;
241 }
242
243
244
245
246
247
248
249 public void setType( String strType )
250 {
251 _strType = strType;
252 }
253
254
255
256
257
258
259 public String getRole( )
260 {
261 return _strRole;
262 }
263
264
265
266
267
268
269
270 public void setRole( String role )
271 {
272 _strRole = role;
273 }
274
275
276
277
278
279
280 public String getState( )
281 {
282 return _strState;
283 }
284
285
286
287
288
289
290
291 public void setState( String state )
292 {
293 _strState = state;
294 }
295 }