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