diff --git a/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java b/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java index 7ed8e8223..90ea62ea8 100644 --- a/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java +++ b/src/main/java/org/codelibs/fess/mylasta/direction/FessConfig.java @@ -609,6 +609,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction /** The key of the configuration. e.g. 100 */ String PAGING_SEARCH_PAGE_MAX_SIZE = "paging.search.page.max.size"; + /** The key of the configuration. e.g. true */ + String THUMBNAIL_HTML_PHANTOMJS_ENABLED = "thumbnail.html.phantomjs.enabled"; + /** The key of the configuration. e.g. Administrator */ String MAIL_FROM_NAME = "mail.from.name"; @@ -2938,6 +2941,20 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction */ Integer getPagingSearchPageMaxSizeAsInteger(); + /** + * Get the value for the key 'thumbnail.html.phantomjs.enabled'.
+ * The value is, e.g. true
+ * @return The value of found property. (NotNull: if not found, exception but basically no way) + */ + String getThumbnailHtmlPhantomjsEnabled(); + + /** + * Is the property for the key 'thumbnail.html.phantomjs.enabled' true?
+ * The value is, e.g. true
+ * @return The determination, true or false. (if not found, exception but basically no way) + */ + boolean isThumbnailHtmlPhantomjsEnabled(); + /** * Get the value for the key 'mail.from.name'.
* The value is, e.g. Administrator
@@ -5101,6 +5118,14 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction return getAsInteger(FessConfig.PAGING_SEARCH_PAGE_MAX_SIZE); } + public String getThumbnailHtmlPhantomjsEnabled() { + return get(FessConfig.THUMBNAIL_HTML_PHANTOMJS_ENABLED); + } + + public boolean isThumbnailHtmlPhantomjsEnabled() { + return is(FessConfig.THUMBNAIL_HTML_PHANTOMJS_ENABLED); + } + public String getMailFromName() { return get(FessConfig.MAIL_FROM_NAME); } diff --git a/src/main/java/org/codelibs/fess/thumbnail/impl/WebDriverGenerator.java b/src/main/java/org/codelibs/fess/thumbnail/impl/WebDriverGenerator.java index 79271d2e9..505e9a692 100644 --- a/src/main/java/org/codelibs/fess/thumbnail/impl/WebDriverGenerator.java +++ b/src/main/java/org/codelibs/fess/thumbnail/impl/WebDriverGenerator.java @@ -25,6 +25,7 @@ import java.util.Collection; import javax.annotation.PostConstruct; import javax.imageio.ImageIO; +import org.codelibs.fess.mylasta.direction.FessConfig; import org.codelibs.fess.util.ComponentUtil; import org.openqa.selenium.Capabilities; import org.openqa.selenium.Dimension; @@ -63,7 +64,8 @@ public class WebDriverGenerator extends BaseThumbnailGenerator { @PostConstruct public void init() { - if (super.isAvailable()) { + final FessConfig fessConfig = ComponentUtil.getFessConfig(); + if (fessConfig.isThumbnailHtmlPhantomjsEnabled() && super.isAvailable()) { try { if (webDriver == null) { if (webDriverCapabilities == null) { diff --git a/src/main/resources/fess_config.properties b/src/main/resources/fess_config.properties index ecbcd8294..e17deea4f 100644 --- a/src/main/resources/fess_config.properties +++ b/src/main/resources/fess_config.properties @@ -334,6 +334,8 @@ paging.search.page.start=0 paging.search.page.size=20 paging.search.page.max.size=100 +thumbnail.html.phantomjs.enabled=true + # ---------------------------------------------------------- # Mail # ------