|
@@ -32,8 +32,10 @@ import javax.servlet.http.HttpSession;
|
|
|
|
|
|
import jp.sf.fess.Constants;
|
|
import jp.sf.fess.Constants;
|
|
import jp.sf.fess.FessSystemException;
|
|
import jp.sf.fess.FessSystemException;
|
|
|
|
+import jp.sf.fess.helper.SystemHelper;
|
|
|
|
|
|
import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.io.FileUtils;
|
|
|
|
+import org.seasar.framework.container.SingletonS2Container;
|
|
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
|
import org.seasar.framework.container.annotation.tiger.InitMethod;
|
|
import org.seasar.framework.util.StringUtil;
|
|
import org.seasar.framework.util.StringUtil;
|
|
import org.seasar.robot.util.LruHashMap;
|
|
import org.seasar.robot.util.LruHashMap;
|
|
@@ -54,8 +56,6 @@ public class ScreenShotManager {
|
|
|
|
|
|
public int threadNum = 10;
|
|
public int threadNum = 10;
|
|
|
|
|
|
- public String solrFieldName = "screenshot_s_s";
|
|
|
|
-
|
|
|
|
public long shutdownTimeout = 5 * 60 * 1000; // 5min
|
|
public long shutdownTimeout = 5 * 60 * 1000; // 5min
|
|
|
|
|
|
public int screenShotPathCacheSize = 10;
|
|
public int screenShotPathCacheSize = 10;
|
|
@@ -90,12 +90,14 @@ public class ScreenShotManager {
|
|
}
|
|
}
|
|
|
|
|
|
public void generate(final Map<String, Object> docMap) {
|
|
public void generate(final Map<String, Object> docMap) {
|
|
|
|
+ final SystemHelper systemHelper = SingletonS2Container
|
|
|
|
+ .getComponent("systemHelper");
|
|
for (final ScreenShotGenerator generator : generatorList) {
|
|
for (final ScreenShotGenerator generator : generatorList) {
|
|
if (generator.isTarget(docMap)) {
|
|
if (generator.isTarget(docMap)) {
|
|
final String segment = (String) docMap.get("segment");
|
|
final String segment = (String) docMap.get("segment");
|
|
final String url = (String) docMap.get("url");
|
|
final String url = (String) docMap.get("url");
|
|
final String path = segment + "/" + generator.getPath(docMap);
|
|
final String path = segment + "/" + generator.getPath(docMap);
|
|
- docMap.put(solrFieldName, path);
|
|
|
|
|
|
+ docMap.put(systemHelper.screenshotField, path);
|
|
executorService.execute(new GenerateTask(url, new File(baseDir,
|
|
executorService.execute(new GenerateTask(url, new File(baseDir,
|
|
path), generator));
|
|
path), generator));
|
|
break;
|
|
break;
|
|
@@ -105,11 +107,14 @@ public class ScreenShotManager {
|
|
|
|
|
|
public void storeRequest(final String queryId,
|
|
public void storeRequest(final String queryId,
|
|
final List<Map<String, Object>> documentItems) {
|
|
final List<Map<String, Object>> documentItems) {
|
|
|
|
+ final SystemHelper systemHelper = SingletonS2Container
|
|
|
|
+ .getComponent("systemHelper");
|
|
final Map<String, String> dataMap = new HashMap<String, String>(
|
|
final Map<String, String> dataMap = new HashMap<String, String>(
|
|
documentItems.size());
|
|
documentItems.size());
|
|
for (final Map<String, Object> docMap : documentItems) {
|
|
for (final Map<String, Object> docMap : documentItems) {
|
|
final String url = (String) docMap.get("url");
|
|
final String url = (String) docMap.get("url");
|
|
- final String screenShotPath = (String) docMap.get(solrFieldName);
|
|
|
|
|
|
+ final String screenShotPath = (String) docMap
|
|
|
|
+ .get(systemHelper.screenshotField);
|
|
if (StringUtil.isNotBlank(url)
|
|
if (StringUtil.isNotBlank(url)
|
|
&& StringUtil.isNotBlank(screenShotPath)) {
|
|
&& StringUtil.isNotBlank(screenShotPath)) {
|
|
dataMap.put(url, screenShotPath);
|
|
dataMap.put(url, screenShotPath);
|