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