View Javadoc
1   /*
2    * Copyright 2012-2018 CodeLibs Project and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.codelibs.fess;
17  
18  import java.util.TimeZone;
19  import java.util.regex.Pattern;
20  
21  import org.codelibs.core.CoreLibConstants;
22  import org.codelibs.core.lang.StringUtil;
23  
24  public class Constants extends CoreLibConstants {
25  
26      public static final String LINE_SEPARATOR = System.getProperty("line.separator");
27  
28      public static final int DEFAULT_ADMIN_PAGE_NUMBER = 1;
29  
30      public static final String TRUE = "true";
31  
32      public static final String FALSE = "false";
33  
34      public static final Boolean T = true;
35  
36      public static final Boolean F = false;
37  
38      public static final String SCORE = "score";
39  
40      public static final String ON = "on";
41  
42      public static final String READY = "ready";
43  
44      public static final String RUNNING = "running";
45  
46      public static final String DONE = "done";
47  
48      public static final String OK = "ok";
49  
50      public static final String FAIL = "fail";
51  
52      public static final String STOP = "stop";
53  
54      public static final String ITEM_LABEL = "label";
55  
56      public static final String ITEM_VALUE = "value";
57  
58      public static final String ITEM_NAME = "name";
59  
60      public static final String MS932 = "MS932";
61  
62      public static final String DEFAULT_CRON_EXPRESSION = "0 0 * * *";
63  
64      public static final String DEFAULT_SEARCH_LOG_CRON_EXPRESSION = "* * * * *";
65  
66      public static final String DEFAULT_DAILY_CRON_EXPRESSION = "0 0 * * *";
67  
68      public static final String DEFAULT_HOURLY_CRON_EXPRESSION = "0 * * * *";
69  
70      public static final int DEFAULT_INTERVAL_TIME_FOR_FS = 1000;
71  
72      public static final int DEFAULT_INTERVAL_TIME_FOR_WEB = 10000;
73  
74      public static final int DEFAULT_NUM_OF_THREAD_FOR_FS = 5;
75  
76      public static final int DEFAULT_NUM_OF_THREAD_FOR_WEB = 1;
77  
78      public static final long DEFAULT_CRAWLING_EXECUTION_INTERVAL = 5000L;
79  
80      // fess properties
81      public static final String USER_INFO_PROPERTY = "user.info";
82  
83      public static final String USER_FAVORITE_PROPERTY = "user.favorite";
84  
85      public static final String SEARCH_LOG_PROPERTY = "search.log";
86  
87      public static final String APPEND_QUERY_PARAMETER_PROPERTY = "append.query.parameter";
88  
89      public static final String INCREMENTAL_CRAWLING_PROPERTY = "crawling.incremental";
90  
91      public static final String CRAWLING_THREAD_COUNT_PROPERTY = "crawling.thread.count";
92  
93      public static final String CRAWLING_USER_AGENT_PROPERTY = "crawling.user.agent";
94  
95      public static final String DAY_FOR_CLEANUP_PROPERTY = "day.for.cleanup";
96  
97      public static final String WEB_API_JSON_PROPERTY = "web.api.json";
98  
99      public static final String WEB_API_SUGGEST_PROPERTY = "web.api.suggest";
100 
101     public static final String WEB_API_GSA_PROPERTY = "web.api.gsa";
102 
103     public static final String WEB_API_POPULAR_WORD_PROPERTY = "web.api.popularword";
104 
105     public static final String WEB_DESIGN_EDITOR_PROPERTY = "design.editor";
106 
107     public static final String DEFAULT_LABEL_VALUE_PROPERTY = "label.value";
108 
109     public static final String DEFAULT_SORT_VALUE_PROPERTY = "sort.value";
110 
111     public static final String VIRTUAL_HOST_VALUE_PROPERTY = "virtual.host.value";
112 
113     public static final String LOGIN_REQUIRED_PROPERTY = "login.required";
114 
115     public static final String RESULT_COLLAPSED_PROPERTY = "result.collapsed";
116 
117     public static final String LOGIN_LINK_ENALBED_PROPERTY = "login.link.enabled";
118 
119     public static final String THUMBNAIL_ENALBED_PROPERTY = "thumbnail.enabled";
120 
121     public static final String IGNORE_FAILURE_TYPE_PROPERTY = "failure.ignoretype";
122 
123     public static final String FAILURE_COUNT_THRESHOLD_PROPERTY = "failure.countthreshold";
124 
125     public static final String CSV_FILE_ENCODING_PROPERTY = "csv.file.encoding";
126 
127     public static final String PURGE_SEARCH_LOG_DAY_PROPERTY = "purge.searchlog.day";
128 
129     public static final String PURGE_USER_INFO_DAY_PROPERTY = "purge.userinfo.day";
130 
131     public static final String PURGE_JOB_LOG_DAY_PROPERTY = "purge.joblog.day";
132 
133     public static final String PURGE_BY_BOTS_PROPERTY = "purge.by.bots";
134 
135     public static final String SEARCH_FILE_PROXY_PROPERTY = "search.file.proxy";
136 
137     public static final String NOTIFICATION_TO_PROPERTY = "notification.to";
138 
139     public static final String USE_BROWSER_LOCALE_FOR_SEARCH_PROPERTY = "search.use.browser.locale";
140 
141     public static final String SUGGEST_SEARCH_LOG_PROPERTY = "suggest.searchlog";
142 
143     public static final String SUGGEST_DOCUMENTS_PROPERTY = "suggest.document";
144 
145     public static final String PURGE_SUGGEST_SEARCH_LOG_DAY_PROPERTY = "purge.suggest.searchlog.day";
146 
147     public static final String LTR_MODEL_NAME_PROPERTY = "ltr.model.name";
148 
149     public static final String LTR_WINDOW_SIZE_PROPERTY = "ltr.window.size";
150 
151     public static final String REQUEST_QUERIES = "fess.Queries";
152 
153     public static final String HIGHLIGHT_QUERIES = "fess.HighlightQueries";
154 
155     public static final String FIELD_LOGS = "fess.FieldLogs";
156 
157     public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
158 
159     public static final String ISO_DATETIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
160 
161     public static final int DONE_STATUS = 9999;
162 
163     public static final String DEFAULT_IGNORE_FAILURE_TYPE = StringUtil.EMPTY;
164 
165     public static final Integer DEFAULT_FAILURE_COUNT = -1;
166 
167     public static final String DEFAULT_PURGE_DAY = "-1";
168 
169     public static final String DEFAULT_SUGGEST_PURGE_DAY = "30";
170 
171     public static final String DEFAULT_PURGE_BY_BOTS = "Crawler"//
172             + ",crawler"//
173             + ",Bot"//
174             + ",bot"//
175             + ",Slurp"//
176             + ",Yeti"//
177             + ",Baidu"//
178             + ",Steeler"//
179             + ",ichiro"//
180             + ",hotpage"//
181             + ",Feedfetcher"//
182             + ",ia_archiver"//
183             + ",Y!J-BRI"//
184             + ",Google Desktop"//
185             + ",Seznam"//
186             + ",Tumblr"//
187             + ",YandexBot"//
188             + ",Chilkat"//
189             + ",CloudFront"//
190             + ",Mediapartners"//
191             + ",MSIE 6";
192 
193     public static final String DEFAULT_FROM_EMAIL = "Administrator <root@localhost>";
194 
195     // info map
196 
197     public static final String CRAWLER_STATUS = "CrawlerStatus";
198 
199     public static final String CRAWLER_ERRORS = "CrawlerErrors";
200 
201     public static final String CRAWLER_START_TIME = "CrawlerStartTime";
202 
203     public static final String CRAWLER_END_TIME = "CrawlerEndTime";
204 
205     public static final String CRAWLER_EXEC_TIME = "CrawlerExecTime";
206 
207     public static final String WEB_FS_CRAWLER_START_TIME = "WebFsCrawlStartTime";
208 
209     public static final String WEB_FS_CRAWLER_END_TIME = "WebFsCrawlEndTime";
210 
211     public static final String DATA_CRAWLER_START_TIME = "DataCrawlStartTime";
212 
213     public static final String DATA_CRAWLER_END_TIME = "DataCrawlEndTime";
214 
215     public static final String WEB_FS_CRAWLING_EXEC_TIME = "WebFsCrawlExecTime";
216 
217     public static final String WEB_FS_INDEX_EXEC_TIME = "WebFsIndexExecTime";
218 
219     public static final String WEB_FS_INDEX_SIZE = "WebFsIndexSize";
220 
221     public static final String DATA_CRAWLING_EXEC_TIME = "DataCrawlExecTime";
222 
223     public static final String DATA_INDEX_EXEC_TIME = "DataIndexExecTime";
224 
225     public static final String DATA_INDEX_SIZE = "DataIndexSize";
226 
227     public static final String SESSION_ID = "sessionId";
228 
229     public static final String CRAWLING_INFO_ID = "crawlingInfoId";
230 
231     public static final String INDEXING_TARGET = "indexingTarget";
232 
233     public static final String NUM_OF_THREADS = "numOfThreads";
234 
235     public static final String BASIC = "BASIC";
236 
237     public static final String DIGEST = "DIGEST";
238 
239     public static final String NTLM = "NTLM";
240 
241     public static final String FORM = "FORM";
242 
243     public static final String SAMBA = "SAMBA";
244 
245     public static final String FTP = "FTP";
246 
247     public static final String[] RESERVED = { "+", "-", "&&", "||", "!", "(", ")", "{", "}", "[", "]", "^", "~", "*", "?", "\\", ";", ":",
248             "/" };
249 
250     public static final Pattern LUCENE_FIELD_RESERVED_PATTERN = Pattern.compile("([+\\-!\\(\\){}\\[\\]^\"~\\\\:\\p{Zs}]|(&&)|(\\|\\|))"); // "*", "?",
251 
252     public static final Pattern LUCENE_RANGE_FIELD_RESERVED_PATTERN = Pattern.compile("([!\\(\\){}\\[\\]\"~\\\\:\\p{Zs}]|(&&)|(\\|\\|))");
253 
254     public static final String SEARCH_LOG_ACCESS_TYPE = "searchLogAccessType";
255 
256     public static final String SEARCH_LOG_ACCESS_TYPE_JSON = "json";
257 
258     public static final String SEARCH_LOG_ACCESS_TYPE_GSA = "gsa";
259 
260     public static final String SEARCH_LOG_ACCESS_TYPE_WEB = "web";
261 
262     public static final String SEARCH_LOG_ACCESS_TYPE_ADMIN = "admin";
263 
264     public static final String SEARCH_LOG_ACCESS_TYPE_OTHER = "other";
265 
266     public static final String RESULTS_PER_PAGE = "resultsPerPage";
267 
268     public static final String USER_CODE = "userCode";
269 
270     public static final String SEARCH_FIELD_LOG_SEARCH_QUERY = "q";
271 
272     public static final String STATS_REPORT_TYPE = "reportType";
273 
274     public static final String RESULT_DOC_ID_CACHE = "resultDocIds";
275 
276     public static final String CRAWLING_INFO_SYSTEM_NAME = "system";
277 
278     // view parameters
279 
280     public static final String FACET_QUERY = "fess.FacetQuery";
281 
282     public static final String GEO_QUERY = "fess.GeoQuery";
283 
284     public static final String FACET_FORM = "fess.FacetForm";
285 
286     public static final String GEO_FORM = "fess.GeoForm";
287 
288     public static final String LABEL_VALUE_MAP = "fess.LabelValueMap";
289 
290     public static final String OPTION_QUERY_Q = "q";
291 
292     public static final String OPTION_QUERY_CQ = "cq";
293 
294     public static final String OPTION_QUERY_OQ = "oq";
295 
296     public static final String OPTION_QUERY_NQ = "nq";
297 
298     // job
299 
300     public static final String SCHEDULED_JOB = "scheduledJob";
301 
302     public static final String DEFAULT_JOB_TARGET = "all";
303 
304     public static final String DEFAULT_JOB_SCRIPT_TYPE = "groovy";
305 
306     public static final int EXIT_OK = 0;
307 
308     public static final int EXIT_FAIL = 1;
309 
310     public static final String DCF = "dcf";
311 
312     public static final String ALL_LANGUAGES = "all";
313 
314     public static final String INVALID_NUMERIC_PARAMETER = "-1";
315 
316     public static final String FACET_FIELD_PREFIX = "field:";
317 
318     public static final String FACET_QUERY_PREFIX = "query:";
319 
320     public static final String MATCHES_ALL_QUERY = "*:*";
321 
322     public static final String FESS_ES_HTTP_ADDRESS = "fess.es.http_address";
323 
324     public static final int DEFAULT_PAGE_SIZE = 20;
325 
326     public static final int DEFAULT_START_COUNT = 0;
327 
328     public static final String PROCESS_TYPE_CRAWLING = "C";
329 
330     public static final String PROCESS_TYPE_DISPLAYING = "D";
331 
332     public static final String PROCESS_TYPE_BOTH = "B";
333 
334     public static final long ONE_DAY_IN_MILLIS = 24L * 60L * 60L * 1000L;
335 
336     public static final String GUEST_USER = "guest";
337 
338     public static final String[] PAGER_CONVERSION_RULE = { "allRecordCount", "pageSize", "currentPageNumber", "allPageCount",
339             "existPrePage", "existNextPage" };
340 
341     // crawler types
342     public static final String WEB_CRAWLER_TYPE = "web_crawling";
343 
344     public static final String FILE_CRAWLER_TYPE = "file_crawling";
345 
346     public static final String DATA_CRAWLER_TYPE = "data_crawling";
347 
348     public static final String[] COMMON_CONVERSION_RULE =
349             new String[] { "crudMode", "createdBy", "createdTime", "updatedBy", "updatedTime" };
350 
351     public static final String[] COMMON_API_CONVERSION_RULE = new String[] { "crudMode" };
352 
353     public static final String USER_INFO = "LoginInfo";
354 
355     public static final String ES_API_ACCESS_TOKEN = "esApiAccessToken";
356 
357     public static final String ADMIN_PACKAGE = "org.codelibs.fess.app.web.admin";
358 
359     public static final String DEFAULT_FIELD = "_default";
360 
361     public static final Integer DEFAULT_DAY_FOR_CLEANUP = 3;
362 
363     public static final String FESS_CONF_PATH = "fess.conf.path";
364 
365     public static final TimeZone TIMEZONE_UTC = TimeZone.getTimeZone("UTC");
366 
367     public static final String LDAP_BASE_DN = "ldap.base.dn";
368 
369     public static final String LDAP_SECURITY_PRINCIPAL = "ldap.security.principal";
370 
371     public static final String LDAP_ADMIN_SECURITY_PRINCIPAL = "ldap.admin.security.principal";
372 
373     public static final String LDAP_ADMIN_SECURITY_CREDENTIALS = "ldap.admin.security.credentials";
374 
375     public static final String LDAP_PROVIDER_URL = "ldap.provider.url";
376 
377     public static final String LDAP_SECURITY_AUTHENTICATION = "ldap.security.authentication";
378 
379     public static final String LDAP_INITIAL_CONTEXT_FACTORY = "ldap.initial.context.factory";
380 
381     public static final String LDAP_ACCOUNT_FILTER = "ldap.account.filter";
382 
383     public static final String LDAP_GROUP_FILTER = "ldap.group.filter";
384 
385     public static final String LDAP_MEMBEROF_ATTRIBUTE = "ldap.memberof.attribute";
386 
387     public static final String NOTIFICATION_LOGIN = "notification.login";
388 
389     public static final String NOTIFICATION_SEARCH_TOP = "notification.search.top";
390 
391     public static final String NOTIFICATION_ADVANCE_SEARCH = "notification.advance.search";
392 
393     public static final String MAPPING_TYPE_ARRAY = "array";
394 
395     public static final String MAPPING_TYPE_STRING = "string";
396 
397     public static final String MAPPING_TYPE_LONG = "long";
398 
399     public static final String MAPPING_TYPE_DOUBLE = "double";
400 
401     public static final String PAGING_QUERY_LIST = "pagingQueryList";
402 
403     public static final String REQUEST_LANGUAGES = "requestLanguages";
404 
405     public static final String SEARCH_PREFERENCE_LOCAL = "_local";
406 
407     public static final String CONFIG_CLEANUP_FILTERS = "cleanup.urlFilters";
408 
409     public static final String CONFIG_CLEANUP_ALL = "cleanup.all";
410 
411     public static final String GSA_API_VERSION = "3.2";
412 
413     public static final String PERMISSIONS = "permissions";
414 
415     public static final String QUERIES = "queries";
416 
417     public static final String VIRTUAL_HOSTS = "virtualHosts";
418 
419     public static final String CIPHER_PREFIX = "{cipher}";
420 
421     public static final String SYSTEM_USER = "system";
422 
423     public static final String EMPTY_USER_ID = "<empty>";
424 
425     public static final String CRAWLER_PROCESS_COMMAND_THREAD_DUMP = "thread_dump";
426 
427     public static final String FESS_THUMBNAIL_PATH = "fess.thumbnail.path";
428 
429     public static final String FESS_VAR_PATH = "fess.var.path";
430 }