Skip to content
Snippets Groups Projects
Commit b673cfbb authored by Kaoru FUZITA's avatar Kaoru FUZITA
Browse files

fix numeric parameter type

parent d662083e
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,7 @@ public class AdminGeneralAction extends FessAdminAction {
updateProperty(Constants.USE_ACL_AS_ROLE,
form.useAclAsRole != null && Constants.ON.equalsIgnoreCase(form.useAclAsRole) ? Constants.TRUE : Constants.FALSE);
updateProperty(Constants.DAY_FOR_CLEANUP_PROPERTY, form.dayForCleanup.toString());
updateProperty(Constants.CRAWLING_THREAD_COUNT_PROPERTY, form.crawlingThreadCount);
updateProperty(Constants.CRAWLING_THREAD_COUNT_PROPERTY, form.crawlingThreadCount.toString());
updateProperty(Constants.SEARCH_LOG_PROPERTY,
form.searchLog != null && Constants.ON.equalsIgnoreCase(form.searchLog) ? Constants.TRUE : Constants.FALSE);
updateProperty(Constants.USER_INFO_PROPERTY, form.userInfo != null && Constants.ON.equalsIgnoreCase(form.userInfo) ? Constants.TRUE
......@@ -106,14 +106,14 @@ public class AdminGeneralAction extends FessAdminAction {
updateProperty(Constants.WEB_API_HOT_SEARCH_WORD_PROPERTY,
form.hotSearchWord != null && Constants.ON.equalsIgnoreCase(form.hotSearchWord) ? Constants.TRUE : Constants.FALSE);
updateProperty(Constants.CSV_FILE_ENCODING_PROPERTY, form.csvFileEncoding);
updateProperty(Constants.PURGE_SEARCH_LOG_DAY_PROPERTY, form.purgeSearchLogDay);
updateProperty(Constants.PURGE_JOB_LOG_DAY_PROPERTY, form.purgeJobLogDay);
updateProperty(Constants.PURGE_USER_INFO_DAY_PROPERTY, form.purgeUserInfoDay);
updateProperty(Constants.PURGE_SEARCH_LOG_DAY_PROPERTY, form.purgeSearchLogDay.toString());
updateProperty(Constants.PURGE_JOB_LOG_DAY_PROPERTY, form.purgeJobLogDay.toString());
updateProperty(Constants.PURGE_USER_INFO_DAY_PROPERTY, form.purgeUserInfoDay.toString());
updateProperty(Constants.PURGE_BY_BOTS_PROPERTY, form.purgeByBots);
updateProperty(Constants.NOTIFICATION_TO_PROPERTY, form.notificationTo);
updateProperty(Constants.SUGGEST_SEARCH_LOG_PROPERTY,
form.suggestSearchLog != null && Constants.ON.equalsIgnoreCase(form.suggestSearchLog) ? Constants.TRUE : Constants.FALSE);
updateProperty(Constants.PURGE_SUGGEST_SEARCH_LOG_DAY_PROPERTY, form.purgeSuggestSearchLogDay);
updateProperty(Constants.PURGE_SUGGEST_SEARCH_LOG_DAY_PROPERTY, form.purgeSuggestSearchLogDay.toString());
updateProperty(Constants.ELASTICSEARCH_WEB_URL_PROPERTY, form.esHttpUrl);
crawlerProperties.store();
......@@ -125,7 +125,7 @@ public class AdminGeneralAction extends FessAdminAction {
form.diffCrawling = crawlerProperties.getProperty(Constants.DIFF_CRAWLING_PROPERTY, Constants.TRUE);
form.useAclAsRole = crawlerProperties.getProperty(Constants.USE_ACL_AS_ROLE, Constants.FALSE);
form.dayForCleanup = getPropertyAsInteger(Constants.DAY_FOR_CLEANUP_PROPERTY, 1);
form.crawlingThreadCount = crawlerProperties.getProperty(Constants.CRAWLING_THREAD_COUNT_PROPERTY, "5");
form.crawlingThreadCount = Integer.parseInt(crawlerProperties.getProperty(Constants.CRAWLING_THREAD_COUNT_PROPERTY, "5"));
form.searchLog = crawlerProperties.getProperty(Constants.SEARCH_LOG_PROPERTY, Constants.TRUE);
form.userInfo = crawlerProperties.getProperty(Constants.USER_INFO_PROPERTY, Constants.TRUE);
form.userFavorite = crawlerProperties.getProperty(Constants.USER_FAVORITE_PROPERTY, Constants.FALSE);
......@@ -139,13 +139,17 @@ public class AdminGeneralAction extends FessAdminAction {
form.failureCountThreshold = getPropertyAsInteger(Constants.FAILURE_COUNT_THRESHOLD_PROPERTY, Constants.DEFAULT_FAILURE_COUNT);
form.hotSearchWord = crawlerProperties.getProperty(Constants.WEB_API_HOT_SEARCH_WORD_PROPERTY, Constants.TRUE);
form.csvFileEncoding = crawlerProperties.getProperty(Constants.CSV_FILE_ENCODING_PROPERTY, Constants.UTF_8);
form.purgeSearchLogDay = crawlerProperties.getProperty(Constants.PURGE_SEARCH_LOG_DAY_PROPERTY, Constants.DEFAULT_PURGE_DAY);
form.purgeJobLogDay = crawlerProperties.getProperty(Constants.PURGE_JOB_LOG_DAY_PROPERTY, Constants.DEFAULT_PURGE_DAY);
form.purgeUserInfoDay = crawlerProperties.getProperty(Constants.PURGE_USER_INFO_DAY_PROPERTY, Constants.DEFAULT_PURGE_DAY);
form.purgeSearchLogDay =
Integer.parseInt(crawlerProperties.getProperty(Constants.PURGE_SEARCH_LOG_DAY_PROPERTY, Constants.DEFAULT_PURGE_DAY));
form.purgeJobLogDay =
Integer.parseInt(crawlerProperties.getProperty(Constants.PURGE_JOB_LOG_DAY_PROPERTY, Constants.DEFAULT_PURGE_DAY));
form.purgeUserInfoDay =
Integer.parseInt(crawlerProperties.getProperty(Constants.PURGE_USER_INFO_DAY_PROPERTY, Constants.DEFAULT_PURGE_DAY));
form.purgeByBots = crawlerProperties.getProperty(Constants.PURGE_BY_BOTS_PROPERTY, Constants.DEFAULT_PURGE_BY_BOTS);
form.notificationTo = crawlerProperties.getProperty(Constants.NOTIFICATION_TO_PROPERTY, StringUtil.EMPTY);
form.suggestSearchLog = crawlerProperties.getProperty(Constants.SUGGEST_SEARCH_LOG_PROPERTY, Constants.TRUE);
form.purgeSuggestSearchLogDay = crawlerProperties.getProperty(Constants.PURGE_SUGGEST_SEARCH_LOG_DAY_PROPERTY, "30");
form.purgeSuggestSearchLogDay =
Integer.parseInt(crawlerProperties.getProperty(Constants.PURGE_SUGGEST_SEARCH_LOG_DAY_PROPERTY, "30"));
form.esHttpUrl = crawlerProperties.getProperty(Constants.ELASTICSEARCH_WEB_URL_PROPERTY, Constants.ELASTICSEARCH_WEB_URL);
}
......
......@@ -42,15 +42,16 @@ public class EditForm implements Serializable {
public String serverRotation;
@Required
@Max(1000)
@Min(-1)
@Max(1000)
@ValidateTypeFailure
public Integer dayForCleanup;
@Required
@Max(100)
@Min(0)
public String crawlingThreadCount;
@Max(100)
@ValidateTypeFailure
public Integer crawlingThreadCount;
@Size(max = 10)
public String searchLog;
......@@ -80,8 +81,8 @@ public class EditForm implements Serializable {
public String ignoreFailureType;
@Required
@Max(10000)
@Min(-1)
@Max(10000)
@ValidateTypeFailure
public Integer failureCountThreshold;
......@@ -92,17 +93,20 @@ public class EditForm implements Serializable {
@Size(max = 20)
public String csvFileEncoding;
@Max(100000)
@Min(0)
public String purgeSearchLogDay;
@Max(100000)
@Min(0)
public String purgeJobLogDay;
@ValidateTypeFailure
public Integer purgeSearchLogDay;
@Min(0)
@Max(100000)
@ValidateTypeFailure
public Integer purgeJobLogDay;
@Min(0)
public String purgeUserInfoDay;
@Max(100000)
@ValidateTypeFailure
public Integer purgeUserInfoDay;
@Size(max = 1000)
public String purgeByBots;
......@@ -113,9 +117,10 @@ public class EditForm implements Serializable {
@Size(max = 10)
public String suggestSearchLog;
@Max(100000)
@Min(0)
public String purgeSuggestSearchLogDay;
@Max(100000)
@ValidateTypeFailure
public Integer purgeSuggestSearchLogDay;
@Size(max = 1000)
public String esHttpUrl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment