#589 add thumbnailSupport
This commit is contained in:
parent
d82b4f90c2
commit
93228789a3
3 changed files with 7 additions and 3 deletions
|
@ -87,12 +87,16 @@ public abstract class FessSearchAction extends FessBaseAction {
|
|||
|
||||
protected boolean favoriteSupport;
|
||||
|
||||
protected boolean thumbnailSupport;
|
||||
|
||||
@Override
|
||||
public ActionResponse hookBefore(final ActionRuntime runtime) { // application may override
|
||||
searchLogSupport = fessConfig.isSearchLog();
|
||||
favoriteSupport = fessConfig.isUserFavorite();
|
||||
thumbnailSupport = fessConfig.isThumbnailEnabled();
|
||||
runtime.registerData("searchLogSupport", searchLogSupport);
|
||||
runtime.registerData("favoriteSupport", favoriteSupport);
|
||||
runtime.registerData("thumbnailSupport", thumbnailSupport);
|
||||
if (fessConfig.isWebApiPopularWord()) {
|
||||
runtime.registerData("popularWords", popularWordHelper.getWordList(null, null, null, null, null));
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public class ScreenshotAction extends FessSearchAction {
|
|||
return true;
|
||||
}).orElse(null);
|
||||
final String url = DocumentUtil.getValue(doc, fessConfig.getIndexFieldUrl(), String.class);
|
||||
if (StringUtil.isBlank(form.queryId) || StringUtil.isBlank(url) || screenShotManager == null) {
|
||||
if (StringUtil.isBlank(form.queryId) || StringUtil.isBlank(url) || !thumbnailSupport) {
|
||||
// 404
|
||||
throw404("Screenshot for " + form.docId + " is not found.");
|
||||
return null;
|
||||
|
|
|
@ -127,11 +127,11 @@ public class SearchAction extends FessSearchAction {
|
|||
return asHtml(path_SearchJsp).renderWith(data -> {
|
||||
renderData.register(data);
|
||||
// favorite or screenshot
|
||||
if (favoriteSupport || screenShotManager != null) {
|
||||
if (favoriteSupport || thumbnailSupport) {
|
||||
final String queryId = renderData.getQueryId();
|
||||
final List<Map<String, Object>> documentItems = renderData.getDocumentItems();
|
||||
userInfoHelper.storeQueryId(queryId, documentItems);
|
||||
if (screenShotManager != null) {
|
||||
if (thumbnailSupport) {
|
||||
screenShotManager.storeRequest(queryId, documentItems);
|
||||
RenderDataUtil.register(data, "screenShotSupport", true);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue