modify general page
This commit is contained in:
parent
6700539107
commit
3a8aad2cc3
13 changed files with 224 additions and 240 deletions
|
@ -92,16 +92,12 @@ public class Constants extends CoreLibConstants {
|
|||
|
||||
public static final String APPEND_QUERY_PARAMETER_PROPERTY = "append.query.parameter";
|
||||
|
||||
public static final String DIFF_CRAWLING_PROPERTY = "crawling.diff";
|
||||
|
||||
public static final String USE_ACL_AS_ROLE = "use.acl.as.role";
|
||||
public static final String INCREMENTAL_CRAWLING_PROPERTY = "crawling.incremental";
|
||||
|
||||
public static final String CRAWLING_THREAD_COUNT_PROPERTY = "crawling.thread.count";
|
||||
|
||||
public static final String DAY_FOR_CLEANUP_PROPERTY = "day.for.cleanup";
|
||||
|
||||
public static final String WEB_API_XML_PROPERTY = "web.api.xml";
|
||||
|
||||
public static final String WEB_API_JSON_PROPERTY = "web.api.json";
|
||||
|
||||
public static final String WEB_API_SUGGEST_PROPERTY = "web.api.suggest";
|
||||
|
@ -328,13 +324,11 @@ public class Constants extends CoreLibConstants {
|
|||
|
||||
public static final String USER_INFO = "LoginInfo";
|
||||
|
||||
public static final String ELASTICSEARCH_WEB_URL_PROPERTY = "es.http.url";
|
||||
|
||||
public static final String ELASTICSEARCH_WEB_URL = "http://localhost:9201";
|
||||
|
||||
public static final String ES_API_ACCESS_TOKEN = "esApiAccessToken";
|
||||
|
||||
public static final String ADMIN_PACKAGE = "org.codelibs.fess.app.web.admin";
|
||||
|
||||
public static final String DEFAULT_FIELD = "_default";
|
||||
|
||||
public static final Integer DEFAULT_DAY_FOR_CLEANUP = 3;
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ import org.codelibs.fess.api.BaseApiManager;
|
|||
import org.codelibs.fess.app.web.base.login.FessLoginAssist;
|
||||
import org.codelibs.fess.exception.FessSystemException;
|
||||
import org.codelibs.fess.exception.WebApiException;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.lastaflute.web.servlet.session.SessionManager;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -92,8 +93,9 @@ public class EsApiManager extends BaseApiManager {
|
|||
}
|
||||
|
||||
protected void processRequest(final HttpServletRequest request, final HttpServletResponse response, final String path) {
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
final Method httpMethod = Method.valueOf(request.getMethod().toUpperCase(Locale.ROOT));
|
||||
final CurlRequest curlRequest = new CurlRequest(httpMethod, getUrl() + path);
|
||||
final CurlRequest curlRequest = new CurlRequest(httpMethod, fessConfig.getElasticsearchUrl() + path);
|
||||
request.getParameterMap().entrySet().stream().forEach(entry -> {
|
||||
if (entry.getValue().length > 1) {
|
||||
curlRequest.param(entry.getKey(), String.join(",", entry.getValue()));
|
||||
|
@ -140,10 +142,6 @@ public class EsApiManager extends BaseApiManager {
|
|||
});
|
||||
}
|
||||
|
||||
protected String getUrl() {
|
||||
return crawlerProperties.getProperty(Constants.ELASTICSEARCH_WEB_URL_PROPERTY, Constants.ELASTICSEARCH_WEB_URL);
|
||||
}
|
||||
|
||||
public void saveToken() {
|
||||
getSessionManager().setAttribute(Constants.ES_API_ACCESS_TOKEN, UUID.randomUUID().toString().replace("-", ""));
|
||||
}
|
||||
|
|
|
@ -80,10 +80,9 @@ public class AdminGeneralAction extends FessAdminAction {
|
|||
return asHtml(path_AdminGeneral_AdminGeneralJsp);
|
||||
});
|
||||
|
||||
updateProperty(Constants.DIFF_CRAWLING_PROPERTY,
|
||||
form.diffCrawling != null && Constants.ON.equalsIgnoreCase(form.diffCrawling) ? Constants.TRUE : Constants.FALSE);
|
||||
updateProperty(Constants.USE_ACL_AS_ROLE,
|
||||
form.useAclAsRole != null && Constants.ON.equalsIgnoreCase(form.useAclAsRole) ? Constants.TRUE : Constants.FALSE);
|
||||
updateProperty(Constants.INCREMENTAL_CRAWLING_PROPERTY,
|
||||
form.incrementalCrawling != null && Constants.ON.equalsIgnoreCase(form.incrementalCrawling) ? Constants.TRUE
|
||||
: Constants.FALSE);
|
||||
updateProperty(Constants.DAY_FOR_CLEANUP_PROPERTY, form.dayForCleanup.toString());
|
||||
updateProperty(Constants.CRAWLING_THREAD_COUNT_PROPERTY, form.crawlingThreadCount.toString());
|
||||
updateProperty(Constants.SEARCH_LOG_PROPERTY,
|
||||
|
@ -92,8 +91,6 @@ public class AdminGeneralAction extends FessAdminAction {
|
|||
: Constants.FALSE);
|
||||
updateProperty(Constants.USER_FAVORITE_PROPERTY,
|
||||
form.userFavorite != null && Constants.ON.equalsIgnoreCase(form.userFavorite) ? Constants.TRUE : Constants.FALSE);
|
||||
updateProperty(Constants.WEB_API_XML_PROPERTY,
|
||||
form.webApiXml != null && Constants.ON.equalsIgnoreCase(form.webApiXml) ? Constants.TRUE : Constants.FALSE);
|
||||
updateProperty(Constants.WEB_API_JSON_PROPERTY,
|
||||
form.webApiJson != null && Constants.ON.equalsIgnoreCase(form.webApiJson) ? Constants.TRUE : Constants.FALSE);
|
||||
updateProperty(Constants.DEFAULT_LABEL_VALUE_PROPERTY, form.defaultLabelValue);
|
||||
|
@ -114,7 +111,6 @@ public class AdminGeneralAction extends FessAdminAction {
|
|||
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.toString());
|
||||
updateProperty(Constants.ELASTICSEARCH_WEB_URL_PROPERTY, form.esHttpUrl);
|
||||
|
||||
crawlerProperties.store();
|
||||
saveInfo(messages -> messages.addSuccessUpdateCrawlerParams(GLOBAL));
|
||||
|
@ -122,14 +118,12 @@ public class AdminGeneralAction extends FessAdminAction {
|
|||
}
|
||||
|
||||
protected void updateForm(final EditForm form) {
|
||||
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.incrementalCrawling = crawlerProperties.getProperty(Constants.INCREMENTAL_CRAWLING_PROPERTY, Constants.TRUE);
|
||||
form.dayForCleanup = getPropertyAsInteger(Constants.DAY_FOR_CLEANUP_PROPERTY, Constants.DEFAULT_DAY_FOR_CLEANUP);
|
||||
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);
|
||||
form.webApiXml = crawlerProperties.getProperty(Constants.WEB_API_XML_PROPERTY, Constants.TRUE);
|
||||
form.webApiJson = crawlerProperties.getProperty(Constants.WEB_API_JSON_PROPERTY, Constants.TRUE);
|
||||
form.defaultLabelValue = crawlerProperties.getProperty(Constants.DEFAULT_LABEL_VALUE_PROPERTY, StringUtil.EMPTY);
|
||||
form.appendQueryParameter = crawlerProperties.getProperty(Constants.APPEND_QUERY_PARAMETER_PROPERTY, Constants.FALSE);
|
||||
|
@ -150,7 +144,6 @@ public class AdminGeneralAction extends FessAdminAction {
|
|||
form.suggestSearchLog = crawlerProperties.getProperty(Constants.SUGGEST_SEARCH_LOG_PROPERTY, Constants.TRUE);
|
||||
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);
|
||||
}
|
||||
|
||||
private void updateProperty(final String key, final String value) {
|
||||
|
|
|
@ -33,13 +33,7 @@ public class EditForm implements Serializable {
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Size(max = 10)
|
||||
public String diffCrawling;
|
||||
|
||||
@Size(max = 10)
|
||||
public String useAclAsRole;
|
||||
|
||||
@Size(max = 10)
|
||||
public String serverRotation;
|
||||
public String incrementalCrawling;
|
||||
|
||||
@Required
|
||||
@Min(-1)
|
||||
|
@ -62,9 +56,6 @@ public class EditForm implements Serializable {
|
|||
@Size(max = 10)
|
||||
public String userFavorite;
|
||||
|
||||
@Size(max = 10)
|
||||
public String webApiXml;
|
||||
|
||||
@Size(max = 10)
|
||||
public String webApiJson;
|
||||
|
||||
|
@ -122,6 +113,4 @@ public class EditForm implements Serializable {
|
|||
@ValidateTypeFailure
|
||||
public Integer purgeSuggestSearchLogDay;
|
||||
|
||||
@Size(max = 1000)
|
||||
public String esHttpUrl;
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class FessCrawlerThread extends CrawlerThread {
|
|||
@Override
|
||||
protected boolean isContentUpdated(final CrawlerClient client, final UrlQueue urlQueue) {
|
||||
final DynamicProperties crawlerProperties = ComponentUtil.getCrawlerProperties();
|
||||
if (crawlerProperties.getProperty(Constants.DIFF_CRAWLING_PROPERTY, Constants.TRUE).equals(Constants.TRUE)) {
|
||||
if (crawlerProperties.getProperty(Constants.INCREMENTAL_CRAWLING_PROPERTY, Constants.TRUE).equals(Constants.TRUE)) {
|
||||
|
||||
log(logHelper, LogType.CHECK_LAST_MODIFIED, crawlerContext, urlQueue);
|
||||
final long startTime = System.currentTimeMillis();
|
||||
|
@ -65,7 +65,7 @@ public class FessCrawlerThread extends CrawlerThread {
|
|||
final SambaHelper sambaHelper = ComponentUtil.getSambaHelper();
|
||||
final IndexingHelper indexingHelper = ComponentUtil.getIndexingHelper();
|
||||
final FessEsClient fessEsClient = ComponentUtil.getElasticsearchClient();
|
||||
final boolean useAclAsRole = crawlerProperties.getProperty(Constants.USE_ACL_AS_ROLE, Constants.FALSE).equals(Constants.TRUE);
|
||||
final boolean useAclAsRole = Constants.TRUE.equals(fessConfig.getAclAsRole());
|
||||
|
||||
final String url = urlQueue.getUrl();
|
||||
ResponseData responseData = null;
|
||||
|
|
|
@ -34,7 +34,6 @@ import org.apache.tika.metadata.TikaMetadataKeys;
|
|||
import org.codelibs.core.collection.LruHashMap;
|
||||
import org.codelibs.core.io.SerializeUtil;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.core.misc.DynamicProperties;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.crawler.client.smb.SmbClient;
|
||||
import org.codelibs.fess.crawler.entity.AccessResult;
|
||||
|
@ -160,8 +159,7 @@ public abstract class AbstractFessFileTransformer extends AbstractFessXpathTrans
|
|||
final String sessionId = crawlingInfoHelper.getCanonicalSessionId(responseData.getSessionId());
|
||||
final PathMappingHelper pathMappingHelper = ComponentUtil.getPathMappingHelper();
|
||||
final SambaHelper sambaHelper = ComponentUtil.getSambaHelper();
|
||||
final DynamicProperties crawlerProperties = ComponentUtil.getCrawlerProperties();
|
||||
final boolean useAclAsRole = crawlerProperties.getProperty(Constants.USE_ACL_AS_ROLE, Constants.FALSE).equals(Constants.TRUE);
|
||||
final boolean useAclAsRole = Constants.TRUE.equals(fessConfig.getAclAsRole());
|
||||
final CrawlingConfigHelper crawlingConfigHelper = ComponentUtil.getCrawlingConfigHelper();
|
||||
final CrawlingConfig crawlingConfig = crawlingConfigHelper.get(responseData.getSessionId());
|
||||
final Date documentExpires = crawlingInfoHelper.getDocumentExpires(crawlingConfig);
|
||||
|
|
|
@ -32,6 +32,8 @@ import org.codelibs.core.misc.DynamicProperties;
|
|||
import org.codelibs.elasticsearch.runner.net.Curl;
|
||||
import org.codelibs.elasticsearch.runner.net.CurlResponse;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.dbflute.optional.OptionalEntity;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -52,7 +54,9 @@ public class DictionaryManager {
|
|||
}
|
||||
|
||||
public DictionaryFile<? extends DictionaryItem>[] getDictionaryFiles() {
|
||||
try (CurlResponse response = Curl.get(getUrl() + "/_configsync/file").param("fields", "path,@timestamp").execute()) {
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
try (CurlResponse response =
|
||||
Curl.get(fessConfig.getElasticsearchUrl() + "/_configsync/file").param("fields", "path,@timestamp").execute()) {
|
||||
final Map<String, Object> contentMap = response.getContentAsMap();
|
||||
@SuppressWarnings("unchecked")
|
||||
final List<Map<String, Object>> fileList = (List<Map<String, Object>>) contentMap.get("file");
|
||||
|
@ -90,32 +94,34 @@ public class DictionaryManager {
|
|||
}
|
||||
|
||||
public void store(final DictionaryFile<? extends DictionaryItem> dictFile, final File file) {
|
||||
getDictionaryFile(dictFile.getId())
|
||||
.ifPresent(currentFile -> {
|
||||
if (currentFile.getTimestamp().getTime() > dictFile.getTimestamp().getTime()) {
|
||||
throw new DictionaryException(dictFile.getPath() + " was updated.");
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
getDictionaryFile(dictFile.getId()).ifPresent(currentFile -> {
|
||||
if (currentFile.getTimestamp().getTime() > dictFile.getTimestamp().getTime()) {
|
||||
throw new DictionaryException(dictFile.getPath() + " was updated.");
|
||||
}
|
||||
|
||||
// TODO use stream
|
||||
try (CurlResponse response =
|
||||
Curl.post(fessConfig.getElasticsearchUrl() + "/_configsync/file").param("path", dictFile.getPath())
|
||||
.body(FileUtil.readUTF8(file)).execute()) {
|
||||
final Map<String, Object> contentMap = response.getContentAsMap();
|
||||
if (!Constants.TRUE.equalsIgnoreCase(contentMap.get("acknowledged").toString())) {
|
||||
throw new DictionaryException("Failed to update " + dictFile.getPath());
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
throw new DictionaryException("Failed to update " + dictFile.getPath(), e);
|
||||
}
|
||||
|
||||
// TODO use stream
|
||||
try (CurlResponse response =
|
||||
Curl.post(getUrl() + "/_configsync/file").param("path", dictFile.getPath()).body(FileUtil.readUTF8(file))
|
||||
.execute()) {
|
||||
final Map<String, Object> contentMap = response.getContentAsMap();
|
||||
if (!Constants.TRUE.equalsIgnoreCase(contentMap.get("acknowledged").toString())) {
|
||||
throw new DictionaryException("Failed to update " + dictFile.getPath());
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
throw new DictionaryException("Failed to update " + dictFile.getPath(), e);
|
||||
}
|
||||
|
||||
}).orElse(() -> {
|
||||
throw new DictionaryException(dictFile.getPath() + " does not exist.");
|
||||
});
|
||||
}).orElse(() -> {
|
||||
throw new DictionaryException(dictFile.getPath() + " does not exist.");
|
||||
});
|
||||
}
|
||||
|
||||
public InputStream getContentInputStream(final DictionaryFile<? extends DictionaryItem> dictFile) {
|
||||
final FessConfig fessConfig = ComponentUtil.getFessConfig();
|
||||
try {
|
||||
return Curl.get(getUrl() + "/_configsync/file").param("path", dictFile.getPath()).execute().getContentAsStream();
|
||||
return Curl.get(fessConfig.getElasticsearchUrl() + "/_configsync/file").param("path", dictFile.getPath()).execute()
|
||||
.getContentAsStream();
|
||||
} catch (final IOException e) {
|
||||
throw new DictionaryException("Failed to access " + dictFile.getPath(), e);
|
||||
}
|
||||
|
@ -125,7 +131,4 @@ public class DictionaryManager {
|
|||
creatorList.add(creator);
|
||||
}
|
||||
|
||||
protected String getUrl() {
|
||||
return crawlerProperties.getProperty(Constants.ELASTICSEARCH_WEB_URL_PROPERTY, Constants.ELASTICSEARCH_WEB_URL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -230,7 +230,8 @@ public class Crawler implements Serializable {
|
|||
if (StringUtil.isNotBlank(options.expires)) {
|
||||
dayForCleanupStr = options.expires;
|
||||
} else {
|
||||
dayForCleanupStr = crawlerProperties.getProperty(Constants.DAY_FOR_CLEANUP_PROPERTY, "1");
|
||||
dayForCleanupStr =
|
||||
crawlerProperties.getProperty(Constants.DAY_FOR_CLEANUP_PROPERTY, Constants.DEFAULT_DAY_FOR_CLEANUP.toString());
|
||||
}
|
||||
int dayForCleanup = -1;
|
||||
try {
|
||||
|
|
|
@ -143,10 +143,10 @@ public class FessLabels extends ActionMessages {
|
|||
/** The key of the message: Schedule */
|
||||
public static final String LABELS_CRON_EXPRESSION = "{labels.cronExpression}";
|
||||
|
||||
/** The key of the message: Remove Index Before Days */
|
||||
/** The key of the message: Remove Documents Before Days */
|
||||
public static final String LABELS_DAY_FOR_CLEANUP = "{labels.dayForCleanup}";
|
||||
|
||||
/** The key of the message: Num of Simultaneous Crawler Config */
|
||||
/** The key of the message: Simultaneous Crawler Config */
|
||||
public static final String LABELS_CRAWLING_THREAD_COUNT = "{labels.crawlingThreadCount}";
|
||||
|
||||
/** The key of the message: Snapshot Path */
|
||||
|
@ -243,7 +243,7 @@ public class FessLabels extends ActionMessages {
|
|||
public static final String LABELS_DESIGN_FILE_NAME = "{labels.designFileName}";
|
||||
|
||||
/** The key of the message: Check Last Modified */
|
||||
public static final String LABELS_DIFF_CRAWLING = "{labels.diffCrawling}";
|
||||
public static final String LABELS_INCREMENTAL_CRAWLING = "{labels.incrementalCrawling}";
|
||||
|
||||
/** The key of the message: Distance */
|
||||
public static final String LABELS_DISTANCE = "{labels.distance}";
|
||||
|
@ -368,9 +368,6 @@ public class FessLabels extends ActionMessages {
|
|||
/** The key of the message: Search Word */
|
||||
public static final String LABELS_SEARCH_WORD = "{labels.searchWord}";
|
||||
|
||||
/** The key of the message: Server Rotation */
|
||||
public static final String LABELS_SERVER_ROTATION = "{labels.serverRotation}";
|
||||
|
||||
/** The key of the message: Index Replication */
|
||||
public static final String LABELS_SNAPSHOT_REPLICATION = "{labels.snapshotReplication}";
|
||||
|
||||
|
@ -455,6 +452,9 @@ public class FessLabels extends ActionMessages {
|
|||
/** The key of the message: Status */
|
||||
public static final String LABELS_JOB_STATUS = "{labels.jobStatus}";
|
||||
|
||||
/** The key of the message: Labels */
|
||||
public static final String LABELS_LABEL_TYPE_IDS = "{labels.labelTypeIds}";
|
||||
|
||||
/** The key of the message: lang */
|
||||
public static final String LABELS_LANG = "{labels.lang}";
|
||||
|
||||
|
@ -497,9 +497,6 @@ public class FessLabels extends ActionMessages {
|
|||
/** The key of the message: Token */
|
||||
public static final String LABELS_TOKEN = "{labels.token}";
|
||||
|
||||
/** The key of the message: Use ACL as Role */
|
||||
public static final String LABELS_USE_ACL_AS_ROLE = "{labels.useAclAsRole}";
|
||||
|
||||
/** The key of the message: Synonym File */
|
||||
public static final String LABELS_SYNONYM_FILE = "{labels.synonymFile}";
|
||||
|
||||
|
@ -971,10 +968,7 @@ public class FessLabels extends ActionMessages {
|
|||
/** The key of the message: Enabled */
|
||||
public static final String LABELS_ENABLED = "{labels.enabled}";
|
||||
|
||||
/** The key of the message: Server Rotation */
|
||||
public static final String LABELS_server_rotation = "{labels.server_rotation}";
|
||||
|
||||
/** The key of the message: Remove Index Before */
|
||||
/** The key of the message: Remove Documents Before */
|
||||
public static final String LABELS_day_for_cleanup = "{labels.day_for_cleanup}";
|
||||
|
||||
/** The key of the message: Day(s) */
|
||||
|
@ -986,14 +980,11 @@ public class FessLabels extends ActionMessages {
|
|||
/** The key of the message: None */
|
||||
public static final String LABELS_NONE = "{labels.none}";
|
||||
|
||||
/** The key of the message: Num of Simultaneous Crawler Config */
|
||||
/** The key of the message: Simultaneous Crawler Config */
|
||||
public static final String LABELS_crawling_thread_count = "{labels.crawling_thread_count}";
|
||||
|
||||
/** The key of the message: Check Last Modified */
|
||||
public static final String LABELS_diff_crawling = "{labels.diff_crawling}";
|
||||
|
||||
/** The key of the message: Use ACL as Role */
|
||||
public static final String LABELS_use_acl_as_role = "{labels.use_acl_as_role}";
|
||||
public static final String LABELS_incremental_crawling = "{labels.incremental_crawling}";
|
||||
|
||||
/** The key of the message: Search Logging */
|
||||
public static final String LABELS_search_log_enabled = "{labels.search_log_enabled}";
|
||||
|
@ -1088,7 +1079,7 @@ public class FessLabels extends ActionMessages {
|
|||
/** The key of the message: Suggest by Search Words */
|
||||
public static final String LABELS_suggest_search_log_enabled = "{labels.suggest_search_log_enabled}";
|
||||
|
||||
/** The key of the message: Purge Suggest Docs by Search Words */
|
||||
/** The key of the message: Purge Suggest Documents Before */
|
||||
public static final String LABELS_purge_suggest_search_log_day = "{labels.purge_suggest_search_log_day}";
|
||||
|
||||
/** The key of the message: Crawling Information */
|
||||
|
@ -2079,11 +2070,17 @@ public class FessLabels extends ActionMessages {
|
|||
/** The key of the message: Toggle navigation */
|
||||
public static final String LABELS_admin_toggle_navi = "{labels.admin_toggle_navi}";
|
||||
|
||||
/** The key of the message: Search Server URL */
|
||||
public static final String LABELS_es_http_url = "{labels.es_http_url}";
|
||||
/** The key of the message: System */
|
||||
public static final String LABELS_general_menu_system = "{labels.general_menu_system}";
|
||||
|
||||
/** The key of the message: */
|
||||
public static final String LABELS_LABEL_TYPE_IDS = "{labels.labelTypeIds}";
|
||||
/** The key of the message: Crawler */
|
||||
public static final String LABELS_general_menu_crawler = "{labels.general_menu_crawler}";
|
||||
|
||||
/** The key of the message: Logging */
|
||||
public static final String LABELS_general_menu_logging = "{labels.general_menu_logging}";
|
||||
|
||||
/** The key of the message: Suggest */
|
||||
public static final String LABELS_general_menu_suggest = "{labels.general_menu_suggest}";
|
||||
|
||||
/**
|
||||
* Assert the property is not null.
|
||||
|
|
|
@ -25,6 +25,9 @@ public interface FessConfig extends FessEnv {
|
|||
/** The key of the configuration. e.g. Fess */
|
||||
String DOMAIN_TITLE = "domain.title";
|
||||
|
||||
/** The key of the configuration. e.g. http://localhost:9201 */
|
||||
String ELASTICSEARCH_URL = "elasticsearch.url";
|
||||
|
||||
/** The key of the configuration. e.g. false */
|
||||
String CRAWLER_DOCUMENT_CACHE_ENABLE = "crawler.document.cache.enable";
|
||||
|
||||
|
@ -130,6 +133,9 @@ public interface FessConfig extends FessEnv {
|
|||
/** The key of the configuration. e.g. 1.3 */
|
||||
String QUERY_BOOST_CONTENT_LANG = "query.boost.content.lang";
|
||||
|
||||
/** The key of the configuration. e.g. false */
|
||||
String ACL_AS_ROLE = "acl.as.role";
|
||||
|
||||
/** The key of the configuration. e.g. admin */
|
||||
String AUTHENTICATION_ADMIN_ROLES = "authentication.admin.roles";
|
||||
|
||||
|
@ -304,6 +310,14 @@ public interface FessConfig extends FessEnv {
|
|||
*/
|
||||
String getDomainTitle();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'elasticsearch.url'. <br>
|
||||
* The value is, e.g. http://localhost:9201 <br>
|
||||
* comment: elasticsearch
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getElasticsearchUrl();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'crawler.document.cache.enable'. <br>
|
||||
* The value is, e.g. false <br>
|
||||
|
@ -602,6 +616,22 @@ public interface FessConfig extends FessEnv {
|
|||
*/
|
||||
java.math.BigDecimal getQueryBoostContentLangAsDecimal();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'acl.as.role'. <br>
|
||||
* The value is, e.g. false <br>
|
||||
* comment: acl
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getAclAsRole();
|
||||
|
||||
/**
|
||||
* Is the property for the key 'acl.as.role' true? <br>
|
||||
* The value is, e.g. false <br>
|
||||
* comment: acl
|
||||
* @return The determination, true or false. (if not found, exception but basically no way)
|
||||
*/
|
||||
boolean isAclAsRole();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'authentication.admin.roles'. <br>
|
||||
* The value is, e.g. admin <br>
|
||||
|
@ -1079,6 +1109,10 @@ public interface FessConfig extends FessEnv {
|
|||
return get(FessConfig.DOMAIN_TITLE);
|
||||
}
|
||||
|
||||
public String getElasticsearchUrl() {
|
||||
return get(FessConfig.ELASTICSEARCH_URL);
|
||||
}
|
||||
|
||||
public String getCrawlerDocumentCacheEnable() {
|
||||
return get(FessConfig.CRAWLER_DOCUMENT_CACHE_ENABLE);
|
||||
}
|
||||
|
@ -1243,6 +1277,14 @@ public interface FessConfig extends FessEnv {
|
|||
return getAsDecimal(FessConfig.QUERY_BOOST_CONTENT_LANG);
|
||||
}
|
||||
|
||||
public String getAclAsRole() {
|
||||
return get(FessConfig.ACL_AS_ROLE);
|
||||
}
|
||||
|
||||
public boolean isAclAsRole() {
|
||||
return is(FessConfig.ACL_AS_ROLE);
|
||||
}
|
||||
|
||||
public String getAuthenticationAdminRoles() {
|
||||
return get(FessConfig.AUTHENTICATION_ADMIN_ROLES);
|
||||
}
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
# The title of domain the application for logging
|
||||
domain.title = Fess
|
||||
|
||||
# elasticsearch
|
||||
elasticsearch.url=http://localhost:9201
|
||||
|
||||
# ========================================================================================
|
||||
# Index
|
||||
|
@ -57,6 +59,9 @@ query.boost.title.lang=2.0
|
|||
query.boost.content=1.0
|
||||
query.boost.content.lang=1.3
|
||||
|
||||
# acl
|
||||
acl.as.role=false
|
||||
|
||||
# ========================================================================================
|
||||
# Web
|
||||
# =====
|
||||
|
|
|
@ -39,8 +39,8 @@ labels.versionNo=Version No.
|
|||
labels.webConfigId=Web Config Id
|
||||
labels.logFileName=Log File Name
|
||||
labels.cronExpression=Schedule
|
||||
labels.dayForCleanup=Remove Index Before Days
|
||||
labels.crawlingThreadCount=Num of Simultaneous Crawler Config
|
||||
labels.dayForCleanup=Remove Documents Before Days
|
||||
labels.crawlingThreadCount=Simultaneous Crawler Config
|
||||
labels.snapshotPath=Snapshot Path
|
||||
labels.boost=Boost
|
||||
labels.uploadedFile=File
|
||||
|
@ -72,7 +72,7 @@ labels.currentServerStatusForSelect=Current Server Status (Select)
|
|||
labels.currentServerStatusForUpdate=Current Server Status (Update)
|
||||
labels.defaultLabelValue=Default Label
|
||||
labels.designFileName=File Name
|
||||
labels.diffCrawling=Check Last Modified
|
||||
labels.incrementalCrawling=Check Last Modified
|
||||
labels.distance=Distance
|
||||
labels.encoding=Encoding
|
||||
labels.errorCount=Error Count
|
||||
|
@ -115,7 +115,6 @@ labels.rt=rt
|
|||
labels.scheduleDay=Schedule
|
||||
labels.searchLog=Search Log
|
||||
labels.searchWord=Search Word
|
||||
labels.serverRotation=Server Rotation
|
||||
labels.snapshotReplication=Index Replication
|
||||
labels.solrInstanceName=Solr Instance Name
|
||||
labels.sort=Sort
|
||||
|
@ -144,7 +143,7 @@ labels.inputs=Source
|
|||
labels.jobLogging=Logging
|
||||
labels.jobName=Name
|
||||
labels.jobStatus=Status
|
||||
labels.labelTypeIds
|
||||
labels.labelTypeIds=Labels
|
||||
labels.lang=lang
|
||||
labels.outputs=Target
|
||||
labels.pos=POS
|
||||
|
@ -159,7 +158,6 @@ labels.segmentation=Segmentation
|
|||
labels.startTime=Start Time
|
||||
labels.target=Target
|
||||
labels.token=Token
|
||||
labels.useAclAsRole=Use ACL as Role
|
||||
labels.synonymFile=Synonym File
|
||||
labels.userDictFile=Kuromoji File
|
||||
labels.suggestElevateWordFile=Additional Word File
|
||||
|
@ -321,14 +319,12 @@ labels.crawler_configuration=General Configuration
|
|||
labels.crawler_title_edit=General Configuration
|
||||
labels.schedule=Schedule
|
||||
labels.enabled=Enabled
|
||||
labels.server_rotation=Server Rotation
|
||||
labels.day_for_cleanup=Remove Index Before
|
||||
labels.day_for_cleanup=Remove Documents Before
|
||||
labels.day=Day(s)
|
||||
labels.crawl_button_update=Update
|
||||
labels.none=None
|
||||
labels.crawling_thread_count=Num of Simultaneous Crawler Config
|
||||
labels.diff_crawling=Check Last Modified
|
||||
labels.use_acl_as_role=Use ACL as Role
|
||||
labels.crawling_thread_count=Simultaneous Crawler Config
|
||||
labels.incremental_crawling=Check Last Modified
|
||||
labels.search_log_enabled=Search Logging
|
||||
labels.user_info_enabled=User Logging
|
||||
labels.user_favorite_enabled=Favorite Logging
|
||||
|
@ -360,7 +356,7 @@ labels.duplicate_host_configuration=Duplicate Host
|
|||
labels.duplicate_host_title_details=Duplicate Host
|
||||
labels.dashboard_title_configuration=System Configuration
|
||||
labels.suggest_search_log_enabled=Suggest by Search Words
|
||||
labels.purge_suggest_search_log_day=Purge Suggest Docs by Search Words
|
||||
labels.purge_suggest_search_log_day=Purge Suggest Documents Before
|
||||
labels.crawling_info_title=Crawling Information
|
||||
labels.crawling_info_title_confirm=Crawling Information
|
||||
labels.crawling_info_button_back=Back
|
||||
|
@ -691,4 +687,8 @@ labels.crud_delete_confirmation=Do you really want to delete it?
|
|||
labels.admin_brand_title=Fess
|
||||
labels.admin_dashboard_title=Dashboard
|
||||
labels.admin_toggle_navi=Toggle navigation
|
||||
labels.es_http_url=Search Server URL
|
||||
labels.general_menu_system=System
|
||||
labels.general_menu_crawler=Crawler
|
||||
labels.general_menu_logging=Logging
|
||||
labels.general_menu_suggest=Suggest
|
||||
|
||||
|
|
|
@ -31,75 +31,8 @@
|
|||
</la:info>
|
||||
<la:errors property="_global" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="esHttpUrl" class="col-sm-3 control-label"><la:message
|
||||
key="labels.es_http_url" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="esHttpUrl" />
|
||||
<la:text property="esHttpUrl" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="searchLog" class="col-sm-3 control-label"><la:message
|
||||
key="labels.search_log_enabled" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="searchLog" />
|
||||
<div class="checkbox">
|
||||
<label> <la:checkbox property="searchLog" /> <la:message
|
||||
key="labels.enabled" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="userInfo" class="col-sm-3 control-label"><la:message
|
||||
key="labels.user_info_enabled" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="userInfo" />
|
||||
<div class="checkbox">
|
||||
<label> <la:checkbox property="userInfo" /> <la:message
|
||||
key="labels.enabled" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="userFavorite" class="col-sm-3 control-label"><la:message
|
||||
key="labels.user_favorite_enabled" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="userFavorite" />
|
||||
<div class="checkbox">
|
||||
<label> <la:checkbox property="userFavorite" /> <la:message
|
||||
key="labels.enabled" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="appendQueryParameter"
|
||||
class="col-sm-3 control-label"><la:message
|
||||
key="labels.append_query_param_enabled" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="appendQueryParameter" />
|
||||
<div class="checkbox">
|
||||
<label> <la:checkbox property="appendQueryParameter" />
|
||||
<la:message key="labels.enabled" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="webApiXml" class="col-sm-3 control-label"><la:message
|
||||
key="labels.web_api_xml_enabled" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="webApiXml" />
|
||||
<div class="checkbox">
|
||||
<label> <la:checkbox property="webApiXml" /> <la:message
|
||||
key="labels.enabled" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- System --%>
|
||||
<h4><la:message key="labels.general_menu_system" /></h4>
|
||||
<div class="form-group">
|
||||
<label for="webApiJson" class="col-sm-3 control-label"><la:message
|
||||
key="labels.web_api_json_enabled" /></label>
|
||||
|
@ -112,15 +45,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="defaultLabelValue" class="col-sm-3 control-label"><la:message
|
||||
key="labels.default_label_value" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="defaultLabelValue" />
|
||||
<la:textarea property="defaultLabelValue"
|
||||
styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="supportedSearch" class="col-sm-3 control-label"><la:message
|
||||
key="labels.supported_search_feature" /></label>
|
||||
|
@ -134,6 +58,15 @@
|
|||
</la:select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="defaultLabelValue" class="col-sm-3 control-label"><la:message
|
||||
key="labels.default_label_value" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="defaultLabelValue" />
|
||||
<la:textarea property="defaultLabelValue"
|
||||
styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="hotSearchWord" class="col-sm-3 control-label"><la:message
|
||||
key="labels.hot_search_word_enabled" /></label>
|
||||
|
@ -147,37 +80,24 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="purgeSearchLogDay" class="col-sm-3 control-label"><la:message
|
||||
key="labels.purge_search_log_day" /></label>
|
||||
<label for="csvFileEncoding" class="col-sm-3 control-label"><la:message
|
||||
key="labels.csv_file_encoding" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="purgeSearchLogDay" />
|
||||
<la:text property="purgeSearchLogDay"
|
||||
styleClass="form-control" />
|
||||
<la:errors property="csvFileEncoding" />
|
||||
<la:text property="csvFileEncoding" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="purgeJobLogDay" class="col-sm-3 control-label"><la:message
|
||||
key="labels.purge_job_log_day" /></label>
|
||||
<label for="appendQueryParameter"
|
||||
class="col-sm-3 control-label"><la:message
|
||||
key="labels.append_query_param_enabled" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="purgeJobLogDay" />
|
||||
<la:text property="purgeJobLogDay" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="purgeUserInfoDay" class="col-sm-3 control-label"><la:message
|
||||
key="labels.purge_user_info_day" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="purgeUserInfoDay" />
|
||||
<la:text property="purgeUserInfoDay"
|
||||
styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="purgeByBots" class="col-sm-3 control-label"><la:message
|
||||
key="labels.purge_by_bots" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="purgeByBots" />
|
||||
<la:text property="purgeByBots" styleClass="form-control" />
|
||||
<la:errors property="appendQueryParameter" />
|
||||
<div class="checkbox">
|
||||
<label> <la:checkbox property="appendQueryParameter" />
|
||||
<la:message key="labels.enabled" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -188,45 +108,23 @@
|
|||
<la:text property="notificationTo" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<%-- Crawler --%>
|
||||
<h4><la:message key="labels.general_menu_crawler" /></h4>
|
||||
<div class="form-group">
|
||||
<label for="csvFileEncoding" class="col-sm-3 control-label"><la:message
|
||||
key="labels.csv_file_encoding" /></label>
|
||||
<label for="purgeByBots" class="col-sm-3 control-label"><la:message
|
||||
key="labels.purge_by_bots" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="csvFileEncoding" />
|
||||
<la:text property="csvFileEncoding" styleClass="form-control" />
|
||||
<la:errors property="purgeByBots" />
|
||||
<la:text property="purgeByBots" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="diffCrawling" class="col-sm-3 control-label"><la:message
|
||||
key="labels.diff_crawling" /></label>
|
||||
<label for="incrementalCrawling" class="col-sm-3 control-label"><la:message
|
||||
key="labels.incremental_crawling" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="diffCrawling" />
|
||||
<la:errors property="incrementalCrawling" />
|
||||
<div class="checkbox">
|
||||
<label> <la:checkbox property="diffCrawling" /> <la:message
|
||||
key="labels.enabled" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="useAclAsRole" class="col-sm-3 control-label"><la:message
|
||||
key="labels.use_acl_as_role" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="useAclAsRole" />
|
||||
<div class="checkbox">
|
||||
<label> <la:checkbox property="useAclAsRole" /> <la:message
|
||||
key="labels.enabled" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="serverRotation" class="col-sm-3 control-label"><la:message
|
||||
key="labels.server_rotation" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="serverRotation" />
|
||||
<div class="checkbox">
|
||||
<label> <la:checkbox property="serverRotation" /> <la:message
|
||||
<label> <la:checkbox property="incrementalCrawling" /> <la:message
|
||||
key="labels.enabled" />
|
||||
</label>
|
||||
</div>
|
||||
|
@ -277,6 +175,72 @@
|
|||
styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<%-- Logging --%>
|
||||
<h4><la:message key="labels.general_menu_logging" /></h4>
|
||||
<div class="form-group">
|
||||
<label for="searchLog" class="col-sm-3 control-label"><la:message
|
||||
key="labels.search_log_enabled" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="searchLog" />
|
||||
<div class="checkbox">
|
||||
<label> <la:checkbox property="searchLog" /> <la:message
|
||||
key="labels.enabled" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="userInfo" class="col-sm-3 control-label"><la:message
|
||||
key="labels.user_info_enabled" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="userInfo" />
|
||||
<div class="checkbox">
|
||||
<label> <la:checkbox property="userInfo" /> <la:message
|
||||
key="labels.enabled" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="userFavorite" class="col-sm-3 control-label"><la:message
|
||||
key="labels.user_favorite_enabled" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="userFavorite" />
|
||||
<div class="checkbox">
|
||||
<label> <la:checkbox property="userFavorite" /> <la:message
|
||||
key="labels.enabled" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="purgeSearchLogDay" class="col-sm-3 control-label"><la:message
|
||||
key="labels.purge_search_log_day" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="purgeSearchLogDay" />
|
||||
<la:text property="purgeSearchLogDay"
|
||||
styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="purgeJobLogDay" class="col-sm-3 control-label"><la:message
|
||||
key="labels.purge_job_log_day" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="purgeJobLogDay" />
|
||||
<la:text property="purgeJobLogDay" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="purgeUserInfoDay" class="col-sm-3 control-label"><la:message
|
||||
key="labels.purge_user_info_day" /></label>
|
||||
<div class="col-sm-9">
|
||||
<la:errors property="purgeUserInfoDay" />
|
||||
<la:text property="purgeUserInfoDay"
|
||||
styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<%-- Suggest --%>
|
||||
<h4><la:message key="labels.general_menu_suggest" /></h4>
|
||||
<div class="form-group">
|
||||
<label for="suggestSearchLog" class="col-sm-3 control-label"><la:message
|
||||
key="labels.suggest_search_log_enabled" /></label>
|
||||
|
|
Loading…
Add table
Reference in a new issue