replace with lastaflute
This commit is contained in:
parent
1ce8e19912
commit
37dd4781c8
209 changed files with 10842 additions and 1516 deletions
|
@ -38,7 +38,7 @@ map:{
|
|||
|
||||
# settings for web applications
|
||||
; appMap = map:{
|
||||
; harbor = map:{
|
||||
; fess = map:{
|
||||
; path = ..
|
||||
; freeGenList = list:{ env ; config ; label ; message ; mail ; template ; jsp ; doc }
|
||||
; propertiesHtmlList = list:{ env ; config ; label ; message }
|
||||
|
@ -47,7 +47,7 @@ map:{
|
|||
|
||||
# you can override (several) default settings like this:
|
||||
#; overrideMap = map:{
|
||||
# ; harbor.freeGen.mail.targetDir = ./playsql/data/mail
|
||||
# ; fess.freeGen.mail.targetDir = ./playsql/data/mail
|
||||
#}
|
||||
}
|
||||
# ----------------/
|
||||
|
|
|
@ -572,6 +572,28 @@ public abstract class AbstractConditionBean implements ConditionBean {
|
|||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasSpecifiedLocalColumn() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableUndefinedClassificationSelect() {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableUndefinedClassificationSelect() {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUndefinedClassificationSelectAllowed() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
public SearchRequestParams request() {
|
||||
return _searchRequestParams;
|
||||
}
|
||||
|
|
|
@ -163,6 +163,17 @@ public abstract class AbstractEntity implements Entity, Serializable, Cloneable
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void myunlockUndefinedClassificationAccess() {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean myundefinedClassificationAccessAllowed() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract Map<String, Object> toSource();
|
||||
|
||||
public class DocMeta {
|
||||
|
|
|
@ -22,9 +22,6 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.seasar.struts.annotation.Arg;
|
||||
import org.seasar.struts.annotation.Msg;
|
||||
import org.seasar.struts.annotation.Validator;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
|
|
|
@ -22,9 +22,6 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.seasar.struts.annotation.Arg;
|
||||
import org.seasar.struts.annotation.Msg;
|
||||
import org.seasar.struts.annotation.Validator;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
|
|
|
@ -28,7 +28,7 @@ import javax.servlet.ServletException;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.codelibs.core.CoreLibConstants;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
|
@ -44,8 +44,8 @@ import org.codelibs.fess.util.FacetResponse;
|
|||
import org.codelibs.fess.util.FacetResponse.Field;
|
||||
import org.codelibs.fess.util.MoreLikeThisResponse;
|
||||
import org.codelibs.fess.util.WebApiUtil;
|
||||
import org.seasar.struts.util.RequestUtil;
|
||||
import org.seasar.struts.util.ResponseUtil;
|
||||
import org.lastaflute.web.util.LaRequestUtil;
|
||||
import org.lastaflute.web.util.LaResponseUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -519,7 +519,7 @@ public class JsonApiManager extends BaseApiManager implements WebApiManager {
|
|||
}
|
||||
|
||||
protected void writeJsonResponse(final int status, final String body, final String errMsg) {
|
||||
final String callback = RequestUtil.getRequest().getParameter("callback");
|
||||
final String callback = LaRequestUtil.getRequest().getParameter("callback");
|
||||
final boolean isJsonp = StringUtil.isNotBlank(callback);
|
||||
|
||||
final StringBuilder buf = new StringBuilder(1000);
|
||||
|
@ -548,7 +548,7 @@ public class JsonApiManager extends BaseApiManager implements WebApiManager {
|
|||
if (isJsonp) {
|
||||
buf.append(')');
|
||||
}
|
||||
ResponseUtil.write(buf.toString(), "text/javascript+json", Constants.UTF_8);
|
||||
LaResponseUtil.write(buf.toString(), "text/javascript+json", Constants.UTF_8);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import javax.servlet.ServletException;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.codelibs.core.CoreLibConstants;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
|
@ -42,7 +42,7 @@ import org.codelibs.fess.util.FacetResponse;
|
|||
import org.codelibs.fess.util.FacetResponse.Field;
|
||||
import org.codelibs.fess.util.MoreLikeThisResponse;
|
||||
import org.codelibs.fess.util.WebApiUtil;
|
||||
import org.seasar.struts.util.ResponseUtil;
|
||||
import org.lastaflute.web.util.LaResponseUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -375,7 +375,7 @@ public class XmlApiManager extends BaseApiManager implements WebApiManager {
|
|||
buf.append("</message>");
|
||||
}
|
||||
buf.append("</response>");
|
||||
ResponseUtil.write(buf.toString(), "text/xml", Constants.UTF_8);
|
||||
LaResponseUtil.write(buf.toString(), "text/xml", Constants.UTF_8);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -19,8 +19,6 @@ package org.codelibs.fess.beans;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.seasar.framework.beans.util.Copy;
|
||||
|
||||
public class FessCopy extends Copy {
|
||||
|
||||
public FessCopy(final Object src, final Object dest) {
|
||||
|
|
|
@ -18,9 +18,7 @@ package org.codelibs.fess.beans.converter;
|
|||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
import org.seasar.framework.beans.Converter;
|
||||
import org.seasar.framework.exception.EmptyRuntimeException;
|
||||
import org.seasar.framework.util.StringUtil;
|
||||
import org.lastaflute.di.exception.EmptyRuntimeException;
|
||||
|
||||
public class LocalDateTimeConverter implements Converter {
|
||||
|
||||
|
|
|
@ -9,6 +9,9 @@ import java.util.Map.Entry;
|
|||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.apache.commons.codec.Charsets;
|
||||
import org.codelibs.core.beans.util.BeanUtil;
|
||||
import org.codelibs.core.io.FileUtil;
|
||||
|
@ -135,8 +138,6 @@ import org.elasticsearch.search.sort.FieldSortBuilder;
|
|||
import org.elasticsearch.search.sort.SortBuilders;
|
||||
import org.elasticsearch.search.sort.SortOrder;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.seasar.framework.container.annotation.tiger.DestroyMethod;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -183,7 +184,7 @@ public class FessEsClient implements Client {
|
|||
transportAddressList.add(new InetSocketTransportAddress(host, port));
|
||||
}
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void open() {
|
||||
final String transportAddressesValue = System.getProperty(Constants.FESS_ES_TRANSPORT_ADDRESSES);
|
||||
if (StringUtil.isNotBlank(transportAddressesValue)) {
|
||||
|
@ -318,7 +319,7 @@ public class FessEsClient implements Client {
|
|||
}
|
||||
|
||||
@Override
|
||||
@DestroyMethod
|
||||
@PreDestroy
|
||||
public void close() {
|
||||
try {
|
||||
client.close();
|
||||
|
|
|
@ -16,11 +16,11 @@
|
|||
|
||||
package org.codelibs.fess.crud.creator;
|
||||
|
||||
import org.seasar.framework.container.ComponentCustomizer;
|
||||
import org.seasar.framework.container.assembler.AutoBindingDefFactory;
|
||||
import org.seasar.framework.container.creator.ComponentCreatorImpl;
|
||||
import org.seasar.framework.container.deployer.InstanceDefFactory;
|
||||
import org.seasar.framework.convention.NamingConvention;
|
||||
import org.lastaflute.di.core.assembler.AutoBindingDefFactory;
|
||||
import org.lastaflute.di.core.creator.ComponentCreatorImpl;
|
||||
import org.lastaflute.di.core.customizer.ComponentCustomizer;
|
||||
import org.lastaflute.di.core.meta.impl.InstanceDefFactory;
|
||||
import org.lastaflute.di.naming.NamingConvention;
|
||||
|
||||
/**
|
||||
* @author shinsuke
|
||||
|
|
|
@ -18,10 +18,10 @@ package org.codelibs.fess.crud.util;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.struts.action.ActionMessage;
|
||||
import org.apache.struts.action.ActionMessages;
|
||||
import org.seasar.struts.util.ActionMessagesUtil;
|
||||
import org.seasar.struts.util.RequestUtil;
|
||||
import org.codelibs.sastruts.core.util.ActionMessagesUtil;
|
||||
import org.lastaflute.web.ruts.message.ActionMessage;
|
||||
import org.lastaflute.web.ruts.message.ActionMessages;
|
||||
import org.lastaflute.web.util.LaRequestUtil;
|
||||
|
||||
public class SAStrutsUtil {
|
||||
protected SAStrutsUtil() {
|
||||
|
@ -29,7 +29,7 @@ public class SAStrutsUtil {
|
|||
}
|
||||
|
||||
public static void addMessage(final String key) {
|
||||
addMessage(RequestUtil.getRequest(), key);
|
||||
addMessage(LaRequestUtil.getRequest(), key);
|
||||
}
|
||||
|
||||
public static void addMessage(final HttpServletRequest request, final String key) {
|
||||
|
@ -39,7 +39,7 @@ public class SAStrutsUtil {
|
|||
}
|
||||
|
||||
public static void addMessage(final String key, final Object... values) {
|
||||
addMessage(RequestUtil.getRequest(), key, values);
|
||||
addMessage(LaRequestUtil.getRequest(), key, values);
|
||||
}
|
||||
|
||||
public static void addMessage(final HttpServletRequest request, final String key, final Object... values) {
|
||||
|
@ -49,7 +49,7 @@ public class SAStrutsUtil {
|
|||
}
|
||||
|
||||
public static void addSessionMessage(final String key) {
|
||||
addSessionMessage(RequestUtil.getRequest(), key);
|
||||
addSessionMessage(LaRequestUtil.getRequest(), key);
|
||||
}
|
||||
|
||||
public static void addSessionMessage(final HttpServletRequest request, final String key) {
|
||||
|
@ -59,7 +59,7 @@ public class SAStrutsUtil {
|
|||
}
|
||||
|
||||
public static void addSessionMessage(final String key, final Object... values) {
|
||||
addSessionMessage(RequestUtil.getRequest(), key, values);
|
||||
addSessionMessage(LaRequestUtil.getRequest(), key, values);
|
||||
}
|
||||
|
||||
public static void addSessionMessage(final HttpServletRequest request, final String key, final Object... values) {
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
|
||||
package org.codelibs.fess.dict;
|
||||
|
||||
import org.seasar.struts.exception.ActionMessagesException;
|
||||
|
||||
public class DictionaryExpiredException extends ActionMessagesException {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
@ -23,12 +23,13 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.seasar.extension.timer.TimeoutManager;
|
||||
import org.seasar.extension.timer.TimeoutTarget;
|
||||
import org.seasar.extension.timer.TimeoutTask;
|
||||
import org.seasar.framework.container.annotation.tiger.DestroyMethod;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
import org.lastaflute.di.helper.timer.TimeoutManager;
|
||||
import org.lastaflute.di.helper.timer.TimeoutTarget;
|
||||
import org.lastaflute.di.helper.timer.TimeoutTask;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -47,14 +48,14 @@ public class DictionaryManager {
|
|||
|
||||
protected List<DictionaryLocator> locatorList = new ArrayList<DictionaryLocator>();
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
// start
|
||||
final WatcherTarget watcherTarget = new WatcherTarget();
|
||||
watcherTargetTask = TimeoutManager.getInstance().addTimeoutTarget(watcherTarget, watcherTimeout, true);
|
||||
}
|
||||
|
||||
@DestroyMethod
|
||||
@PreDestroy
|
||||
public void destroy() {
|
||||
if (watcherTargetTask != null && !watcherTargetTask.isStopped()) {
|
||||
watcherTargetTask.stop();
|
||||
|
|
|
@ -33,11 +33,11 @@ import java.util.List;
|
|||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.codelibs.core.io.CopyUtil;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.dict.DictionaryException;
|
||||
import org.codelibs.fess.dict.DictionaryFile;
|
||||
import org.codelibs.robot.util.StreamUtil;
|
||||
|
||||
public class SynonymFile extends DictionaryFile<SynonymItem> {
|
||||
private static final String SYNONYM = "synonym";
|
||||
|
@ -373,7 +373,7 @@ public class SynonymFile extends DictionaryFile<SynonymItem> {
|
|||
}
|
||||
|
||||
public void update(final InputStream in) throws IOException {
|
||||
StreamUtil.drain(in, file);
|
||||
CopyUtil.copy(in, file);
|
||||
reload(null);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,12 +33,12 @@ import java.util.List;
|
|||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.codelibs.core.io.CopyUtil;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.dict.DictionaryException;
|
||||
import org.codelibs.fess.dict.DictionaryFile;
|
||||
import org.codelibs.fess.util.UserDictCSVUtil;
|
||||
import org.codelibs.robot.util.StreamUtil;
|
||||
|
||||
public class UserDictFile extends DictionaryFile<UserDictItem> {
|
||||
private static final String USERDICT = "userDict";
|
||||
|
@ -302,7 +302,7 @@ public class UserDictFile extends DictionaryFile<UserDictItem> {
|
|||
}
|
||||
|
||||
public void update(final InputStream in) throws IOException {
|
||||
StreamUtil.drain(in, file);
|
||||
CopyUtil.copy(in, file);
|
||||
reload(null);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.ds;
|
||||
|
||||
import org.codelibs.robot.RobotCrawlAccessException;
|
||||
import org.codelibs.robot.exception.RobotCrawlAccessException;
|
||||
|
||||
public class DataStoreCrawlingException extends RobotCrawlAccessException {
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@ import org.codelibs.fess.es.exentity.DataConfig;
|
|||
import org.codelibs.fess.helper.CrawlingSessionHelper;
|
||||
import org.codelibs.fess.helper.FieldHelper;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.seasar.framework.util.OgnlUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -36,14 +36,14 @@ import org.codelibs.fess.ds.DataStoreException;
|
|||
import org.codelibs.fess.ds.IndexUpdateCallback;
|
||||
import org.codelibs.fess.es.exentity.DataConfig;
|
||||
import org.codelibs.fess.service.FailureUrlService;
|
||||
import org.codelibs.robot.RobotCrawlAccessException;
|
||||
import org.codelibs.robot.RobotMultipleCrawlAccessException;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.codelibs.robot.exception.RobotCrawlAccessException;
|
||||
import org.codelibs.robot.exception.RobotMultipleCrawlAccessException;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import jp.sf.orangesignal.csv.CsvConfig;
|
||||
import jp.sf.orangesignal.csv.CsvReader;
|
||||
import com.orangesignal.csv.CsvConfig;
|
||||
import com.orangesignal.csv.CsvReader;
|
||||
|
||||
public class CsvDataStoreImpl extends AbstractDataStoreImpl {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CsvDataStoreImpl.class);
|
||||
|
@ -254,13 +254,13 @@ public class CsvDataStoreImpl extends AbstractDataStoreImpl {
|
|||
url = csvFile.getAbsolutePath() + ":" + csvReader.getLineNumber();
|
||||
|
||||
}
|
||||
final FailureUrlService failureUrlService = SingletonS2Container.getComponent(FailureUrlService.class);
|
||||
final FailureUrlService failureUrlService = SingletonLaContainer.getComponent(FailureUrlService.class);
|
||||
failureUrlService.store(dataConfig, errorName, url, target);
|
||||
|
||||
logger.warn("Crawling Access Exception at : " + dataMap, e);
|
||||
} catch (final Exception e) {
|
||||
final String url = csvFile.getAbsolutePath() + ":" + csvReader.getLineNumber();
|
||||
final FailureUrlService failureUrlService = SingletonS2Container.getComponent(FailureUrlService.class);
|
||||
final FailureUrlService failureUrlService = SingletonLaContainer.getComponent(FailureUrlService.class);
|
||||
failureUrlService.store(dataConfig, e.getClass().getCanonicalName(), url, e);
|
||||
|
||||
logger.warn("Crawling Access Exception at : " + dataMap, e);
|
||||
|
|
|
@ -22,6 +22,8 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.codelibs.core.collection.LruHashMap;
|
||||
import org.codelibs.core.io.SerializeUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.client.FessEsClient;
|
||||
import org.codelibs.fess.ds.DataStoreCrawlingException;
|
||||
|
@ -32,24 +34,22 @@ import org.codelibs.fess.helper.CrawlingSessionHelper;
|
|||
import org.codelibs.fess.helper.FieldHelper;
|
||||
import org.codelibs.fess.helper.IndexingHelper;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.robot.RobotSystemException;
|
||||
import org.codelibs.robot.builder.RequestDataBuilder;
|
||||
import org.codelibs.robot.client.S2RobotClient;
|
||||
import org.codelibs.robot.client.S2RobotClientFactory;
|
||||
import org.codelibs.robot.entity.ResponseData;
|
||||
import org.codelibs.robot.entity.ResultData;
|
||||
import org.codelibs.robot.exception.RobotSystemException;
|
||||
import org.codelibs.robot.processor.ResponseProcessor;
|
||||
import org.codelibs.robot.processor.impl.DefaultResponseProcessor;
|
||||
import org.codelibs.robot.rule.Rule;
|
||||
import org.codelibs.robot.rule.RuleManager;
|
||||
import org.codelibs.robot.transformer.Transformer;
|
||||
import org.codelibs.robot.util.LruHashMap;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.seasar.framework.util.SerializeUtil;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import jp.sf.orangesignal.csv.CsvConfig;
|
||||
import com.orangesignal.csv.CsvConfig;
|
||||
|
||||
public class FileListDataStoreImpl extends CsvDataStoreImpl {
|
||||
|
||||
|
@ -75,7 +75,7 @@ public class FileListDataStoreImpl extends CsvDataStoreImpl {
|
|||
|
||||
protected CrawlingSessionHelper crawlingSessionHelper;
|
||||
|
||||
public Map<String, String> parentEncodingMap = Collections.synchronizedMap(new LruHashMap<String, String>(1000));
|
||||
public Map<String, String> parentEncodingMap = Collections.synchronizedMap(new LruHashMap<>(1000));
|
||||
|
||||
public String[] ignoreFieldNames = new String[] { Constants.INDEXING_TARGET, Constants.SESSION_ID };
|
||||
|
||||
|
@ -92,7 +92,7 @@ public class FileListDataStoreImpl extends CsvDataStoreImpl {
|
|||
@Override
|
||||
public void store(final DataConfig config, final IndexUpdateCallback callback, final Map<String, String> initParamMap) {
|
||||
|
||||
robotClientFactory = SingletonS2Container.getComponent(S2RobotClientFactory.class);
|
||||
robotClientFactory = SingletonLaContainer.getComponent(S2RobotClientFactory.class);
|
||||
|
||||
config.initializeClientFactory(robotClientFactory);
|
||||
|
||||
|
@ -181,7 +181,7 @@ public class FileListDataStoreImpl extends CsvDataStoreImpl {
|
|||
responseData.setExecutionTime(System.currentTimeMillis() - startTime);
|
||||
responseData.setSessionId((String) dataMap.get(Constants.SESSION_ID));
|
||||
|
||||
final RuleManager ruleManager = SingletonS2Container.getComponent(RuleManager.class);
|
||||
final RuleManager ruleManager = SingletonLaContainer.getComponent(RuleManager.class);
|
||||
final Rule rule = ruleManager.getRule(responseData);
|
||||
if (rule == null) {
|
||||
logger.warn("No url rule. Data: " + dataMap);
|
||||
|
|
|
@ -21,6 +21,8 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.codelibs.fess.FessSystemException;
|
||||
import org.codelibs.fess.client.FessEsClient;
|
||||
import org.codelibs.fess.ds.IndexUpdateCallback;
|
||||
|
@ -30,7 +32,6 @@ import org.codelibs.fess.helper.IndexingHelper;
|
|||
import org.codelibs.fess.helper.SearchLogHelper;
|
||||
import org.codelibs.fess.helper.SystemHelper;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -53,7 +54,7 @@ public class IndexUpdateCallbackImpl implements IndexUpdateCallback {
|
|||
|
||||
private FieldHelper fieldHelper;
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
fieldHelper = ComponentUtil.getFieldHelper();
|
||||
}
|
||||
|
|
|
@ -18,9 +18,6 @@ package org.codelibs.fess.entity;
|
|||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.seasar.struts.annotation.IntegerType;
|
||||
import org.seasar.struts.annotation.Maxbytelength;
|
||||
|
||||
public class FacetInfo {
|
||||
@Maxbytelength(maxbytelength = 255)
|
||||
public String[] field;
|
||||
|
|
|
@ -20,8 +20,6 @@ import org.codelibs.core.lang.StringUtil;
|
|||
import org.elasticsearch.common.unit.DistanceUnit;
|
||||
import org.elasticsearch.index.query.FilterBuilder;
|
||||
import org.elasticsearch.index.query.FilterBuilders;
|
||||
import org.seasar.struts.annotation.Mask;
|
||||
import org.seasar.struts.annotation.Maxbytelength;
|
||||
|
||||
public class GeoInfo {
|
||||
@Mask(mask = "-?([0-9]+|[0-9]+\\.[0-9]+)")
|
||||
|
|
|
@ -163,6 +163,17 @@ public abstract class AbstractEntity implements Entity, Serializable, Cloneable
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void myunlockUndefinedClassificationAccess() {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean myundefinedClassificationAccessAllowed() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract Map<String, Object> toSource();
|
||||
|
||||
public class DocMeta {
|
||||
|
|
|
@ -572,6 +572,28 @@ public abstract class AbstractConditionBean implements ConditionBean {
|
|||
// do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasSpecifiedLocalColumn() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableUndefinedClassificationSelect() {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableUndefinedClassificationSelect() {
|
||||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUndefinedClassificationSelectAllowed() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
public SearchRequestParams request() {
|
||||
return _searchRequestParams;
|
||||
}
|
||||
|
|
|
@ -6,8 +6,7 @@ import org.codelibs.fess.es.bsentity.BsCrawlingSessionInfo;
|
|||
import org.codelibs.fess.es.exbhv.CrawlingSessionBhv;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.dbflute.optional.OptionalEntity;
|
||||
import org.seasar.struts.util.MessageResourcesUtil;
|
||||
import org.seasar.struts.util.RequestUtil;
|
||||
import org.lastaflute.web.util.LaRequestUtil;
|
||||
|
||||
/**
|
||||
* @author FreeGen
|
||||
|
@ -47,7 +46,7 @@ public class CrawlingSessionInfo extends BsCrawlingSessionInfo {
|
|||
}
|
||||
|
||||
public String getKeyMsg() {
|
||||
final Locale locale = RequestUtil.getRequest().getLocale();
|
||||
final Locale locale = LaRequestUtil.getRequest().getLocale();
|
||||
final String message = MessageResourcesUtil.getMessage(locale, "labels.crawling_session_" + getKey());
|
||||
if (message == null || message.startsWith("???")) {
|
||||
return getKey();
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.codelibs.robot.client.S2RobotClientFactory;
|
|||
import org.codelibs.robot.client.smb.SmbAuthentication;
|
||||
import org.codelibs.robot.client.smb.SmbClient;
|
||||
import org.dbflute.cbean.result.ListResultBean;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
|
||||
/**
|
||||
* @author FreeGen
|
||||
|
@ -229,7 +229,7 @@ public class FileConfig extends BsFileConfig implements CrawlingConfig {
|
|||
|
||||
@Override
|
||||
public void initializeClientFactory(final S2RobotClientFactory clientFactory) {
|
||||
final FileAuthenticationService fileAuthenticationService = SingletonS2Container.getComponent(FileAuthenticationService.class);
|
||||
final FileAuthenticationService fileAuthenticationService = SingletonLaContainer.getComponent(FileAuthenticationService.class);
|
||||
|
||||
// Parameters
|
||||
final Map<String, Object> paramMap = new HashMap<String, Object>();
|
||||
|
|
|
@ -16,10 +16,10 @@ import org.codelibs.fess.es.bsentity.BsWebAuthentication;
|
|||
import org.codelibs.fess.service.WebConfigService;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.ParameterUtil;
|
||||
import org.codelibs.robot.RobotSystemException;
|
||||
import org.codelibs.robot.client.http.Authentication;
|
||||
import org.codelibs.robot.client.http.impl.AuthenticationImpl;
|
||||
import org.codelibs.robot.client.http.ntlm.JcifsEngine;
|
||||
import org.codelibs.robot.exception.RobotSystemException;
|
||||
|
||||
/**
|
||||
* @author FreeGen
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.codelibs.robot.client.S2RobotClientFactory;
|
|||
import org.codelibs.robot.client.http.Authentication;
|
||||
import org.codelibs.robot.client.http.HcHttpClient;
|
||||
import org.dbflute.cbean.result.ListResultBean;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
|
||||
/**
|
||||
* @author FreeGen
|
||||
|
@ -233,8 +233,8 @@ public class WebConfig extends BsWebConfig implements CrawlingConfig {
|
|||
|
||||
@Override
|
||||
public void initializeClientFactory(final S2RobotClientFactory clientFactory) {
|
||||
final WebAuthenticationService webAuthenticationService = SingletonS2Container.getComponent(WebAuthenticationService.class);
|
||||
final RequestHeaderService requestHeaderService = SingletonS2Container.getComponent(RequestHeaderService.class);
|
||||
final WebAuthenticationService webAuthenticationService = SingletonLaContainer.getComponent(WebAuthenticationService.class);
|
||||
final RequestHeaderService requestHeaderService = SingletonLaContainer.getComponent(RequestHeaderService.class);
|
||||
|
||||
// HttpClient Parameters
|
||||
final Map<String, Object> paramMap = new HashMap<String, Object>();
|
||||
|
|
|
@ -56,16 +56,8 @@ import org.elasticsearch.index.query.QueryBuilders;
|
|||
import org.kohsuke.args4j.CmdLineException;
|
||||
import org.kohsuke.args4j.CmdLineParser;
|
||||
import org.kohsuke.args4j.Option;
|
||||
import org.seasar.framework.container.ExternalContext;
|
||||
import org.seasar.framework.container.S2Container;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.seasar.framework.container.annotation.tiger.Binding;
|
||||
import org.seasar.framework.container.annotation.tiger.BindingType;
|
||||
import org.seasar.framework.container.factory.SingletonS2ContainerFactory;
|
||||
import org.seasar.framework.container.servlet.SingletonS2ContainerInitializer;
|
||||
import org.seasar.framework.mock.servlet.MockHttpServletRequestImpl;
|
||||
import org.seasar.framework.mock.servlet.MockHttpServletResponseImpl;
|
||||
import org.seasar.framework.mock.servlet.MockServletContextImpl;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
import org.lastaflute.di.core.factory.SingletonLaContainerFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -74,6 +66,8 @@ import com.github.jknack.handlebars.Handlebars;
|
|||
import com.github.jknack.handlebars.Template;
|
||||
import com.github.jknack.handlebars.io.FileTemplateLoader;
|
||||
|
||||
import net.arnx.jsonic.web.extension.S2Container;
|
||||
|
||||
public class Crawler implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -89,7 +83,6 @@ public class Crawler implements Serializable {
|
|||
@Resource
|
||||
protected FessEsClient fessEsClient;
|
||||
|
||||
@Binding(bindingType = BindingType.MAY)
|
||||
@Resource
|
||||
protected ScreenShotManager screenShotManager;
|
||||
|
||||
|
@ -193,12 +186,12 @@ public class Crawler implements Serializable {
|
|||
final ServletContext servletContext = new MockServletContextImpl("/fess");
|
||||
final HttpServletRequest request = new MockHttpServletRequestImpl(servletContext, "/crawler");
|
||||
final HttpServletResponse response = new MockHttpServletResponseImpl(request);
|
||||
final SingletonS2ContainerInitializer initializer = new SingletonS2ContainerInitializer();
|
||||
final SingletonLaContainerInitializer initializer = new SingletonLaContainerInitializer();
|
||||
initializer.setConfigPath("app.dicon");
|
||||
initializer.setApplication(servletContext);
|
||||
initializer.initialize();
|
||||
|
||||
final S2Container container = SingletonS2ContainerFactory.getContainer();
|
||||
final S2Container container = SingletonLaContainerFactory.getContainer();
|
||||
final ExternalContext externalContext = container.getExternalContext();
|
||||
externalContext.setRequest(request);
|
||||
externalContext.setResponse(response);
|
||||
|
@ -209,7 +202,7 @@ public class Crawler implements Serializable {
|
|||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Destroying S2Container..");
|
||||
}
|
||||
SingletonS2ContainerFactory.destroy();
|
||||
SingletonLaContainerFactory.destroy();
|
||||
}
|
||||
};
|
||||
Runtime.getRuntime().addShutdownHook(shutdownCallback);
|
||||
|
@ -219,7 +212,7 @@ public class Crawler implements Serializable {
|
|||
logger.error("Crawler does not work correctly.", t);
|
||||
exitCode = Constants.EXIT_FAIL;
|
||||
} finally {
|
||||
SingletonS2ContainerFactory.destroy();
|
||||
SingletonLaContainerFactory.destroy();
|
||||
}
|
||||
|
||||
if (exitCode != Constants.EXIT_OK) {
|
||||
|
@ -228,7 +221,7 @@ public class Crawler implements Serializable {
|
|||
}
|
||||
|
||||
private static int process(final Options options) {
|
||||
final Crawler crawler = SingletonS2Container.getComponent(Crawler.class);
|
||||
final Crawler crawler = SingletonLaContainer.getComponent(Crawler.class);
|
||||
|
||||
final DatabaseHelper databaseHelper = ComponentUtil.getDatabaseHelper();
|
||||
databaseHelper.optimize();
|
||||
|
|
|
@ -31,11 +31,11 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.entity.LoginInfo;
|
||||
import org.codelibs.fess.helper.AdRoleHelper;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.sastruts.core.SSCConstants;
|
||||
import org.seasar.framework.util.StringUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -36,7 +36,6 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import org.apache.commons.codec.DecoderException;
|
||||
import org.apache.commons.codec.net.URLCodec;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.seasar.extension.filter.EncodingFilter;
|
||||
|
||||
public class FessEncodingFilter extends EncodingFilter {
|
||||
public static String ENCODING_MAP = "encodingRules";
|
||||
|
|
|
@ -30,6 +30,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.codelibs.core.io.CopyUtil;
|
||||
import org.codelibs.core.misc.Base64Util;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.FessSystemException;
|
||||
import org.codelibs.fess.es.exentity.CrawlingConfig;
|
||||
|
@ -43,10 +45,8 @@ import org.codelibs.robot.builder.RequestDataBuilder;
|
|||
import org.codelibs.robot.client.S2RobotClient;
|
||||
import org.codelibs.robot.client.S2RobotClientFactory;
|
||||
import org.codelibs.robot.entity.ResponseData;
|
||||
import org.codelibs.robot.util.StreamUtil;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.seasar.framework.util.Base64Util;
|
||||
import org.seasar.struts.util.ResponseUtil;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
import org.lastaflute.web.util.LaResponseUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -93,13 +93,13 @@ public class CrawlingConfigHelper implements Serializable {
|
|||
}
|
||||
switch (configType) {
|
||||
case WEB:
|
||||
final WebConfigService webConfigService = SingletonS2Container.getComponent(WebConfigService.class);
|
||||
final WebConfigService webConfigService = SingletonLaContainer.getComponent(WebConfigService.class);
|
||||
return webConfigService.getWebConfig(id);
|
||||
case FILE:
|
||||
final FileConfigService fileConfigService = SingletonS2Container.getComponent(FileConfigService.class);
|
||||
final FileConfigService fileConfigService = SingletonLaContainer.getComponent(FileConfigService.class);
|
||||
return fileConfigService.getFileConfig(id);
|
||||
case DATA:
|
||||
final DataConfigService dataConfigService = SingletonS2Container.getComponent(DataConfigService.class);
|
||||
final DataConfigService dataConfigService = SingletonLaContainer.getComponent(DataConfigService.class);
|
||||
return dataConfigService.getDataConfig(id);
|
||||
default:
|
||||
return null;
|
||||
|
@ -140,27 +140,27 @@ public class CrawlingConfigHelper implements Serializable {
|
|||
logger.debug("configType: " + configType + ", configId: " + configId);
|
||||
}
|
||||
if (ConfigType.WEB == configType) {
|
||||
final WebConfigService webConfigService = SingletonS2Container.getComponent(WebConfigService.class);
|
||||
final WebConfigService webConfigService = SingletonLaContainer.getComponent(WebConfigService.class);
|
||||
config = webConfigService.getWebConfig(getId(configId));
|
||||
} else if (ConfigType.FILE == configType) {
|
||||
final FileConfigService fileConfigService = SingletonS2Container.getComponent(FileConfigService.class);
|
||||
final FileConfigService fileConfigService = SingletonLaContainer.getComponent(FileConfigService.class);
|
||||
config = fileConfigService.getFileConfig(getId(configId));
|
||||
} else if (ConfigType.DATA == configType) {
|
||||
final DataConfigService dataConfigService = SingletonS2Container.getComponent(DataConfigService.class);
|
||||
final DataConfigService dataConfigService = SingletonLaContainer.getComponent(DataConfigService.class);
|
||||
config = dataConfigService.getDataConfig(getId(configId));
|
||||
}
|
||||
if (config == null) {
|
||||
throw new FessSystemException("No crawlingConfig: " + configIdObj);
|
||||
}
|
||||
final String url = (String) doc.get(fieldHelper.urlField);
|
||||
final S2RobotClientFactory robotClientFactory = SingletonS2Container.getComponent(S2RobotClientFactory.class);
|
||||
final S2RobotClientFactory robotClientFactory = SingletonLaContainer.getComponent(S2RobotClientFactory.class);
|
||||
config.initializeClientFactory(robotClientFactory);
|
||||
final S2RobotClient client = robotClientFactory.getClient(url);
|
||||
if (client == null) {
|
||||
throw new FessSystemException("No S2RobotClient: " + configIdObj + ", url: " + url);
|
||||
}
|
||||
final ResponseData responseData = client.execute(RequestDataBuilder.newRequestData().get().url(url).build());
|
||||
final HttpServletResponse response = ResponseUtil.getResponse();
|
||||
final HttpServletResponse response = LaResponseUtil.getResponse();
|
||||
writeFileName(response, responseData);
|
||||
writeContentType(response, responseData);
|
||||
writeNoCache(response, responseData);
|
||||
|
@ -169,7 +169,7 @@ public class CrawlingConfigHelper implements Serializable {
|
|||
try {
|
||||
is = new BufferedInputStream(responseData.getResponseBody());
|
||||
os = new BufferedOutputStream(response.getOutputStream());
|
||||
StreamUtil.drain(is, os);
|
||||
CopyUtil.copy(is, os);
|
||||
os.flush();
|
||||
} catch (final IOException e) {
|
||||
if (!"ClientAbortException".equals(e.getClass().getSimpleName())) {
|
||||
|
|
|
@ -38,7 +38,7 @@ import org.elasticsearch.search.aggregations.bucket.terms.Terms;
|
|||
import org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket;
|
||||
import org.elasticsearch.search.aggregations.bucket.terms.Terms.Order;
|
||||
import org.elasticsearch.search.aggregations.bucket.terms.TermsBuilder;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -56,7 +56,7 @@ public class CrawlingSessionHelper implements Serializable {
|
|||
private final int maxSessionIdsInList = 100;
|
||||
|
||||
protected CrawlingSessionService getCrawlingSessionService() {
|
||||
return SingletonS2Container.getComponent(CrawlingSessionService.class);
|
||||
return SingletonLaContainer.getComponent(CrawlingSessionService.class);
|
||||
}
|
||||
|
||||
public String getCanonicalSessionId(final String sessionId) {
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.codelibs.fess.service.DataConfigService;
|
|||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
import org.elasticsearch.index.query.QueryBuilders;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -102,7 +102,7 @@ public class DataIndexHelper implements Serializable {
|
|||
|
||||
final long startTime = System.currentTimeMillis();
|
||||
|
||||
final IndexUpdateCallback indexUpdateCallback = SingletonS2Container.getComponent(IndexUpdateCallback.class);
|
||||
final IndexUpdateCallback indexUpdateCallback = SingletonLaContainer.getComponent(IndexUpdateCallback.class);
|
||||
|
||||
final List<String> sessionIdList = new ArrayList<String>();
|
||||
final Map<String, String> initParamMap = new HashMap<String, String>();
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package org.codelibs.fess.helper;
|
||||
|
||||
public interface DatabaseHelper {
|
||||
|
||||
void optimize();
|
||||
|
||||
}
|
|
@ -22,12 +22,12 @@ import java.util.Map;
|
|||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.es.exbhv.SearchLogBhv;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
|
||||
public class HotSearchWordHelper {
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class HotSearchWordHelper {
|
|||
|
||||
public Pattern excludedWordPattern;
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
final long now = ComponentUtil.getSystemHelper().getCurrentTimeAsLong();
|
||||
cacheMap.put(Range.ONE_DAY, getHotSearchWordListByFromDate(now - Constants.ONE_DAY_IN_MILLIS));
|
||||
|
|
|
@ -22,12 +22,13 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.codelibs.fess.FessSystemException;
|
||||
import org.codelibs.fess.job.JobExecutor;
|
||||
import org.codelibs.fess.util.InputStreamThread;
|
||||
import org.codelibs.fess.util.JobProcess;
|
||||
import org.seasar.framework.container.annotation.tiger.DestroyMethod;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -38,7 +39,7 @@ public class JobHelper {
|
|||
|
||||
private final ConcurrentHashMap<String, JobExecutor> runningJobExecutorMap = new ConcurrentHashMap<>();
|
||||
|
||||
@DestroyMethod
|
||||
@PreDestroy
|
||||
public void destroy() {
|
||||
for (final String sessionId : runningProcessMap.keySet()) {
|
||||
destroyCrawlerProcess(sessionId);
|
||||
|
|
|
@ -22,14 +22,15 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.client.FessEsClient;
|
||||
import org.codelibs.fess.client.FessEsClient.SearchConditionBuilder;
|
||||
import org.codelibs.fess.es.exentity.KeyMatch;
|
||||
import org.codelibs.fess.service.KeyMatchService;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
|
||||
public class KeyMatchHelper {
|
||||
protected volatile Map<String, String[]> keyMatchQueryMap = Collections.emptyMap();
|
||||
|
@ -38,7 +39,7 @@ public class KeyMatchHelper {
|
|||
|
||||
protected long reloadInterval = 1000L;
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
reload(0);
|
||||
}
|
||||
|
@ -49,7 +50,7 @@ public class KeyMatchHelper {
|
|||
|
||||
protected void reload(final long interval) {
|
||||
final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
final KeyMatchService keyMatchService = SingletonS2Container.getComponent(KeyMatchService.class);
|
||||
final KeyMatchService keyMatchService = SingletonLaContainer.getComponent(KeyMatchService.class);
|
||||
final List<KeyMatch> list = keyMatchService.getAvailableKeyMatchList();
|
||||
final Map<String, String[]> keyMatchQueryMap = new HashMap<String, String[]>(list.size());
|
||||
for (final KeyMatch keyMatch : list) {
|
||||
|
|
|
@ -26,14 +26,14 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.es.exentity.LabelType;
|
||||
import org.codelibs.fess.service.LabelTypeService;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -50,10 +50,10 @@ public class LabelTypeHelper implements Serializable {
|
|||
protected volatile List<LabelTypePattern> labelTypePatternList;
|
||||
|
||||
protected LabelTypeService getLabelTypeService() {
|
||||
return SingletonS2Container.getComponent(LabelTypeService.class);
|
||||
return SingletonLaContainer.getComponent(LabelTypeService.class);
|
||||
}
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
final List<LabelType> labelTypeList = getLabelTypeService().getLabelTypeListWithRoles();
|
||||
buildLabelTypeItems(labelTypeList);
|
||||
|
|
|
@ -19,16 +19,16 @@ package org.codelibs.fess.helper;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.codelibs.core.io.FileUtil;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.FessSystemException;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
import org.seasar.framework.util.FileUtil;
|
||||
import org.seasar.struts.util.ServletContextUtil;
|
||||
import org.lastaflute.web.util.LaServletContextUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -50,10 +50,10 @@ public class OpenSearchHelper {
|
|||
|
||||
private File osddFile;
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
if (StringUtil.isNotBlank(osddPath)) {
|
||||
final String path = ServletContextUtil.getServletContext().getRealPath(osddPath);
|
||||
final String path = LaServletContextUtil.getServletContext().getRealPath(osddPath);
|
||||
osddFile = new File(path);
|
||||
if (!osddFile.isFile()) {
|
||||
osddFile = null;
|
||||
|
@ -77,7 +77,7 @@ public class OpenSearchHelper {
|
|||
ServletOutputStream os = null;
|
||||
try {
|
||||
os = response.getOutputStream();
|
||||
os.write(FileUtil.getBytes(osddFile));
|
||||
os.write(FileUtil.readBytes(osddFile));
|
||||
} catch (final IOException e) {
|
||||
throw new FessSystemException("Failed to write OpenSearch response.", e);
|
||||
} finally {
|
||||
|
|
|
@ -20,10 +20,11 @@ import java.io.Serializable;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.codelibs.fess.es.exentity.OverlappingHost;
|
||||
import org.codelibs.fess.service.OverlappingHostService;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
|
||||
public class OverlappingHostHelper implements Serializable {
|
||||
|
||||
|
@ -31,12 +32,12 @@ public class OverlappingHostHelper implements Serializable {
|
|||
|
||||
private List<OverlappingHost> overlappingHostList;
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
if (overlappingHostList == null) {
|
||||
overlappingHostList = new ArrayList<OverlappingHost>();
|
||||
}
|
||||
final OverlappingHostService overlappingHostService = SingletonS2Container.getComponent(OverlappingHostService.class);
|
||||
final OverlappingHostService overlappingHostService = SingletonLaContainer.getComponent(OverlappingHostService.class);
|
||||
overlappingHostList.addAll(overlappingHostService.getOverlappingHostList());
|
||||
}
|
||||
|
||||
|
|
|
@ -23,11 +23,12 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.es.exbhv.PathMappingBhv;
|
||||
import org.codelibs.fess.es.exentity.PathMapping;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -41,14 +42,14 @@ public class PathMappingHelper implements Serializable {
|
|||
|
||||
volatile List<PathMapping> cachedPathMappingList = null;
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
final List<String> ptList = new ArrayList<>();
|
||||
ptList.add(Constants.PROCESS_TYPE_DISPLAYING);
|
||||
ptList.add(Constants.PROCESS_TYPE_BOTH);
|
||||
|
||||
try {
|
||||
final PathMappingBhv pathMappingBhv = SingletonS2Container.getComponent(PathMappingBhv.class);
|
||||
final PathMappingBhv pathMappingBhv = SingletonLaContainer.getComponent(PathMappingBhv.class);
|
||||
cachedPathMappingList = pathMappingBhv.selectList(cb -> {
|
||||
cb.query().addOrderBy_SortOrder_Asc();
|
||||
cb.query().setProcessType_InScope(ptList);
|
||||
|
|
|
@ -42,10 +42,11 @@ import java.util.Map;
|
|||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.InvalidQueryException;
|
||||
|
@ -55,10 +56,7 @@ import org.codelibs.fess.entity.SearchQuery;
|
|||
import org.codelibs.fess.entity.SearchQuery.SortField;
|
||||
import org.codelibs.fess.util.QueryUtil;
|
||||
import org.codelibs.fess.util.SearchParamMap;
|
||||
import org.seasar.framework.container.annotation.tiger.Binding;
|
||||
import org.seasar.framework.container.annotation.tiger.BindingType;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
import org.seasar.struts.util.RequestUtil;
|
||||
import org.lastaflute.web.util.LaRequestUtil;
|
||||
|
||||
public class QueryHelper implements Serializable {
|
||||
|
||||
|
@ -84,7 +82,6 @@ public class QueryHelper implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Binding(bindingType = BindingType.MAY)
|
||||
@Resource
|
||||
protected RoleQueryHelper roleQueryHelper;
|
||||
|
||||
|
@ -94,7 +91,6 @@ public class QueryHelper implements Serializable {
|
|||
@Resource
|
||||
protected FieldHelper fieldHelper;
|
||||
|
||||
@Binding(bindingType = BindingType.MAY)
|
||||
@Resource
|
||||
protected KeyMatchHelper keyMatchHelper;
|
||||
|
||||
|
@ -156,7 +152,7 @@ public class QueryHelper implements Serializable {
|
|||
|
||||
protected Map<String, String> fieldBoostMap = new HashMap<String, String>();
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
if (responseFields == null) {
|
||||
responseFields =
|
||||
|
@ -312,7 +308,7 @@ public class QueryHelper implements Serializable {
|
|||
searchQuery.addSortField(entry.getKey(), entry.getValue());
|
||||
}
|
||||
// set queries to request for HighLight
|
||||
final HttpServletRequest request = RequestUtil.getRequest();
|
||||
final HttpServletRequest request = LaRequestUtil.getRequest();
|
||||
if (request != null) {
|
||||
request.setAttribute(Constants.HIGHLIGHT_QUERIES, highLightQueryList.toArray(new String[highLightQueryList.size()]));
|
||||
request.setAttribute(Constants.FIELD_LOGS, fieldLogMap);
|
||||
|
@ -935,7 +931,7 @@ public class QueryHelper implements Serializable {
|
|||
if (defaultQueryLanguage != null) {
|
||||
return defaultQueryLanguage;
|
||||
}
|
||||
final HttpServletRequest request = RequestUtil.getRequest();
|
||||
final HttpServletRequest request = LaRequestUtil.getRequest();
|
||||
if (request == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -1396,7 +1392,7 @@ public class QueryHelper implements Serializable {
|
|||
return additionalQueryParamMap;
|
||||
}
|
||||
|
||||
final HttpServletRequest request = RequestUtil.getRequest();
|
||||
final HttpServletRequest request = LaRequestUtil.getRequest();
|
||||
final Map<String, String[]> queryParamMap = new HashMap<String, String[]>();
|
||||
for (final Map.Entry<String, String[]> entry : additionalQueryParamMap.entrySet()) {
|
||||
final String[] values = entry.getValue();
|
||||
|
@ -1434,7 +1430,7 @@ public class QueryHelper implements Serializable {
|
|||
}
|
||||
|
||||
protected String getDefaultOperator() {
|
||||
final HttpServletRequest request = RequestUtil.getRequest();
|
||||
final HttpServletRequest request = LaRequestUtil.getRequest();
|
||||
if (request != null) {
|
||||
final String defaultOperator = (String) request.getAttribute(Constants.DEFAULT_OPERATOR);
|
||||
if (AND.equalsIgnoreCase(defaultOperator)) {
|
||||
|
|
|
@ -19,12 +19,12 @@ package org.codelibs.fess.helper;
|
|||
import org.codelibs.fess.es.exentity.CrawlingConfig;
|
||||
import org.codelibs.fess.service.FailureUrlService;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.robot.RobotMultipleCrawlAccessException;
|
||||
import org.codelibs.robot.S2RobotContext;
|
||||
import org.codelibs.robot.entity.UrlQueue;
|
||||
import org.codelibs.robot.exception.RobotMultipleCrawlAccessException;
|
||||
import org.codelibs.robot.helper.impl.LogHelperImpl;
|
||||
import org.codelibs.robot.log.LogType;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -80,7 +80,7 @@ public class RobotLogHelper extends LogHelperImpl {
|
|||
final CrawlingConfig crawlingConfig = getCrawlingConfig(robotContext.getSessionId());
|
||||
final String url = urlQueue.getUrl();
|
||||
|
||||
final FailureUrlService failureUrlService = SingletonS2Container.getComponent(FailureUrlService.class);
|
||||
final FailureUrlService failureUrlService = SingletonLaContainer.getComponent(FailureUrlService.class);
|
||||
failureUrlService.store(crawlingConfig, errorName, url, e);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,13 +20,13 @@ import java.util.Map;
|
|||
import java.util.Queue;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.core.collection.LruHashMap;
|
||||
import org.codelibs.core.misc.DynamicProperties;
|
||||
import org.codelibs.fess.es.exentity.ClickLog;
|
||||
import org.codelibs.fess.es.exentity.SearchLog;
|
||||
import org.codelibs.robot.util.LruHashMap;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
|
||||
public abstract class SearchLogHelper {
|
||||
|
||||
|
@ -43,7 +43,7 @@ public abstract class SearchLogHelper {
|
|||
|
||||
protected Map<String, Long> userInfoCache;
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
userInfoCache = new LruHashMap<String, Long>(userInfoCacheSize);
|
||||
}
|
||||
|
|
|
@ -33,17 +33,16 @@ import java.util.concurrent.ExecutionException;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import org.apache.commons.lang.LocaleUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.apache.commons.lang3.LocaleUtils;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.es.exentity.RoleType;
|
||||
import org.codelibs.fess.service.RoleTypeService;
|
||||
import org.codelibs.robot.util.CharUtil;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
import org.seasar.struts.util.MessageResourcesUtil;
|
||||
import org.seasar.struts.util.RequestUtil;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
import org.lastaflute.web.util.LaRequestUtil;
|
||||
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import com.google.common.cache.CacheLoader;
|
||||
|
@ -90,7 +89,7 @@ public class SystemHelper implements Serializable {
|
|||
|
||||
protected LoadingCache<String, List<Map<String, String>>> langItemsCache;
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
langItemsCache =
|
||||
CacheBuilder.newBuilder().maximumSize(20).expireAfterAccess(1, TimeUnit.HOURS)
|
||||
|
@ -120,7 +119,7 @@ public class SystemHelper implements Serializable {
|
|||
}
|
||||
|
||||
public String getUsername() {
|
||||
String username = RequestUtil.getRequest().getRemoteUser();
|
||||
String username = LaRequestUtil.getRequest().getRemoteUser();
|
||||
if (StringUtil.isBlank(username)) {
|
||||
username = "guest";
|
||||
}
|
||||
|
@ -165,7 +164,7 @@ public class SystemHelper implements Serializable {
|
|||
}
|
||||
|
||||
public String getHelpLink(final String name) {
|
||||
final Locale locale = RequestUtil.getRequest().getLocale();
|
||||
final Locale locale = LaRequestUtil.getRequest().getLocale();
|
||||
if (locale != null) {
|
||||
final String lang = locale.getLanguage();
|
||||
for (final String l : supportedHelpLangs) {
|
||||
|
@ -195,7 +194,7 @@ public class SystemHelper implements Serializable {
|
|||
}
|
||||
|
||||
public Set<String> getAuthenticatedRoleSet() {
|
||||
final RoleTypeService roleTypeService = SingletonS2Container.getComponent(RoleTypeService.class);
|
||||
final RoleTypeService roleTypeService = SingletonLaContainer.getComponent(RoleTypeService.class);
|
||||
final List<RoleType> roleTypeList = roleTypeService.getRoleTypeList();
|
||||
|
||||
final Set<String> roleList = new HashSet<>(roleTypeList.size() + adminRoleSet.size());
|
||||
|
|
|
@ -18,7 +18,7 @@ package org.codelibs.fess.helper;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.seasar.struts.util.RequestUtil;
|
||||
import org.lastaflute.web.util.LaRequestUtil;
|
||||
|
||||
public class UserAgentHelper {
|
||||
private static final String USER_AGENT = "user-agent";
|
||||
|
@ -26,7 +26,7 @@ public class UserAgentHelper {
|
|||
private static final String USER_AGENT_TYPE = "ViewHelper.UserAgent";
|
||||
|
||||
public UserAgentType getUserAgentType() {
|
||||
final HttpServletRequest request = RequestUtil.getRequest();
|
||||
final HttpServletRequest request = LaRequestUtil.getRequest();
|
||||
UserAgentType uaType = (UserAgentType) request.getAttribute(USER_AGENT_TYPE);
|
||||
if (uaType == null) {
|
||||
final String userAgent = request.getHeader(USER_AGENT);
|
||||
|
|
|
@ -31,13 +31,15 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.codelibs.core.CoreLibConstants;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.core.misc.DynamicProperties;
|
||||
import org.codelibs.core.net.URLUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.FessSystemException;
|
||||
import org.codelibs.fess.entity.FacetQueryView;
|
||||
|
@ -45,12 +47,9 @@ import org.codelibs.fess.helper.UserAgentHelper.UserAgentType;
|
|||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.ResourceUtil;
|
||||
import org.codelibs.robot.util.CharUtil;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
import org.seasar.framework.util.URLUtil;
|
||||
import org.seasar.struts.taglib.S2Functions;
|
||||
import org.seasar.struts.util.MessageResourcesUtil;
|
||||
import org.seasar.struts.util.RequestUtil;
|
||||
import org.seasar.struts.util.ServletContextUtil;
|
||||
import org.lastaflute.taglib.function.LaFunctions;
|
||||
import org.lastaflute.web.util.LaRequestUtil;
|
||||
import org.lastaflute.web.util.LaServletContextUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -113,11 +112,11 @@ public class ViewHelper implements Serializable {
|
|||
|
||||
private String escapedSolrHighlightPost = null;
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
if (useSolrHighlight) {
|
||||
escapedSolrHighlightPre = S2Functions.h(solrHighlightTagPre);
|
||||
escapedSolrHighlightPost = S2Functions.h(solrHighlightTagPost);
|
||||
escapedSolrHighlightPre = LaFunctions.h(solrHighlightTagPre);
|
||||
escapedSolrHighlightPost = LaFunctions.h(solrHighlightTagPost);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,7 +141,7 @@ public class ViewHelper implements Serializable {
|
|||
}
|
||||
|
||||
public String getContentDescription(final Map<String, Object> document) {
|
||||
final HttpServletRequest request = RequestUtil.getRequest();
|
||||
final HttpServletRequest request = LaRequestUtil.getRequest();
|
||||
final String[] queries = request == null ? StringUtil.EMPTY_STRINGS : (String[]) request.getAttribute(Constants.HIGHLIGHT_QUERIES);
|
||||
final int size = descriptionLength;
|
||||
|
||||
|
@ -152,7 +151,7 @@ public class ViewHelper implements Serializable {
|
|||
if (useSolrHighlight) {
|
||||
return escapeHighlight(text);
|
||||
} else {
|
||||
return highlight(S2Functions.h(StringUtils.abbreviate(removeSolrHighlightTag(text), size)), queries);
|
||||
return highlight(LaFunctions.h(StringUtils.abbreviate(removeSolrHighlightTag(text), size)), queries);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -161,7 +160,7 @@ public class ViewHelper implements Serializable {
|
|||
}
|
||||
|
||||
protected String escapeHighlight(final String text) {
|
||||
return S2Functions.h(text).replaceAll(escapedSolrHighlightPre, solrHighlightTagPre)
|
||||
return LaFunctions.h(text).replaceAll(escapedSolrHighlightPre, solrHighlightTagPre)
|
||||
.replaceAll(escapedSolrHighlightPost, solrHighlightTagPost);
|
||||
}
|
||||
|
||||
|
@ -297,7 +296,7 @@ public class ViewHelper implements Serializable {
|
|||
}
|
||||
|
||||
protected String appendPDFSearchWord(final String url) {
|
||||
final String[] queries = (String[]) RequestUtil.getRequest().getAttribute(Constants.HIGHLIGHT_QUERIES);
|
||||
final String[] queries = (String[]) LaRequestUtil.getRequest().getAttribute(Constants.HIGHLIGHT_QUERIES);
|
||||
if (queries != null) {
|
||||
final StringBuilder buf = new StringBuilder(url.length() + 100);
|
||||
buf.append(url).append("#search=%22");
|
||||
|
@ -314,7 +313,7 @@ public class ViewHelper implements Serializable {
|
|||
}
|
||||
|
||||
public String getPagePath(final String page) {
|
||||
final Locale locale = RequestUtil.getRequest().getLocale();
|
||||
final Locale locale = LaRequestUtil.getRequest().getLocale();
|
||||
final String lang = locale.getLanguage();
|
||||
final String country = locale.getCountry();
|
||||
|
||||
|
@ -365,7 +364,7 @@ public class ViewHelper implements Serializable {
|
|||
}
|
||||
|
||||
private boolean existsPage(final String path) {
|
||||
final String realPath = ServletContextUtil.getServletContext().getRealPath(path);
|
||||
final String realPath = LaServletContextUtil.getServletContext().getRealPath(path);
|
||||
final File file = new File(realPath);
|
||||
return file.isFile();
|
||||
}
|
||||
|
@ -375,7 +374,7 @@ public class ViewHelper implements Serializable {
|
|||
final FileTemplateLoader loader = new FileTemplateLoader(new File(ResourceUtil.getViewTemplatePath(StringUtil.EMPTY)));
|
||||
final Handlebars handlebars = new Handlebars(loader);
|
||||
|
||||
Locale locale = RequestUtil.getRequest().getLocale();
|
||||
Locale locale = LaRequestUtil.getRequest().getLocale();
|
||||
if (locale == null) {
|
||||
locale = Locale.ENGLISH;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ import org.codelibs.robot.S2RobotContext;
|
|||
import org.codelibs.robot.service.DataService;
|
||||
import org.codelibs.robot.service.UrlFilterService;
|
||||
import org.codelibs.robot.service.UrlQueueService;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -147,7 +147,7 @@ public class WebFsIndexHelper implements Serializable {
|
|||
final String sid = crawlingConfigHelper.store(sessionId, webConfig);
|
||||
|
||||
// create s2robot
|
||||
final S2Robot s2Robot = SingletonS2Container.getComponent(S2Robot.class);
|
||||
final S2Robot s2Robot = SingletonLaContainer.getComponent(S2Robot.class);
|
||||
s2Robot.setSessionId(sid);
|
||||
sessionIdList.add(sid);
|
||||
|
||||
|
@ -253,7 +253,7 @@ public class WebFsIndexHelper implements Serializable {
|
|||
final String sid = crawlingConfigHelper.store(sessionId, fileConfig);
|
||||
|
||||
// create s2robot
|
||||
final S2Robot s2Robot = SingletonS2Container.getComponent(S2Robot.class);
|
||||
final S2Robot s2Robot = SingletonLaContainer.getComponent(S2Robot.class);
|
||||
s2Robot.setSessionId(sid);
|
||||
sessionIdList.add(sid);
|
||||
|
||||
|
@ -477,15 +477,15 @@ public class WebFsIndexHelper implements Serializable {
|
|||
}
|
||||
|
||||
// clear url filter
|
||||
final UrlFilterService urlFilterService = SingletonS2Container.getComponent(UrlFilterService.class);
|
||||
final UrlFilterService urlFilterService = SingletonLaContainer.getComponent(UrlFilterService.class);
|
||||
urlFilterService.deleteAll();
|
||||
|
||||
// clear queue
|
||||
final UrlQueueService urlQueueService = SingletonS2Container.getComponent(UrlQueueService.class);
|
||||
final UrlQueueService urlQueueService = SingletonLaContainer.getComponent(UrlQueueService.class);
|
||||
urlQueueService.deleteAll();
|
||||
|
||||
// clear
|
||||
final DataService dataService = SingletonS2Container.getComponent(DataService.class);
|
||||
final DataService dataService = SingletonLaContainer.getComponent(DataService.class);
|
||||
dataService.deleteAll();
|
||||
|
||||
}
|
||||
|
|
|
@ -26,15 +26,15 @@ import javax.servlet.http.Cookie;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.codelibs.core.collection.LruHashMap;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.helper.FieldHelper;
|
||||
import org.codelibs.fess.helper.SearchLogHelper;
|
||||
import org.codelibs.fess.helper.UserInfoHelper;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.robot.util.LruHashMap;
|
||||
import org.seasar.struts.util.RequestUtil;
|
||||
import org.seasar.struts.util.ResponseUtil;
|
||||
import org.lastaflute.web.util.LaRequestUtil;
|
||||
import org.lastaflute.web.util.LaResponseUtil;
|
||||
|
||||
public class CookieUserInfoHelperImpl implements UserInfoHelper {
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class CookieUserInfoHelperImpl implements UserInfoHelper {
|
|||
*/
|
||||
@Override
|
||||
public String getUserCode() {
|
||||
final HttpServletRequest request = RequestUtil.getRequest();
|
||||
final HttpServletRequest request = LaRequestUtil.getRequest();
|
||||
|
||||
String userCode = (String) request.getAttribute(Constants.USER_CODE);
|
||||
|
||||
|
@ -87,7 +87,7 @@ public class CookieUserInfoHelperImpl implements UserInfoHelper {
|
|||
protected void updateUserSessionId(final String userCode) {
|
||||
searchLogHelper.updateUserInfo(userCode);
|
||||
|
||||
final HttpServletRequest request = RequestUtil.getRequest();
|
||||
final HttpServletRequest request = LaRequestUtil.getRequest();
|
||||
request.setAttribute(Constants.USER_CODE, userCode);
|
||||
|
||||
final Cookie cookie = new Cookie(cookieName, userCode);
|
||||
|
@ -101,7 +101,7 @@ public class CookieUserInfoHelperImpl implements UserInfoHelper {
|
|||
if (cookieSecure != null) {
|
||||
cookie.setSecure(cookieSecure);
|
||||
}
|
||||
ResponseUtil.getResponse().addCookie(cookie);
|
||||
LaResponseUtil.getResponse().addCookie(cookie);
|
||||
}
|
||||
|
||||
protected String getUserCodeFromCookie(final HttpServletRequest request) {
|
||||
|
@ -118,7 +118,7 @@ public class CookieUserInfoHelperImpl implements UserInfoHelper {
|
|||
|
||||
@Override
|
||||
public String generateQueryId(final String query, final List<Map<String, Object>> documentItems) {
|
||||
final HttpSession session = RequestUtil.getRequest().getSession(false);
|
||||
final HttpSession session = LaRequestUtil.getRequest().getSession(false);
|
||||
if (session != null) {
|
||||
final FieldHelper fieldHelper = ComponentUtil.getFieldHelper();
|
||||
|
||||
|
@ -143,7 +143,7 @@ public class CookieUserInfoHelperImpl implements UserInfoHelper {
|
|||
|
||||
@Override
|
||||
public String[] getResultDocIds(final String queryId) {
|
||||
final HttpSession session = RequestUtil.getRequest().getSession(false);
|
||||
final HttpSession session = LaRequestUtil.getRequest().getSession(false);
|
||||
if (session != null) {
|
||||
final Map<String, String[]> resultUrlCache = getResultDocIdsCache(session);
|
||||
final String[] urls = resultUrlCache.get(queryId);
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package org.codelibs.fess.helper.impl;
|
||||
|
||||
import org.codelibs.fess.helper.DatabaseHelper;
|
||||
import org.codelibs.robot.service.DataService;
|
||||
import org.codelibs.robot.service.UrlFilterService;
|
||||
import org.codelibs.robot.service.UrlQueueService;
|
||||
|
||||
public class DatabaseHelperImpl implements DatabaseHelper {
|
||||
|
||||
public DataService dataService;
|
||||
|
||||
public UrlQueueService urlQueueService;
|
||||
|
||||
public UrlFilterService urlFilterService;
|
||||
|
||||
@Override
|
||||
public void optimize() {
|
||||
urlQueueService.deleteAll();
|
||||
dataService.deleteAll();
|
||||
urlFilterService.deleteAll();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package org.codelibs.fess.helper.impl;
|
||||
|
||||
import org.codelibs.fess.helper.DatabaseHelper;
|
||||
|
||||
public class EmptyDatabaseHelperImpl implements DatabaseHelper {
|
||||
|
||||
@Override
|
||||
public void optimize() {
|
||||
// nothing
|
||||
}
|
||||
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package org.codelibs.fess.helper.impl;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.helper.DatabaseHelper;
|
||||
import org.codelibs.fess.util.ResourceUtil;
|
||||
import org.h2.tools.DeleteDbFiles;
|
||||
import org.h2.tools.RunScript;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class H2DatabaseHelperImpl implements DatabaseHelper {
|
||||
private static final Logger logger = LoggerFactory.getLogger(H2DatabaseHelperImpl.class);
|
||||
|
||||
public String databaseName = "robot";
|
||||
|
||||
public String databasePath = ResourceUtil.getDbPath(StringUtil.EMPTY);
|
||||
|
||||
public String user = "sa";
|
||||
|
||||
public String password = StringUtil.EMPTY;
|
||||
|
||||
public String sqlFilePath = ResourceUtil.getClassesPath("sql/robot.ddl");
|
||||
|
||||
public boolean printLogOnError = false;
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.codelibs.fess.helper.impl.DatabaseHelper#optimize()
|
||||
*/
|
||||
@Override
|
||||
public synchronized void optimize() {
|
||||
final String url = "jdbc:h2:" + databasePath + "/" + databaseName;
|
||||
try {
|
||||
DeleteDbFiles.execute(databasePath, databaseName, false);
|
||||
RunScript.execute(url, user, password, sqlFilePath, null, false);
|
||||
} catch (final Exception e) {
|
||||
if (printLogOnError) {
|
||||
logger.error("Failed to optimize H2 Database: " + databasePath + "/" + databaseName, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -34,7 +34,7 @@ import org.codelibs.fess.entity.LoginInfo;
|
|||
import org.codelibs.fess.helper.RoleQueryHelper;
|
||||
import org.codelibs.fess.helper.SystemHelper;
|
||||
import org.codelibs.sastruts.core.SSCConstants;
|
||||
import org.seasar.struts.util.RequestUtil;
|
||||
import org.lastaflute.web.util.LaRequestUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -82,7 +82,7 @@ public class RoleQueryHelperImpl implements RoleQueryHelper, Serializable {
|
|||
@Override
|
||||
public Set<String> build() {
|
||||
final Set<String> roleList = new HashSet<>();
|
||||
final HttpServletRequest request = RequestUtil.getRequest();
|
||||
final HttpServletRequest request = LaRequestUtil.getRequest();
|
||||
|
||||
// request parameter
|
||||
if (request != null && StringUtil.isNotBlank(parameterKey)) {
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.codelibs.fess.es.exentity.UserInfo;
|
|||
import org.codelibs.fess.helper.FieldHelper;
|
||||
import org.codelibs.fess.helper.SearchLogHelper;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -130,7 +130,7 @@ public class SearchLogHelperImpl extends SearchLogHelper {
|
|||
if (!userInfoMap.isEmpty()) {
|
||||
final List<UserInfo> insertList = new ArrayList<UserInfo>(userInfoMap.values());
|
||||
final List<UserInfo> updateList = new ArrayList<UserInfo>();
|
||||
final UserInfoBhv userInfoBhv = SingletonS2Container.getComponent(UserInfoBhv.class);
|
||||
final UserInfoBhv userInfoBhv = SingletonLaContainer.getComponent(UserInfoBhv.class);
|
||||
final List<UserInfo> list = userInfoBhv.selectList(cb -> {
|
||||
cb.query().setCode_InScope(userInfoMap.keySet());
|
||||
});
|
||||
|
@ -165,7 +165,7 @@ public class SearchLogHelperImpl extends SearchLogHelper {
|
|||
final List<ClickLog> clickLogList = new ArrayList<ClickLog>();
|
||||
for (final ClickLog clickLog : queue) {
|
||||
try {
|
||||
final SearchLogBhv searchLogBhv = SingletonS2Container.getComponent(SearchLogBhv.class);
|
||||
final SearchLogBhv searchLogBhv = SingletonLaContainer.getComponent(SearchLogBhv.class);
|
||||
final SearchLog entity = searchLogBhv.selectEntity(cb -> {
|
||||
cb.query().setRequestedTime_Equal(clickLog.getQueryRequestedTime());
|
||||
cb.query().setUserSessionId_Equal(clickLog.getUserSessionId());
|
||||
|
@ -192,7 +192,7 @@ public class SearchLogHelperImpl extends SearchLogHelper {
|
|||
}
|
||||
if (!clickLogList.isEmpty()) {
|
||||
try {
|
||||
final ClickLogBhv clickLogBhv = SingletonS2Container.getComponent(ClickLogBhv.class);
|
||||
final ClickLogBhv clickLogBhv = SingletonLaContainer.getComponent(ClickLogBhv.class);
|
||||
clickLogBhv.batchInsert(clickLogList);
|
||||
} catch (final Exception e) {
|
||||
logger.warn("Failed to insert: " + clickLogList, e);
|
||||
|
|
|
@ -30,11 +30,11 @@ import org.apache.http.auth.Credentials;
|
|||
import org.apache.http.auth.UsernamePasswordCredentials;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.codelibs.core.io.InputStreamUtil;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.FessSystemException;
|
||||
import org.codelibs.fess.helper.WebManagementHelper;
|
||||
import org.seasar.framework.util.InputStreamUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -16,9 +16,8 @@
|
|||
|
||||
package org.codelibs.fess.interceptor;
|
||||
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.codelibs.fess.UnsupportedSearchException;
|
||||
import org.seasar.struts.interceptor.ActionMessagesThrowsInterceptor;
|
||||
import org.lastaflute.di.core.aop.frame.MethodInvocation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@ import java.util.List;
|
|||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.SystemUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.FessSystemException;
|
||||
|
@ -36,7 +36,7 @@ import org.codelibs.fess.helper.SystemHelper;
|
|||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.fess.util.InputStreamThread;
|
||||
import org.codelibs.fess.util.JobProcess;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -211,7 +211,7 @@ public class CrawlJob {
|
|||
protected void executeCrawler() {
|
||||
final List<String> crawlerCmdList = new ArrayList<String>();
|
||||
final String cpSeparator = SystemUtils.IS_OS_WINDOWS ? ";" : ":";
|
||||
final ServletContext servletContext = SingletonS2Container.getComponent(ServletContext.class);
|
||||
final ServletContext servletContext = SingletonLaContainer.getComponent(ServletContext.class);
|
||||
final SystemHelper systemHelper = ComponentUtil.getSystemHelper();
|
||||
final JobHelper jobHelper = ComponentUtil.getJobHelper();
|
||||
|
||||
|
|
|
@ -24,6 +24,9 @@ import static org.quartz.TriggerBuilder.newTrigger;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.es.exbhv.ScheduledJobBhv;
|
||||
|
@ -38,8 +41,6 @@ import org.quartz.SchedulerException;
|
|||
import org.quartz.SchedulerFactory;
|
||||
import org.quartz.Trigger;
|
||||
import org.quartz.impl.StdSchedulerFactory;
|
||||
import org.seasar.framework.container.annotation.tiger.DestroyMethod;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -54,7 +55,7 @@ public class JobScheduler {
|
|||
|
||||
public List<String> targetList = new ArrayList<String>();
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
final SchedulerFactory sf = new StdSchedulerFactory();
|
||||
try {
|
||||
|
@ -71,7 +72,7 @@ public class JobScheduler {
|
|||
}, scheduledJob -> register(scheduledJob));
|
||||
}
|
||||
|
||||
@DestroyMethod
|
||||
@PreDestroy
|
||||
public void destroy() {
|
||||
final JobHelper jobHelper = ComponentUtil.getJobHelper();
|
||||
for (final String sessionId : jobHelper.getRunningSessionIdSet()) {
|
||||
|
|
|
@ -23,11 +23,11 @@ import org.codelibs.fess.helper.JobHelper;
|
|||
import org.codelibs.fess.helper.SystemHelper;
|
||||
import org.codelibs.fess.service.JobLogService;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -102,7 +102,7 @@ public class TriggeredJob implements Job {
|
|||
}
|
||||
|
||||
private void storeJobLog(final JobLog jobLog) {
|
||||
final JobLogService jobLogService = SingletonS2Container.getComponent(JobLogService.class);
|
||||
final JobLogService jobLogService = SingletonLaContainer.getComponent(JobLogService.class);
|
||||
jobLogService.store(jobLog);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package org.codelibs.fess.job.impl;
|
||||
|
||||
import org.codelibs.fess.job.JobExecutor;
|
||||
import org.seasar.framework.container.factory.SingletonS2ContainerFactory;
|
||||
import org.lastaflute.di.core.factory.SingletonLaContainerFactory;
|
||||
|
||||
import groovy.lang.Binding;
|
||||
import groovy.lang.GroovyShell;
|
||||
|
@ -27,7 +27,7 @@ public class GroovyExecutor extends JobExecutor {
|
|||
@Override
|
||||
public Object execute(final String script) {
|
||||
final Binding binding = new Binding();
|
||||
binding.setVariable("container", SingletonS2ContainerFactory.getContainer());
|
||||
binding.setVariable("container", SingletonLaContainerFactory.getContainer());
|
||||
binding.setVariable("executor", this);
|
||||
|
||||
final GroovyShell shell = new GroovyShell(binding);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
package org.codelibs.fess.lasta.core.direction;
|
||||
|
||||
import org.dbflute.saflute.core.direction.ObjectiveConfig;
|
||||
import org.lastaflute.core.direction.ObjectiveConfig;
|
||||
|
||||
/**
|
||||
* @author FreeGen
|
||||
|
|
|
@ -23,18 +23,11 @@ import org.codelibs.fess.lasta.core.direction.sponsor.FessActionAdjustmentProvid
|
|||
import org.codelibs.fess.lasta.core.direction.sponsor.FessTimeResourceProvider;
|
||||
import org.codelibs.fess.lasta.core.direction.sponsor.FessUserLocaleProcessProvider;
|
||||
import org.codelibs.fess.lasta.core.direction.sponsor.FessUserTimeZoneProcessProvider;
|
||||
import org.dbflute.saflute.core.direction.CachedFwAssistantDirector;
|
||||
import org.dbflute.saflute.core.direction.OptionalAssistDirection;
|
||||
import org.dbflute.saflute.core.direction.OptionalCoreDirection;
|
||||
import org.dbflute.saflute.core.security.InvertibleCipher;
|
||||
import org.dbflute.saflute.db.dbflute.OptionalDBFluteDirection;
|
||||
import org.dbflute.saflute.web.action.OptionalActionDirection;
|
||||
import org.dbflute.saflute.web.servlet.OptionalServletDirection;
|
||||
import org.dbflute.saflute.web.servlet.cookie.CookieResourceProvider;
|
||||
import org.dbflute.saflute.web.task.OptionalTaskDirection;
|
||||
import org.dbflute.system.DBFluteSystem;
|
||||
import org.dbflute.system.provider.DfFinalTimeZoneProvider;
|
||||
import org.dbflute.util.DfTypeUtil;
|
||||
import org.lastaflute.core.direction.CachedFwAssistantDirector;
|
||||
import org.lastaflute.web.servlet.cookie.CookieResourceProvider;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
|
|
|
@ -19,10 +19,8 @@ import java.util.List;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.dbflute.saflute.web.action.processor.ActionAdjustmentProvider;
|
||||
import org.dbflute.saflute.web.action.processor.ActionMappingWrapper;
|
||||
import org.dbflute.util.DfTypeUtil;
|
||||
import org.seasar.struts.config.S2ExecuteConfig;
|
||||
import org.lastaflute.web.path.ActionAdjustmentProvider;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
|
|
|
@ -18,11 +18,11 @@ package org.codelibs.fess.lasta.core.direction.sponsor;
|
|||
import java.util.Date;
|
||||
|
||||
import org.codelibs.fess.lasta.core.direction.FessConfig;
|
||||
import org.dbflute.saflute.core.time.BusinessTimeHandler;
|
||||
import org.dbflute.saflute.core.time.RelativeDateScript;
|
||||
import org.dbflute.saflute.core.time.TimeManager;
|
||||
import org.dbflute.saflute.core.time.TimeResourceProvider;
|
||||
import org.dbflute.saflute.core.time.TypicalBusinessTimeHandler;
|
||||
import org.lastaflute.core.time.BusinessTimeHandler;
|
||||
import org.lastaflute.core.time.RelativeDateScript;
|
||||
import org.lastaflute.core.time.TimeManager;
|
||||
import org.lastaflute.core.time.TimeResourceProvider;
|
||||
import org.lastaflute.core.time.TypicalBusinessTimeHandler;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
|
|
|
@ -17,9 +17,8 @@ package org.codelibs.fess.lasta.core.direction.sponsor;
|
|||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.dbflute.saflute.web.action.callback.ActionExecuteMeta;
|
||||
import org.dbflute.saflute.web.servlet.request.RequestManager;
|
||||
import org.dbflute.saflute.web.servlet.request.UserLocaleProcessProvider;
|
||||
import org.lastaflute.web.servlet.request.RequestManager;
|
||||
import org.lastaflute.web.servlet.request.UserLocaleProcessProvider;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
|
|
|
@ -17,9 +17,8 @@ package org.codelibs.fess.lasta.core.direction.sponsor;
|
|||
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.dbflute.saflute.web.action.callback.ActionExecuteMeta;
|
||||
import org.dbflute.saflute.web.servlet.request.RequestManager;
|
||||
import org.dbflute.saflute.web.servlet.request.UserTimeZoneProcessProvider;
|
||||
import org.lastaflute.web.servlet.request.RequestManager;
|
||||
import org.lastaflute.web.servlet.request.UserTimeZoneProcessProvider;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
*/
|
||||
package org.codelibs.fess.lasta.web.action;
|
||||
|
||||
import org.apache.struts.action.ActionMessage;
|
||||
import org.apache.struts.action.ActionMessages;
|
||||
import org.lastaflute.web.ruts.message.ActionMessage;
|
||||
import org.lastaflute.web.ruts.message.ActionMessages;
|
||||
|
||||
/**
|
||||
* The keys for message.
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
*/
|
||||
package org.codelibs.fess.lasta.web.action;
|
||||
|
||||
import org.dbflute.saflute.web.action.login.TypicalUserBaseBean;
|
||||
|
||||
/**
|
||||
* @author jflute
|
||||
*/
|
||||
|
|
373
src/main/java/org/codelibs/fess/mylasta/action/FessHtmlPath.java
Normal file
373
src/main/java/org/codelibs/fess/mylasta/action/FessHtmlPath.java
Normal file
|
@ -0,0 +1,373 @@
|
|||
package org.codelibs.fess.mylasta.action;
|
||||
|
||||
import org.lastaflute.web.response.next.HtmlNext;
|
||||
|
||||
/**
|
||||
* The path definition of HTML.
|
||||
* @author FreeGen
|
||||
*/
|
||||
public interface FessHtmlPath {
|
||||
|
||||
/** The path of the HTML: /admin/boostDocumentRule/confirm.jsp */
|
||||
HtmlNext path_AdminBoostDocumentRule_ConfirmJsp = new HtmlNext("/admin/boostDocumentRule/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/boostDocumentRule/edit.jsp */
|
||||
HtmlNext path_AdminBoostDocumentRule_EditJsp = new HtmlNext("/admin/boostDocumentRule/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/boostDocumentRule/error.jsp */
|
||||
HtmlNext path_AdminBoostDocumentRule_ErrorJsp = new HtmlNext("/admin/boostDocumentRule/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/boostDocumentRule/index.jsp */
|
||||
HtmlNext path_AdminBoostDocumentRule_IndexJsp = new HtmlNext("/admin/boostDocumentRule/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/crawl/index.jsp */
|
||||
HtmlNext path_AdminCrawl_IndexJsp = new HtmlNext("/admin/crawl/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/crawlingSession/confirm.jsp */
|
||||
HtmlNext path_AdminCrawlingSession_ConfirmJsp = new HtmlNext("/admin/crawlingSession/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/crawlingSession/error.jsp */
|
||||
HtmlNext path_AdminCrawlingSession_ErrorJsp = new HtmlNext("/admin/crawlingSession/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/crawlingSession/index.jsp */
|
||||
HtmlNext path_AdminCrawlingSession_IndexJsp = new HtmlNext("/admin/crawlingSession/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/data/index.jsp */
|
||||
HtmlNext path_AdminData_IndexJsp = new HtmlNext("/admin/data/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dataConfig/confirm.jsp */
|
||||
HtmlNext path_AdminDataConfig_ConfirmJsp = new HtmlNext("/admin/dataConfig/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dataConfig/edit.jsp */
|
||||
HtmlNext path_AdminDataConfig_EditJsp = new HtmlNext("/admin/dataConfig/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dataConfig/error.jsp */
|
||||
HtmlNext path_AdminDataConfig_ErrorJsp = new HtmlNext("/admin/dataConfig/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dataConfig/index.jsp */
|
||||
HtmlNext path_AdminDataConfig_IndexJsp = new HtmlNext("/admin/dataConfig/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/design/edit.jsp */
|
||||
HtmlNext path_AdminDesign_EditJsp = new HtmlNext("/admin/design/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/design/index.jsp */
|
||||
HtmlNext path_AdminDesign_IndexJsp = new HtmlNext("/admin/design/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/error.jsp */
|
||||
HtmlNext path_AdminDict_ErrorJsp = new HtmlNext("/admin/dict/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/index.jsp */
|
||||
HtmlNext path_AdminDict_IndexJsp = new HtmlNext("/admin/dict/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/synonym/confirm.jsp */
|
||||
HtmlNext path_AdminDictSynonym_ConfirmJsp = new HtmlNext("/admin/dict/synonym/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/synonym/download.jsp */
|
||||
HtmlNext path_AdminDictSynonym_DownloadJsp = new HtmlNext("/admin/dict/synonym/download.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/synonym/edit.jsp */
|
||||
HtmlNext path_AdminDictSynonym_EditJsp = new HtmlNext("/admin/dict/synonym/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/synonym/error.jsp */
|
||||
HtmlNext path_AdminDictSynonym_ErrorJsp = new HtmlNext("/admin/dict/synonym/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/synonym/index.jsp */
|
||||
HtmlNext path_AdminDictSynonym_IndexJsp = new HtmlNext("/admin/dict/synonym/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/synonym/upload.jsp */
|
||||
HtmlNext path_AdminDictSynonym_UploadJsp = new HtmlNext("/admin/dict/synonym/upload.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/userDict/confirm.jsp */
|
||||
HtmlNext path_AdminDictUserDict_ConfirmJsp = new HtmlNext("/admin/dict/userDict/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/userDict/download.jsp */
|
||||
HtmlNext path_AdminDictUserDict_DownloadJsp = new HtmlNext("/admin/dict/userDict/download.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/userDict/edit.jsp */
|
||||
HtmlNext path_AdminDictUserDict_EditJsp = new HtmlNext("/admin/dict/userDict/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/userDict/error.jsp */
|
||||
HtmlNext path_AdminDictUserDict_ErrorJsp = new HtmlNext("/admin/dict/userDict/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/userDict/index.jsp */
|
||||
HtmlNext path_AdminDictUserDict_IndexJsp = new HtmlNext("/admin/dict/userDict/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/dict/userDict/upload.jsp */
|
||||
HtmlNext path_AdminDictUserDict_UploadJsp = new HtmlNext("/admin/dict/userDict/upload.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/document/index.jsp */
|
||||
HtmlNext path_AdminDocument_IndexJsp = new HtmlNext("/admin/document/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/failureUrl/confirm.jsp */
|
||||
HtmlNext path_AdminFailureUrl_ConfirmJsp = new HtmlNext("/admin/failureUrl/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/failureUrl/error.jsp */
|
||||
HtmlNext path_AdminFailureUrl_ErrorJsp = new HtmlNext("/admin/failureUrl/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/failureUrl/index.jsp */
|
||||
HtmlNext path_AdminFailureUrl_IndexJsp = new HtmlNext("/admin/failureUrl/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/fileAuthentication/confirm.jsp */
|
||||
HtmlNext path_AdminFileAuthentication_ConfirmJsp = new HtmlNext("/admin/fileAuthentication/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/fileAuthentication/edit.jsp */
|
||||
HtmlNext path_AdminFileAuthentication_EditJsp = new HtmlNext("/admin/fileAuthentication/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/fileAuthentication/error.jsp */
|
||||
HtmlNext path_AdminFileAuthentication_ErrorJsp = new HtmlNext("/admin/fileAuthentication/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/fileAuthentication/index.jsp */
|
||||
HtmlNext path_AdminFileAuthentication_IndexJsp = new HtmlNext("/admin/fileAuthentication/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/fileConfig/confirm.jsp */
|
||||
HtmlNext path_AdminFileConfig_ConfirmJsp = new HtmlNext("/admin/fileConfig/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/fileConfig/edit.jsp */
|
||||
HtmlNext path_AdminFileConfig_EditJsp = new HtmlNext("/admin/fileConfig/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/fileConfig/error.jsp */
|
||||
HtmlNext path_AdminFileConfig_ErrorJsp = new HtmlNext("/admin/fileConfig/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/fileConfig/index.jsp */
|
||||
HtmlNext path_AdminFileConfig_IndexJsp = new HtmlNext("/admin/fileConfig/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/jobLog/confirm.jsp */
|
||||
HtmlNext path_AdminJobLog_ConfirmJsp = new HtmlNext("/admin/jobLog/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/jobLog/error.jsp */
|
||||
HtmlNext path_AdminJobLog_ErrorJsp = new HtmlNext("/admin/jobLog/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/jobLog/index.jsp */
|
||||
HtmlNext path_AdminJobLog_IndexJsp = new HtmlNext("/admin/jobLog/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/keyMatch/confirm.jsp */
|
||||
HtmlNext path_AdminKeyMatch_ConfirmJsp = new HtmlNext("/admin/keyMatch/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/keyMatch/edit.jsp */
|
||||
HtmlNext path_AdminKeyMatch_EditJsp = new HtmlNext("/admin/keyMatch/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/keyMatch/error.jsp */
|
||||
HtmlNext path_AdminKeyMatch_ErrorJsp = new HtmlNext("/admin/keyMatch/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/keyMatch/index.jsp */
|
||||
HtmlNext path_AdminKeyMatch_IndexJsp = new HtmlNext("/admin/keyMatch/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/labelType/confirm.jsp */
|
||||
HtmlNext path_AdminLabelType_ConfirmJsp = new HtmlNext("/admin/labelType/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/labelType/edit.jsp */
|
||||
HtmlNext path_AdminLabelType_EditJsp = new HtmlNext("/admin/labelType/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/labelType/error.jsp */
|
||||
HtmlNext path_AdminLabelType_ErrorJsp = new HtmlNext("/admin/labelType/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/labelType/index.jsp */
|
||||
HtmlNext path_AdminLabelType_IndexJsp = new HtmlNext("/admin/labelType/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/log/index.jsp */
|
||||
HtmlNext path_AdminLog_IndexJsp = new HtmlNext("/admin/log/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/overlappingHost/confirm.jsp */
|
||||
HtmlNext path_AdminOverlappingHost_ConfirmJsp = new HtmlNext("/admin/overlappingHost/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/overlappingHost/edit.jsp */
|
||||
HtmlNext path_AdminOverlappingHost_EditJsp = new HtmlNext("/admin/overlappingHost/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/overlappingHost/error.jsp */
|
||||
HtmlNext path_AdminOverlappingHost_ErrorJsp = new HtmlNext("/admin/overlappingHost/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/overlappingHost/index.jsp */
|
||||
HtmlNext path_AdminOverlappingHost_IndexJsp = new HtmlNext("/admin/overlappingHost/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/pathMapping/confirm.jsp */
|
||||
HtmlNext path_AdminPathMapping_ConfirmJsp = new HtmlNext("/admin/pathMapping/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/pathMapping/edit.jsp */
|
||||
HtmlNext path_AdminPathMapping_EditJsp = new HtmlNext("/admin/pathMapping/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/pathMapping/error.jsp */
|
||||
HtmlNext path_AdminPathMapping_ErrorJsp = new HtmlNext("/admin/pathMapping/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/pathMapping/index.jsp */
|
||||
HtmlNext path_AdminPathMapping_IndexJsp = new HtmlNext("/admin/pathMapping/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/requestHeader/confirm.jsp */
|
||||
HtmlNext path_AdminRequestHeader_ConfirmJsp = new HtmlNext("/admin/requestHeader/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/requestHeader/edit.jsp */
|
||||
HtmlNext path_AdminRequestHeader_EditJsp = new HtmlNext("/admin/requestHeader/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/requestHeader/error.jsp */
|
||||
HtmlNext path_AdminRequestHeader_ErrorJsp = new HtmlNext("/admin/requestHeader/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/requestHeader/index.jsp */
|
||||
HtmlNext path_AdminRequestHeader_IndexJsp = new HtmlNext("/admin/requestHeader/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/roleType/confirm.jsp */
|
||||
HtmlNext path_AdminRoleType_ConfirmJsp = new HtmlNext("/admin/roleType/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/roleType/edit.jsp */
|
||||
HtmlNext path_AdminRoleType_EditJsp = new HtmlNext("/admin/roleType/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/roleType/error.jsp */
|
||||
HtmlNext path_AdminRoleType_ErrorJsp = new HtmlNext("/admin/roleType/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/roleType/index.jsp */
|
||||
HtmlNext path_AdminRoleType_IndexJsp = new HtmlNext("/admin/roleType/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/scheduledJob/confirm.jsp */
|
||||
HtmlNext path_AdminScheduledJob_ConfirmJsp = new HtmlNext("/admin/scheduledJob/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/scheduledJob/edit.jsp */
|
||||
HtmlNext path_AdminScheduledJob_EditJsp = new HtmlNext("/admin/scheduledJob/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/scheduledJob/error.jsp */
|
||||
HtmlNext path_AdminScheduledJob_ErrorJsp = new HtmlNext("/admin/scheduledJob/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/scheduledJob/index.jsp */
|
||||
HtmlNext path_AdminScheduledJob_IndexJsp = new HtmlNext("/admin/scheduledJob/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/searchList/confirmDelete.jsp */
|
||||
HtmlNext path_AdminSearchList_ConfirmDeleteJsp = new HtmlNext("/admin/searchList/confirmDelete.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/searchList/index.jsp */
|
||||
HtmlNext path_AdminSearchList_IndexJsp = new HtmlNext("/admin/searchList/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/suggestBadWord/confirm.jsp */
|
||||
HtmlNext path_AdminSuggestBadWord_ConfirmJsp = new HtmlNext("/admin/suggestBadWord/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/suggestBadWord/download.jsp */
|
||||
HtmlNext path_AdminSuggestBadWord_DownloadJsp = new HtmlNext("/admin/suggestBadWord/download.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/suggestBadWord/edit.jsp */
|
||||
HtmlNext path_AdminSuggestBadWord_EditJsp = new HtmlNext("/admin/suggestBadWord/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/suggestBadWord/error.jsp */
|
||||
HtmlNext path_AdminSuggestBadWord_ErrorJsp = new HtmlNext("/admin/suggestBadWord/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/suggestBadWord/index.jsp */
|
||||
HtmlNext path_AdminSuggestBadWord_IndexJsp = new HtmlNext("/admin/suggestBadWord/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/suggestBadWord/upload.jsp */
|
||||
HtmlNext path_AdminSuggestBadWord_UploadJsp = new HtmlNext("/admin/suggestBadWord/upload.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/suggestElevateWord/confirm.jsp */
|
||||
HtmlNext path_AdminSuggestElevateWord_ConfirmJsp = new HtmlNext("/admin/suggestElevateWord/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/suggestElevateWord/download.jsp */
|
||||
HtmlNext path_AdminSuggestElevateWord_DownloadJsp = new HtmlNext("/admin/suggestElevateWord/download.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/suggestElevateWord/edit.jsp */
|
||||
HtmlNext path_AdminSuggestElevateWord_EditJsp = new HtmlNext("/admin/suggestElevateWord/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/suggestElevateWord/error.jsp */
|
||||
HtmlNext path_AdminSuggestElevateWord_ErrorJsp = new HtmlNext("/admin/suggestElevateWord/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/suggestElevateWord/index.jsp */
|
||||
HtmlNext path_AdminSuggestElevateWord_IndexJsp = new HtmlNext("/admin/suggestElevateWord/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/suggestElevateWord/upload.jsp */
|
||||
HtmlNext path_AdminSuggestElevateWord_UploadJsp = new HtmlNext("/admin/suggestElevateWord/upload.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/system/index.jsp */
|
||||
HtmlNext path_AdminSystem_IndexJsp = new HtmlNext("/admin/system/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/systemInfo/index.jsp */
|
||||
HtmlNext path_AdminSystemInfo_IndexJsp = new HtmlNext("/admin/systemInfo/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/webAuthentication/confirm.jsp */
|
||||
HtmlNext path_AdminWebAuthentication_ConfirmJsp = new HtmlNext("/admin/webAuthentication/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/webAuthentication/edit.jsp */
|
||||
HtmlNext path_AdminWebAuthentication_EditJsp = new HtmlNext("/admin/webAuthentication/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/webAuthentication/error.jsp */
|
||||
HtmlNext path_AdminWebAuthentication_ErrorJsp = new HtmlNext("/admin/webAuthentication/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/webAuthentication/index.jsp */
|
||||
HtmlNext path_AdminWebAuthentication_IndexJsp = new HtmlNext("/admin/webAuthentication/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/webConfig/confirm.jsp */
|
||||
HtmlNext path_AdminWebConfig_ConfirmJsp = new HtmlNext("/admin/webConfig/confirm.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/webConfig/edit.jsp */
|
||||
HtmlNext path_AdminWebConfig_EditJsp = new HtmlNext("/admin/webConfig/edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/webConfig/error.jsp */
|
||||
HtmlNext path_AdminWebConfig_ErrorJsp = new HtmlNext("/admin/webConfig/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/webConfig/index.jsp */
|
||||
HtmlNext path_AdminWebConfig_IndexJsp = new HtmlNext("/admin/webConfig/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/wizard/crawlingConfig.jsp */
|
||||
HtmlNext path_AdminWizard_CrawlingConfigJsp = new HtmlNext("/admin/wizard/crawlingConfig.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/wizard/error.jsp */
|
||||
HtmlNext path_AdminWizard_ErrorJsp = new HtmlNext("/admin/wizard/error.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/wizard/index.jsp */
|
||||
HtmlNext path_AdminWizard_IndexJsp = new HtmlNext("/admin/wizard/index.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/wizard/startCrawling.jsp */
|
||||
HtmlNext path_AdminWizard_StartCrawlingJsp = new HtmlNext("/admin/wizard/startCrawling.jsp");
|
||||
|
||||
/** The path of the HTML: /error/badRequest.jsp */
|
||||
HtmlNext path_Error_BadRequestJsp = new HtmlNext("/error/badRequest.jsp");
|
||||
|
||||
/** The path of the HTML: /error/error_message.jsp */
|
||||
HtmlNext path_Error_ErrorMessageJsp = new HtmlNext("/error/error_message.jsp");
|
||||
|
||||
/** The path of the HTML: /error/footer.jsp */
|
||||
HtmlNext path_Error_FooterJsp = new HtmlNext("/error/footer.jsp");
|
||||
|
||||
/** The path of the HTML: /error/header.jsp */
|
||||
HtmlNext path_Error_HeaderJsp = new HtmlNext("/error/header.jsp");
|
||||
|
||||
/** The path of the HTML: /error/notFound.jsp */
|
||||
HtmlNext path_Error_NotFoundJsp = new HtmlNext("/error/notFound.jsp");
|
||||
|
||||
/** The path of the HTML: /error/redirect.jsp */
|
||||
HtmlNext path_Error_RedirectJsp = new HtmlNext("/error/redirect.jsp");
|
||||
|
||||
/** The path of the HTML: /error/system.jsp */
|
||||
HtmlNext path_Error_SystemJsp = new HtmlNext("/error/system.jsp");
|
||||
|
||||
/** The path of the HTML: /error.jsp */
|
||||
HtmlNext path_ErrorJsp = new HtmlNext("/error.jsp");
|
||||
|
||||
/** The path of the HTML: /footer.jsp */
|
||||
HtmlNext path_FooterJsp = new HtmlNext("/footer.jsp");
|
||||
|
||||
/** The path of the HTML: /header.jsp */
|
||||
HtmlNext path_HeaderJsp = new HtmlNext("/header.jsp");
|
||||
|
||||
/** The path of the HTML: /help.jsp */
|
||||
HtmlNext path_HelpJsp = new HtmlNext("/help.jsp");
|
||||
|
||||
/** The path of the HTML: /index.jsp */
|
||||
HtmlNext path_IndexJsp = new HtmlNext("/index.jsp");
|
||||
|
||||
/** The path of the HTML: /login/error.jsp */
|
||||
HtmlNext path_Login_ErrorJsp = new HtmlNext("/login/error.jsp");
|
||||
|
||||
/** The path of the HTML: /login/footer.jsp */
|
||||
HtmlNext path_Login_FooterJsp = new HtmlNext("/login/footer.jsp");
|
||||
|
||||
/** The path of the HTML: /login/header.jsp */
|
||||
HtmlNext path_Login_HeaderJsp = new HtmlNext("/login/header.jsp");
|
||||
|
||||
/** The path of the HTML: /login/index.jsp */
|
||||
HtmlNext path_Login_IndexJsp = new HtmlNext("/login/index.jsp");
|
||||
|
||||
/** The path of the HTML: /login/logout.jsp */
|
||||
HtmlNext path_Login_LogoutJsp = new HtmlNext("/login/logout.jsp");
|
||||
|
||||
/** The path of the HTML: /search.jsp */
|
||||
HtmlNext path_SearchJsp = new HtmlNext("/search.jsp");
|
||||
|
||||
/** The path of the HTML: /searchNoResult.jsp */
|
||||
HtmlNext path_SearchNoResultJsp = new HtmlNext("/searchNoResult.jsp");
|
||||
|
||||
/** The path of the HTML: /searchResults.jsp */
|
||||
HtmlNext path_SearchResultsJsp = new HtmlNext("/searchResults.jsp");
|
||||
}
|
6651
src/main/java/org/codelibs/fess/mylasta/action/FessLabels.java
Normal file
6651
src/main/java/org/codelibs/fess/mylasta/action/FessLabels.java
Normal file
File diff suppressed because it is too large
Load diff
2520
src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java
Normal file
2520
src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java
Normal file
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,220 @@
|
|||
package org.codelibs.fess.mylasta.direction;
|
||||
|
||||
import org.codelibs.fess.mylasta.direction.FessEnv;
|
||||
import org.lastaflute.core.direction.exception.ConfigPropertyNotFoundException;
|
||||
|
||||
/**
|
||||
* @author FreeGen
|
||||
*/
|
||||
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. / */
|
||||
String COOKIE_DEFAULT_PATH = "cookie.default.path";
|
||||
|
||||
/** The key of the configuration. e.g. 31556926 */
|
||||
String COOKIE_DEFAULT_EXPIRE = "cookie.default.expire";
|
||||
|
||||
/** The key of the configuration. e.g. 315360000 */
|
||||
String COOKIE_ETERNAL_EXPIRE = "cookie.eternal.expire";
|
||||
|
||||
/** The key of the configuration. e.g. HRB */
|
||||
String COOKIE_AUTO_LOGIN_HARBOR_KEY = "cookie.auto.login.harbor.key";
|
||||
|
||||
/** The key of the configuration. e.g. 4 */
|
||||
String PAGING_PAGE_SIZE = "paging.page.size";
|
||||
|
||||
/** The key of the configuration. e.g. 3 */
|
||||
String PAGING_PAGE_RANGE_SIZE = "paging.page.range.size";
|
||||
|
||||
/** The key of the configuration. e.g. true */
|
||||
String PAGING_PAGE_RANGE_FILL_LIMIT = "paging.page.range.fill.limit";
|
||||
|
||||
/**
|
||||
* Get the value of property as {@link String}.
|
||||
* @param propertyKey The key of the property. (NotNull)
|
||||
* @return The value of found property. (NotNull: if not found, exception)
|
||||
* @throws ConfigPropertyNotFoundException When the property is not found.
|
||||
*/
|
||||
String get(String propertyKey);
|
||||
|
||||
/**
|
||||
* Is the property true?
|
||||
* @param propertyKey The key of the property which is boolean type. (NotNull)
|
||||
* @return The determination, true or false. (if not found, exception)
|
||||
* @throws ConfigPropertyNotFoundException When the property is not found.
|
||||
*/
|
||||
boolean is(String propertyKey);
|
||||
|
||||
/**
|
||||
* Get the value for the key 'domain.title'. <br>
|
||||
* The value is, e.g. Fess <br>
|
||||
* comment: The title of domain the application for logging
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getDomainTitle();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'cookie.default.path'. <br>
|
||||
* The value is, e.g. / <br>
|
||||
* comment: The default path of cookie (basically '/' if no context path)
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getCookieDefaultPath();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'cookie.default.expire'. <br>
|
||||
* The value is, e.g. 31556926 <br>
|
||||
* comment: The default expire of cookie in seconds e.g. 31556926: one year, 86400: one day
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getCookieDefaultExpire();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'cookie.default.expire' as {@link Integer}. <br>
|
||||
* The value is, e.g. 31556926 <br>
|
||||
* comment: The default expire of cookie in seconds e.g. 31556926: one year, 86400: one day
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
* @throws NumberFormatException When the property is not integer.
|
||||
*/
|
||||
Integer getCookieDefaultExpireAsInteger();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'cookie.eternal.expire'. <br>
|
||||
* The value is, e.g. 315360000 <br>
|
||||
* comment: The eternal expire of cookie in seconds e.g. 315360000: ten year, 86400: one day
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getCookieEternalExpire();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'cookie.eternal.expire' as {@link Integer}. <br>
|
||||
* The value is, e.g. 315360000 <br>
|
||||
* comment: The eternal expire of cookie in seconds e.g. 315360000: ten year, 86400: one day
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
* @throws NumberFormatException When the property is not integer.
|
||||
*/
|
||||
Integer getCookieEternalExpireAsInteger();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'cookie.auto.login.harbor.key'. <br>
|
||||
* The value is, e.g. HRB <br>
|
||||
* comment: The cookie key of auto-login for Fess
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getCookieAutoLoginHarborKey();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'paging.page.size'. <br>
|
||||
* The value is, e.g. 4 <br>
|
||||
* comment: The size of one page for paging
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getPagingPageSize();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'paging.page.size' as {@link Integer}. <br>
|
||||
* The value is, e.g. 4 <br>
|
||||
* comment: The size of one page for paging
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
* @throws NumberFormatException When the property is not integer.
|
||||
*/
|
||||
Integer getPagingPageSizeAsInteger();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'paging.page.range.size'. <br>
|
||||
* The value is, e.g. 3 <br>
|
||||
* comment: The size of page range for paging
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getPagingPageRangeSize();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'paging.page.range.size' as {@link Integer}. <br>
|
||||
* The value is, e.g. 3 <br>
|
||||
* comment: The size of page range for paging
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
* @throws NumberFormatException When the property is not integer.
|
||||
*/
|
||||
Integer getPagingPageRangeSizeAsInteger();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'paging.page.range.fill.limit'. <br>
|
||||
* The value is, e.g. true <br>
|
||||
* comment: The option 'fillLimit' of page range for paging
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getPagingPageRangeFillLimit();
|
||||
|
||||
/**
|
||||
* Is the property for the key 'paging.page.range.fill.limit' true? <br>
|
||||
* The value is, e.g. true <br>
|
||||
* comment: The option 'fillLimit' of page range for paging
|
||||
* @return The determination, true or false. (if not found, exception but basically no way)
|
||||
*/
|
||||
boolean isPagingPageRangeFillLimit();
|
||||
|
||||
/**
|
||||
* The simple implementation for configuration.
|
||||
* @author FreeGen
|
||||
*/
|
||||
public static class SimpleImpl extends FessEnv.SimpleImpl implements FessConfig {
|
||||
|
||||
/** The serial version UID for object serialization. (Default) */
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String getDomainTitle() {
|
||||
return get(FessConfig.DOMAIN_TITLE);
|
||||
}
|
||||
|
||||
public String getCookieDefaultPath() {
|
||||
return get(FessConfig.COOKIE_DEFAULT_PATH);
|
||||
}
|
||||
|
||||
public String getCookieDefaultExpire() {
|
||||
return get(FessConfig.COOKIE_DEFAULT_EXPIRE);
|
||||
}
|
||||
|
||||
public Integer getCookieDefaultExpireAsInteger() {
|
||||
return getAsInteger(FessConfig.COOKIE_DEFAULT_EXPIRE);
|
||||
}
|
||||
|
||||
public String getCookieEternalExpire() {
|
||||
return get(FessConfig.COOKIE_ETERNAL_EXPIRE);
|
||||
}
|
||||
|
||||
public Integer getCookieEternalExpireAsInteger() {
|
||||
return getAsInteger(FessConfig.COOKIE_ETERNAL_EXPIRE);
|
||||
}
|
||||
|
||||
public String getCookieAutoLoginHarborKey() {
|
||||
return get(FessConfig.COOKIE_AUTO_LOGIN_HARBOR_KEY);
|
||||
}
|
||||
|
||||
public String getPagingPageSize() {
|
||||
return get(FessConfig.PAGING_PAGE_SIZE);
|
||||
}
|
||||
|
||||
public Integer getPagingPageSizeAsInteger() {
|
||||
return getAsInteger(FessConfig.PAGING_PAGE_SIZE);
|
||||
}
|
||||
|
||||
public String getPagingPageRangeSize() {
|
||||
return get(FessConfig.PAGING_PAGE_RANGE_SIZE);
|
||||
}
|
||||
|
||||
public Integer getPagingPageRangeSizeAsInteger() {
|
||||
return getAsInteger(FessConfig.PAGING_PAGE_RANGE_SIZE);
|
||||
}
|
||||
|
||||
public String getPagingPageRangeFillLimit() {
|
||||
return get(FessConfig.PAGING_PAGE_RANGE_FILL_LIMIT);
|
||||
}
|
||||
|
||||
public boolean isPagingPageRangeFillLimit() {
|
||||
return is(FessConfig.PAGING_PAGE_RANGE_FILL_LIMIT);
|
||||
}
|
||||
}
|
||||
}
|
148
src/main/java/org/codelibs/fess/mylasta/direction/FessEnv.java
Normal file
148
src/main/java/org/codelibs/fess/mylasta/direction/FessEnv.java
Normal file
|
@ -0,0 +1,148 @@
|
|||
package org.codelibs.fess.mylasta.direction;
|
||||
|
||||
import org.lastaflute.core.direction.ObjectiveConfig;
|
||||
import org.lastaflute.core.direction.exception.ConfigPropertyNotFoundException;
|
||||
|
||||
/**
|
||||
* @author FreeGen
|
||||
*/
|
||||
public interface FessEnv {
|
||||
|
||||
/** The key of the configuration. e.g. hot */
|
||||
String lasta_di_SMART_DEPLOY_MODE = "lasta_di.smart.deploy.mode";
|
||||
|
||||
/** The key of the configuration. e.g. true */
|
||||
String DEVELOPMENT_HERE = "development.here";
|
||||
|
||||
/** The key of the configuration. e.g. Local Development */
|
||||
String ENVIRONMENT_TITLE = "environment.title";
|
||||
|
||||
/** The key of the configuration. e.g. false */
|
||||
String FRAMEWORK_DEBUG = "framework.debug";
|
||||
|
||||
/** The key of the configuration. e.g. 0 */
|
||||
String TIME_ADJUST_TIME_MILLIS = "time.adjust.time.millis";
|
||||
|
||||
/**
|
||||
* Get the value of property as {@link String}.
|
||||
* @param propertyKey The key of the property. (NotNull)
|
||||
* @return The value of found property. (NotNull: if not found, exception)
|
||||
* @throws ConfigPropertyNotFoundException When the property is not found.
|
||||
*/
|
||||
String get(String propertyKey);
|
||||
|
||||
/**
|
||||
* Is the property true?
|
||||
* @param propertyKey The key of the property which is boolean type. (NotNull)
|
||||
* @return The determination, true or false. (if not found, exception)
|
||||
* @throws ConfigPropertyNotFoundException When the property is not found.
|
||||
*/
|
||||
boolean is(String propertyKey);
|
||||
|
||||
/**
|
||||
* Get the value for the key 'lasta_di.smart.deploy.mode'. <br>
|
||||
* The value is, e.g. hot <br>
|
||||
* comment: The mode of Lasta Di's smart-deploy, should be cool in production (e.g. hot, cool, warm)
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getLastaDiSmartDeployMode();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'development.here'. <br>
|
||||
* The value is, e.g. true <br>
|
||||
* comment: Is development environment here? (used for various purpose, you should set false if unknown)
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getDevelopmentHere();
|
||||
|
||||
/**
|
||||
* Is the property for the key 'development.here' true? <br>
|
||||
* The value is, e.g. true <br>
|
||||
* comment: Is development environment here? (used for various purpose, you should set false if unknown)
|
||||
* @return The determination, true or false. (if not found, exception but basically no way)
|
||||
*/
|
||||
boolean isDevelopmentHere();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'environment.title'. <br>
|
||||
* The value is, e.g. Local Development <br>
|
||||
* comment: The title of environment (e.g. local or integartion or production)
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getEnvironmentTitle();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'framework.debug'. <br>
|
||||
* The value is, e.g. false <br>
|
||||
* comment: Does it enable the Framework internal debug? (true only when emergency)
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getFrameworkDebug();
|
||||
|
||||
/**
|
||||
* Is the property for the key 'framework.debug' true? <br>
|
||||
* The value is, e.g. false <br>
|
||||
* comment: Does it enable the Framework internal debug? (true only when emergency)
|
||||
* @return The determination, true or false. (if not found, exception but basically no way)
|
||||
*/
|
||||
boolean isFrameworkDebug();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'time.adjust.time.millis'. <br>
|
||||
* The value is, e.g. 0 <br>
|
||||
* comment: The milliseconds for (relative or absolute) adjust time (set only when test) @LongType *dynamic in development
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getTimeAdjustTimeMillis();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'time.adjust.time.millis' as {@link Long}. <br>
|
||||
* The value is, e.g. 0 <br>
|
||||
* comment: The milliseconds for (relative or absolute) adjust time (set only when test) @LongType *dynamic in development
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
* @throws NumberFormatException When the property is not long.
|
||||
*/
|
||||
Long getTimeAdjustTimeMillisAsLong();
|
||||
|
||||
/**
|
||||
* The simple implementation for configuration.
|
||||
* @author FreeGen
|
||||
*/
|
||||
public static class SimpleImpl extends ObjectiveConfig implements FessEnv {
|
||||
|
||||
/** The serial version UID for object serialization. (Default) */
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String getLastaDiSmartDeployMode() {
|
||||
return get(FessEnv.lasta_di_SMART_DEPLOY_MODE);
|
||||
}
|
||||
|
||||
public String getDevelopmentHere() {
|
||||
return get(FessEnv.DEVELOPMENT_HERE);
|
||||
}
|
||||
|
||||
public boolean isDevelopmentHere() {
|
||||
return is(FessEnv.DEVELOPMENT_HERE);
|
||||
}
|
||||
|
||||
public String getEnvironmentTitle() {
|
||||
return get(FessEnv.ENVIRONMENT_TITLE);
|
||||
}
|
||||
|
||||
public String getFrameworkDebug() {
|
||||
return get(FessEnv.FRAMEWORK_DEBUG);
|
||||
}
|
||||
|
||||
public boolean isFrameworkDebug() {
|
||||
return is(FessEnv.FRAMEWORK_DEBUG);
|
||||
}
|
||||
|
||||
public String getTimeAdjustTimeMillis() {
|
||||
return get(FessEnv.TIME_ADJUST_TIME_MILLIS);
|
||||
}
|
||||
|
||||
public Long getTimeAdjustTimeMillisAsLong() {
|
||||
return getAsLong(FessEnv.TIME_ADJUST_TIME_MILLIS);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -19,8 +19,6 @@ package org.codelibs.fess.pager;
|
|||
import java.util.List;
|
||||
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.seasar.struts.annotation.IntRange;
|
||||
import org.seasar.struts.annotation.Maxbytelength;
|
||||
|
||||
public class FailureUrlPager {
|
||||
|
||||
|
|
|
@ -24,19 +24,19 @@ import java.util.Map;
|
|||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.codelibs.core.collection.LruHashMap;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.FessSystemException;
|
||||
import org.codelibs.fess.helper.FieldHelper;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.codelibs.robot.util.LruHashMap;
|
||||
import org.seasar.framework.container.annotation.tiger.DestroyMethod;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
import org.seasar.struts.util.RequestUtil;
|
||||
import org.lastaflute.web.util.LaRequestUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -66,7 +66,7 @@ public class ScreenShotManager {
|
|||
|
||||
private Thread screenshotGeneratorThread;
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
if (baseDir == null) {
|
||||
final String path = application.getRealPath(DEFAULT_SCREENSHOT_DIR);
|
||||
|
@ -102,7 +102,7 @@ public class ScreenShotManager {
|
|||
screenshotGeneratorThread.start();
|
||||
}
|
||||
|
||||
@DestroyMethod
|
||||
@PreDestroy
|
||||
public void destroy() {
|
||||
generating = false;
|
||||
screenshotGeneratorThread.interrupt();
|
||||
|
@ -146,12 +146,12 @@ public class ScreenShotManager {
|
|||
dataMap.put(docid, screenShotPath);
|
||||
}
|
||||
}
|
||||
final Map<String, Map<String, String>> screenShotPathCache = getScreenShotPathCache(RequestUtil.getRequest().getSession());
|
||||
final Map<String, Map<String, String>> screenShotPathCache = getScreenShotPathCache(LaRequestUtil.getRequest().getSession());
|
||||
screenShotPathCache.put(queryId, dataMap);
|
||||
}
|
||||
|
||||
public File getScreenShotFile(final String queryId, final String docId) {
|
||||
final HttpSession session = RequestUtil.getRequest().getSession(false);
|
||||
final HttpSession session = LaRequestUtil.getRequest().getSession(false);
|
||||
if (session != null) {
|
||||
final Map<String, Map<String, String>> screenShotPathCache = getScreenShotPathCache(session);
|
||||
final Map<String, String> dataMap = screenShotPathCache.get(queryId);
|
||||
|
|
|
@ -25,18 +25,16 @@ import java.util.List;
|
|||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.seasar.framework.container.annotation.tiger.Binding;
|
||||
import org.seasar.framework.container.annotation.tiger.BindingType;
|
||||
import org.seasar.framework.container.annotation.tiger.DestroyMethod;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class CommandGenerator extends BaseScreenShotGenerator {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CommandGenerator.class);
|
||||
|
||||
@Binding(bindingType = BindingType.MUST)
|
||||
public List<String> commandList;
|
||||
|
||||
public long commandTimeout = 10 * 1000;// 10sec
|
||||
|
@ -45,7 +43,7 @@ public class CommandGenerator extends BaseScreenShotGenerator {
|
|||
|
||||
private volatile Timer destoryTimer;
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
if (baseDir == null) {
|
||||
baseDir = new File(application.getRealPath("/"));
|
||||
|
@ -53,7 +51,7 @@ public class CommandGenerator extends BaseScreenShotGenerator {
|
|||
destoryTimer = new Timer("CommandGeneratorDestoryTimer-" + System.currentTimeMillis(), true);
|
||||
}
|
||||
|
||||
@DestroyMethod
|
||||
@PreDestroy
|
||||
public void destroy() {
|
||||
destoryTimer.cancel();
|
||||
destoryTimer = null;
|
||||
|
|
|
@ -22,6 +22,8 @@ import java.io.File;
|
|||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import org.openqa.selenium.Dimension;
|
||||
|
@ -29,8 +31,6 @@ import org.openqa.selenium.OutputType;
|
|||
import org.openqa.selenium.TakesScreenshot;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.phantomjs.PhantomJSDriver;
|
||||
import org.seasar.framework.container.annotation.tiger.DestroyMethod;
|
||||
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class WebDriverGenerator extends BaseScreenShotGenerator {
|
|||
|
||||
public String imageFormatName = "png";
|
||||
|
||||
@InitMethod
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
if (webDriver == null) {
|
||||
webDriver = new PhantomJSDriver();
|
||||
|
@ -56,7 +56,7 @@ public class WebDriverGenerator extends BaseScreenShotGenerator {
|
|||
webDriver.manage().window().setSize(new Dimension(windowWidth, windowHeight));
|
||||
}
|
||||
|
||||
@DestroyMethod
|
||||
@PreDestroy
|
||||
public void destroy() {
|
||||
webDriver.close();
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -29,7 +30,6 @@ import org.codelibs.fess.es.exbhv.BoostDocumentRuleBhv;
|
|||
import org.codelibs.fess.es.exentity.BoostDocumentRule;
|
||||
import org.codelibs.fess.pager.BoostDocumentRulePager;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class BoostDocumentRuleService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.io.Serializable;
|
||||
|
@ -50,11 +51,10 @@ import org.codelibs.fess.util.ComponentUtil;
|
|||
import org.dbflute.bhv.readable.EntityRowHandler;
|
||||
import org.dbflute.cbean.result.ListResultBean;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
import jp.sf.orangesignal.csv.CsvConfig;
|
||||
import jp.sf.orangesignal.csv.CsvReader;
|
||||
import jp.sf.orangesignal.csv.CsvWriter;
|
||||
import com.orangesignal.csv.CsvConfig;
|
||||
import com.orangesignal.csv.CsvReader;
|
||||
import com.orangesignal.csv.CsvWriter;
|
||||
|
||||
public class CrawlingSessionService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -35,7 +36,6 @@ import org.codelibs.fess.es.exentity.DataConfigToLabel;
|
|||
import org.codelibs.fess.es.exentity.DataConfigToRole;
|
||||
import org.codelibs.fess.pager.DataConfigPager;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class DataConfigService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Serializable;
|
||||
import java.io.StringWriter;
|
||||
|
@ -26,7 +27,6 @@ import java.util.regex.Pattern;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.core.misc.DynamicProperties;
|
||||
import org.codelibs.fess.Constants;
|
||||
|
@ -41,8 +41,7 @@ import org.codelibs.fess.pager.FailureUrlPager;
|
|||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.dbflute.cbean.result.ListResultBean;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
import org.seasar.framework.container.SingletonS2Container;
|
||||
import org.lastaflute.di.core.SingletonLaContainer;
|
||||
|
||||
public class FailureUrlService implements Serializable {
|
||||
|
||||
|
@ -209,7 +208,7 @@ public class FailureUrlService implements Serializable {
|
|||
}
|
||||
|
||||
public void store(final CrawlingConfig crawlingConfig, final String errorName, final String url, final Throwable e) {
|
||||
final FailureUrlBhv failureUrlBhv = SingletonS2Container.getComponent(FailureUrlBhv.class);
|
||||
final FailureUrlBhv failureUrlBhv = SingletonLaContainer.getComponent(FailureUrlBhv.class);
|
||||
FailureUrl failureUrl = failureUrlBhv.selectEntity(cb -> {
|
||||
cb.query().setUrl_Equal(url);
|
||||
if (crawlingConfig != null) {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -29,7 +30,6 @@ import org.codelibs.fess.es.exbhv.FileAuthenticationBhv;
|
|||
import org.codelibs.fess.es.exentity.FileAuthentication;
|
||||
import org.codelibs.fess.pager.FileAuthenticationPager;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class FileAuthenticationService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -35,7 +36,6 @@ import org.codelibs.fess.es.exentity.FileConfigToLabel;
|
|||
import org.codelibs.fess.es.exentity.FileConfigToRole;
|
||||
import org.codelibs.fess.pager.FileConfigPager;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class FileConfigService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -30,7 +31,6 @@ import org.codelibs.fess.es.exentity.JobLog;
|
|||
import org.codelibs.fess.pager.JobLogPager;
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class JobLogService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -29,7 +30,6 @@ import org.codelibs.fess.es.exbhv.KeyMatchBhv;
|
|||
import org.codelibs.fess.es.exentity.KeyMatch;
|
||||
import org.codelibs.fess.pager.KeyMatchPager;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class KeyMatchService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -35,7 +36,6 @@ import org.codelibs.fess.pager.LabelTypePager;
|
|||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.dbflute.cbean.result.ListResultBean;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class LabelTypeService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -29,7 +30,6 @@ import org.codelibs.fess.es.exbhv.OverlappingHostBhv;
|
|||
import org.codelibs.fess.es.exentity.OverlappingHost;
|
||||
import org.codelibs.fess.pager.OverlappingHostPager;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class OverlappingHostService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
@ -30,7 +31,6 @@ import org.codelibs.fess.es.exbhv.PathMappingBhv;
|
|||
import org.codelibs.fess.es.exentity.PathMapping;
|
||||
import org.codelibs.fess.pager.PathMappingPager;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class PathMappingService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -29,7 +30,6 @@ import org.codelibs.fess.es.exbhv.RequestHeaderBhv;
|
|||
import org.codelibs.fess.es.exentity.RequestHeader;
|
||||
import org.codelibs.fess.pager.RequestHeaderPager;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class RequestHeaderService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -29,7 +30,6 @@ import org.codelibs.fess.es.exbhv.RoleTypeBhv;
|
|||
import org.codelibs.fess.es.exentity.RoleType;
|
||||
import org.codelibs.fess.pager.RoleTypePager;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class RoleTypeService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -31,7 +32,6 @@ import org.codelibs.fess.es.exentity.ScheduledJob;
|
|||
import org.codelibs.fess.job.JobScheduler;
|
||||
import org.codelibs.fess.pager.ScheduledJobPager;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class ScheduledJobService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.io.Serializable;
|
||||
|
@ -38,11 +39,10 @@ import org.codelibs.fess.pager.SuggestBadWordPager;
|
|||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.dbflute.bhv.readable.EntityRowHandler;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
import jp.sf.orangesignal.csv.CsvConfig;
|
||||
import jp.sf.orangesignal.csv.CsvReader;
|
||||
import jp.sf.orangesignal.csv.CsvWriter;
|
||||
import com.orangesignal.csv.CsvConfig;
|
||||
import com.orangesignal.csv.CsvReader;
|
||||
import com.orangesignal.csv.CsvWriter;
|
||||
|
||||
public class SuggestBadWordService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.io.Serializable;
|
||||
|
@ -38,11 +39,10 @@ import org.codelibs.fess.pager.SuggestElevateWordPager;
|
|||
import org.codelibs.fess.util.ComponentUtil;
|
||||
import org.dbflute.bhv.readable.EntityRowHandler;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
import jp.sf.orangesignal.csv.CsvConfig;
|
||||
import jp.sf.orangesignal.csv.CsvReader;
|
||||
import jp.sf.orangesignal.csv.CsvWriter;
|
||||
import com.orangesignal.csv.CsvConfig;
|
||||
import com.orangesignal.csv.CsvReader;
|
||||
import com.orangesignal.csv.CsvWriter;
|
||||
|
||||
public class SuggestElevateWordService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -30,7 +31,6 @@ import org.codelibs.fess.dict.DictionaryManager;
|
|||
import org.codelibs.fess.dict.synonym.SynonymFile;
|
||||
import org.codelibs.fess.dict.synonym.SynonymItem;
|
||||
import org.codelibs.fess.pager.SynonymPager;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class SynonymService {
|
||||
@Resource
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -30,7 +31,6 @@ import org.codelibs.fess.dict.DictionaryManager;
|
|||
import org.codelibs.fess.dict.userdict.UserDictFile;
|
||||
import org.codelibs.fess.dict.userdict.UserDictItem;
|
||||
import org.codelibs.fess.pager.UserDictPager;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class UserDictService {
|
||||
@Resource
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -29,7 +30,6 @@ import org.codelibs.fess.es.exbhv.WebAuthenticationBhv;
|
|||
import org.codelibs.fess.es.exentity.WebAuthentication;
|
||||
import org.codelibs.fess.pager.WebAuthenticationPager;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class WebAuthenticationService implements Serializable {
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package org.codelibs.fess.service;
|
||||
|
||||
import java.beans.Beans;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -35,7 +36,6 @@ import org.codelibs.fess.es.exentity.WebConfigToLabel;
|
|||
import org.codelibs.fess.es.exentity.WebConfigToRole;
|
||||
import org.codelibs.fess.pager.WebConfigPager;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
import org.seasar.framework.beans.util.Beans;
|
||||
|
||||
public class WebConfigService implements Serializable {
|
||||
|
||||
|
|
|
@ -1,104 +0,0 @@
|
|||
/*
|
||||
* Copyright 2009-2015 the CodeLibs Project and the Others.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package org.codelibs.fess.servlet;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
|
||||
import org.h2.tools.Server;
|
||||
import org.seasar.framework.util.DisposableUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class H2ConfigServlet extends HttpServlet {
|
||||
private static final Logger logger = LoggerFactory.getLogger(H2ConfigServlet.class);
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected Server server = null;
|
||||
|
||||
@Override
|
||||
public void init() throws ServletException {
|
||||
final List<String> argList = new ArrayList<String>();
|
||||
String value;
|
||||
|
||||
try {
|
||||
argList.add("-baseDir");
|
||||
value = getServletConfig().getInitParameter("baseDir");
|
||||
if (value != null) {
|
||||
argList.add(value);
|
||||
} else {
|
||||
String baseDir = getServletContext().getRealPath("/WEB-INF/db/");
|
||||
if (Files.notExists(Paths.get(baseDir))) {
|
||||
baseDir = getServletContext().getRealPath("/WEB-INF/") + "/../../h2/webapp/WEB-INF/db/";
|
||||
}
|
||||
argList.add(baseDir);
|
||||
}
|
||||
|
||||
argList.add("-tcp");
|
||||
|
||||
value = getServletConfig().getInitParameter("tcpAllowOthers");
|
||||
if (value != null && "true".equalsIgnoreCase(value)) {
|
||||
argList.add("-tcpAllowOthers");
|
||||
}
|
||||
|
||||
value = getServletConfig().getInitParameter("tcpPort");
|
||||
if (value != null) {
|
||||
argList.add("-tcpPort");
|
||||
argList.add(value);
|
||||
}
|
||||
|
||||
value = getServletConfig().getInitParameter("tcpSSL");
|
||||
if (value != null && "true".equalsIgnoreCase(value)) {
|
||||
argList.add("-tcpSSL");
|
||||
}
|
||||
|
||||
value = getServletConfig().getInitParameter("tcpPassword");
|
||||
if (value != null) {
|
||||
argList.add("-tcpPassword");
|
||||
argList.add(value);
|
||||
}
|
||||
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Starting H2 server...");
|
||||
}
|
||||
server = Server.createTcpServer(argList.toArray(new String[argList.size()])).start();
|
||||
} catch (final Exception e) {
|
||||
throw new ServletException("Could not start Fess Config DB.", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
if (System.getProperty("java.specification.version").equals("1.7")) {
|
||||
DisposableUtil.add(() -> {
|
||||
if (server != null) {
|
||||
server.stop();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (server != null) {
|
||||
server.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue