#1749 add search log page
This commit is contained in:
parent
d8fb8b7c39
commit
42e2e19a5b
18 changed files with 808 additions and 0 deletions
138
src/main/java/org/codelibs/fess/app/pager/SearchLogPager.java
Normal file
138
src/main/java/org/codelibs/fess/app/pager/SearchLogPager.java
Normal file
|
@ -0,0 +1,138 @@
|
|||
/*
|
||||
* Copyright 2012-2018 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.app.pager;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.codelibs.fess.util.ComponentUtil;
|
||||
|
||||
public class SearchLogPager implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String LOG_TYPE_SEARCH = "search";
|
||||
|
||||
public static final String LOG_TYPE_CLICK = "click";
|
||||
|
||||
public static final String LOG_TYPE_FAVORITE = "favorite";
|
||||
|
||||
public static final int DEFAULT_PAGE_SIZE = 20;
|
||||
|
||||
public static final int DEFAULT_CURRENT_PAGE_NUMBER = 1;
|
||||
|
||||
private int allRecordCount;
|
||||
|
||||
private int allPageCount;
|
||||
|
||||
private boolean existPrePage;
|
||||
|
||||
private boolean existNextPage;
|
||||
|
||||
private List<Integer> pageNumberList;
|
||||
|
||||
private int pageSize;
|
||||
|
||||
private int currentPageNumber;
|
||||
|
||||
public String logType;
|
||||
|
||||
public String id;
|
||||
|
||||
public void clear() {
|
||||
allRecordCount = 0;
|
||||
allPageCount = 0;
|
||||
existPrePage = false;
|
||||
existNextPage = false;
|
||||
pageSize = getDefaultPageSize();
|
||||
currentPageNumber = getDefaultCurrentPageNumber();
|
||||
|
||||
id = null;
|
||||
logType = LOG_TYPE_SEARCH;
|
||||
|
||||
}
|
||||
|
||||
protected int getDefaultCurrentPageNumber() {
|
||||
return DEFAULT_CURRENT_PAGE_NUMBER;
|
||||
}
|
||||
|
||||
public int getAllRecordCount() {
|
||||
return allRecordCount;
|
||||
}
|
||||
|
||||
public void setAllRecordCount(final int allRecordCount) {
|
||||
this.allRecordCount = allRecordCount;
|
||||
}
|
||||
|
||||
public int getAllPageCount() {
|
||||
return allPageCount;
|
||||
}
|
||||
|
||||
public void setAllPageCount(final int allPageCount) {
|
||||
this.allPageCount = allPageCount;
|
||||
}
|
||||
|
||||
public boolean isExistPrePage() {
|
||||
return existPrePage;
|
||||
}
|
||||
|
||||
public void setExistPrePage(final boolean existPrePage) {
|
||||
this.existPrePage = existPrePage;
|
||||
}
|
||||
|
||||
public boolean isExistNextPage() {
|
||||
return existNextPage;
|
||||
}
|
||||
|
||||
public void setExistNextPage(final boolean existNextPage) {
|
||||
this.existNextPage = existNextPage;
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
if (pageSize <= 0) {
|
||||
pageSize = getDefaultPageSize();
|
||||
}
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(final int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public int getCurrentPageNumber() {
|
||||
if (currentPageNumber <= 0) {
|
||||
currentPageNumber = getDefaultCurrentPageNumber();
|
||||
}
|
||||
return currentPageNumber;
|
||||
}
|
||||
|
||||
public void setCurrentPageNumber(final int currentPageNumber) {
|
||||
this.currentPageNumber = currentPageNumber;
|
||||
}
|
||||
|
||||
public List<Integer> getPageNumberList() {
|
||||
return pageNumberList;
|
||||
}
|
||||
|
||||
public void setPageNumberList(final List<Integer> pageNumberList) {
|
||||
this.pageNumberList = pageNumberList;
|
||||
}
|
||||
|
||||
protected int getDefaultPageSize() {
|
||||
return ComponentUtil.getFessConfig().getPagingPageSizeAsInteger();
|
||||
}
|
||||
|
||||
}
|
|
@ -17,21 +17,64 @@ package org.codelibs.fess.app.service;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.core.beans.util.BeanUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.app.pager.SearchLogPager;
|
||||
import org.codelibs.fess.es.log.exbhv.ClickLogBhv;
|
||||
import org.codelibs.fess.es.log.exbhv.FavoriteLogBhv;
|
||||
import org.codelibs.fess.es.log.exbhv.SearchLogBhv;
|
||||
import org.codelibs.fess.helper.SystemHelper;
|
||||
import org.codelibs.fess.mylasta.direction.FessConfig;
|
||||
import org.dbflute.cbean.result.PagingResultBean;
|
||||
|
||||
public class SearchLogService {
|
||||
|
||||
@Resource
|
||||
private SearchLogBhv searchLogBhv;
|
||||
|
||||
@Resource
|
||||
private ClickLogBhv clickLogBhv;
|
||||
|
||||
@Resource
|
||||
private FavoriteLogBhv favoriteLogBhv;
|
||||
|
||||
@Resource
|
||||
private SystemHelper systemHelper;
|
||||
|
||||
@Resource
|
||||
protected FessConfig fessConfig;
|
||||
|
||||
public void deleteBefore(final int days) {
|
||||
searchLogBhv.queryDelete(cb -> {
|
||||
cb.query().setRequestedAt_LessEqual(systemHelper.getCurrentTimeAsLocalDateTime().minusDays(days));
|
||||
});
|
||||
}
|
||||
|
||||
public PagingResultBean<?> getSearchLogList(SearchLogPager pager) {
|
||||
final PagingResultBean<?> list;
|
||||
if (SearchLogPager.LOG_TYPE_CLICK.equalsIgnoreCase(pager.logType)) {
|
||||
list = clickLogBhv.selectPage(cb -> {
|
||||
cb.paging(pager.getPageSize(), pager.getCurrentPageNumber());
|
||||
cb.query().addOrderBy_RequestedAt_Desc();
|
||||
});
|
||||
} else if (SearchLogPager.LOG_TYPE_FAVORITE.equalsIgnoreCase(pager.logType)) {
|
||||
list = favoriteLogBhv.selectPage(cb -> {
|
||||
cb.paging(pager.getPageSize(), pager.getCurrentPageNumber());
|
||||
cb.query().addOrderBy_CreatedAt_Desc();
|
||||
});
|
||||
} else {
|
||||
list = searchLogBhv.selectPage(cb -> {
|
||||
cb.paging(pager.getPageSize(), pager.getCurrentPageNumber());
|
||||
cb.query().addOrderBy_RequestedAt_Desc();
|
||||
});
|
||||
}
|
||||
|
||||
// update pager
|
||||
BeanUtil.copyBeanToBean(list, pager, option -> option.include(Constants.PAGER_CONVERSION_RULE));
|
||||
pager.setPageNumberList(list.pageRange(op -> {
|
||||
op.rangeSize(fessConfig.getPagingPageRangeSizeAsInteger());
|
||||
}).createPageNumberList());
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,179 @@
|
|||
/*
|
||||
* Copyright 2012-2018 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.app.web.admin.searchlog;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.app.pager.SearchLogPager;
|
||||
import org.codelibs.fess.app.service.SearchLogService;
|
||||
import org.codelibs.fess.app.web.base.FessAdminAction;
|
||||
import org.codelibs.fess.util.RenderDataUtil;
|
||||
import org.lastaflute.web.Execute;
|
||||
import org.lastaflute.web.response.HtmlResponse;
|
||||
import org.lastaflute.web.response.render.RenderData;
|
||||
import org.lastaflute.web.ruts.process.ActionRuntime;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author shinsuke
|
||||
*/
|
||||
public class AdminSearchlogAction extends FessAdminAction {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AdminSearchlogAction.class);
|
||||
|
||||
// ===================================================================================
|
||||
// Attribute
|
||||
// =========
|
||||
@Resource
|
||||
private SearchLogService searchLogService;
|
||||
@Resource
|
||||
private SearchLogPager searchLogPager;
|
||||
|
||||
// ===================================================================================
|
||||
// Hook
|
||||
// ======
|
||||
@Override
|
||||
protected void setupHtmlData(final ActionRuntime runtime) {
|
||||
super.setupHtmlData(runtime);
|
||||
runtime.registerData("helpLink", systemHelper.getHelpLink(fessConfig.getOnlineHelpNameSearchlog()));
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Search Execute
|
||||
// ==============
|
||||
@Execute
|
||||
public HtmlResponse index() {
|
||||
saveToken();
|
||||
return asListHtml();
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse list(final Integer pageNumber, final SearchForm form) {
|
||||
saveToken();
|
||||
searchLogPager.setCurrentPageNumber(pageNumber);
|
||||
return asHtml(path_AdminSearchlog_AdminSearchlogJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse search(final SearchForm form) {
|
||||
saveToken();
|
||||
copyBeanToBean(form, searchLogPager, op -> op.exclude(Constants.PAGER_CONVERSION_RULE));
|
||||
return asHtml(path_AdminSearchlog_AdminSearchlogJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse reset(final SearchForm form) {
|
||||
saveToken();
|
||||
searchLogPager.clear();
|
||||
return asHtml(path_AdminSearchlog_AdminSearchlogJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
@Execute
|
||||
public HtmlResponse back(final SearchForm form) {
|
||||
saveToken();
|
||||
return asHtml(path_AdminSearchlog_AdminSearchlogJsp).renderWith(data -> {
|
||||
searchPaging(data, form);
|
||||
});
|
||||
}
|
||||
|
||||
protected void searchPaging(final RenderData data, final SearchForm form) {
|
||||
RenderDataUtil.register(data, "searchLogItems", searchLogService.getSearchLogList(searchLogPager)); // page navi
|
||||
|
||||
// restore from pager
|
||||
copyBeanToBean(searchLogPager, form, op -> op.include("logType"));
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Edit Execute
|
||||
// ============
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Details
|
||||
// -------
|
||||
// @Execute
|
||||
// public HtmlResponse details(final int crudMode, final String id) {
|
||||
// verifyCrudMode(crudMode, CrudMode.DETAILS);
|
||||
// saveToken();
|
||||
// return statsService.getCrawlingInfo(id).map(entity -> {
|
||||
// return asHtml(path_AdminCrawlinginfo_AdminCrawlinginfoDetailsJsp).useForm(EditForm.class, op -> {
|
||||
// op.setup(form -> {
|
||||
// copyBeanToBean(entity, form, copyOp -> {
|
||||
// copyOp.excludeNull();
|
||||
// });
|
||||
// form.crudMode = crudMode;
|
||||
// });
|
||||
// }).renderWith(data -> {
|
||||
// RenderDataUtil.register(data, "crawlingInfoParamItems", statsService.getCrawlingInfoParamList(id));
|
||||
// });
|
||||
// }).orElseGet(() -> {
|
||||
// throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), () -> asListHtml());
|
||||
// return null;
|
||||
// });
|
||||
// }
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Actually Crud
|
||||
// -------------
|
||||
|
||||
@Execute
|
||||
public HtmlResponse deleteall() {
|
||||
verifyToken(() -> asListHtml());
|
||||
searchLogPager.clear();
|
||||
saveInfo(messages -> messages.addSuccessCrawlingInfoDeleteAll(GLOBAL));
|
||||
return redirect(getClass());
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// Assist Logic
|
||||
// ============
|
||||
|
||||
// ===================================================================================
|
||||
// Small Helper
|
||||
// ============
|
||||
protected void verifyCrudMode(final int crudMode, final int expectedMode) {
|
||||
if (crudMode != expectedMode) {
|
||||
throwValidationError(messages -> {
|
||||
messages.addErrorsCrudInvalidMode(GLOBAL, String.valueOf(expectedMode), String.valueOf(crudMode));
|
||||
}, () -> asListHtml());
|
||||
}
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
// JSP
|
||||
// =========
|
||||
|
||||
private HtmlResponse asListHtml() {
|
||||
return asHtml(path_AdminSearchlog_AdminSearchlogJsp).renderWith(data -> {
|
||||
RenderDataUtil.register(data, "searchLogItems", searchLogService.getSearchLogList(searchLogPager)); // page navi
|
||||
}).useForm(SearchForm.class, setup -> {
|
||||
setup.setup(form -> {
|
||||
copyBeanToBean(searchLogPager, form, op -> op.include("id"));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private HtmlResponse asDetailsHtml() {
|
||||
return asHtml(path_AdminCrawlinginfo_AdminCrawlinginfoDetailsJsp);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* Copyright 2012-2018 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.app.web.admin.searchlog;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.lastaflute.web.validation.Required;
|
||||
import org.lastaflute.web.validation.theme.conversion.ValidateTypeFailure;
|
||||
|
||||
/**
|
||||
* @author shinsuke
|
||||
* @author Shunji Makino
|
||||
*/
|
||||
public class EditForm {
|
||||
|
||||
@ValidateTypeFailure
|
||||
public int crudMode;
|
||||
|
||||
@Required
|
||||
@Size(max = 10)
|
||||
public String logType;
|
||||
|
||||
@Required
|
||||
@Size(max = 1000)
|
||||
public String id;
|
||||
|
||||
@Required
|
||||
@Size(max = 20)
|
||||
public String sessionId;
|
||||
|
||||
@Size(max = 20)
|
||||
public String name;
|
||||
|
||||
public String expiredTime;
|
||||
|
||||
@ValidateTypeFailure
|
||||
public Long createdTime;
|
||||
|
||||
public void initialize() {
|
||||
|
||||
id = null;
|
||||
sessionId = null;
|
||||
name = null;
|
||||
expiredTime = null;
|
||||
createdTime = null;
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2012-2018 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.app.web.admin.searchlog;
|
||||
|
||||
/**
|
||||
* @author shinsuke
|
||||
*/
|
||||
public class SearchForm {
|
||||
|
||||
public String logType;
|
||||
|
||||
}
|
|
@ -52,6 +52,10 @@ public class ClickLog extends BsClickLog {
|
|||
fields.put(key, value);
|
||||
}
|
||||
|
||||
public String getLogMessage() {
|
||||
return getUrl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> toSource() {
|
||||
final Map<String, Object> sourceMap = super.toSource();
|
||||
|
|
|
@ -52,6 +52,14 @@ public class FavoriteLog extends BsFavoriteLog {
|
|||
fields.put(key, value);
|
||||
}
|
||||
|
||||
public String getLogMessage() {
|
||||
return getUrl();
|
||||
}
|
||||
|
||||
public LocalDateTime getRequestedAt() {
|
||||
return getCreatedAt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> toSource() {
|
||||
final Map<String, Object> sourceMap = super.toSource();
|
||||
|
|
|
@ -100,6 +100,10 @@ public class SearchLog extends BsSearchLog {
|
|||
fields.put(key, value);
|
||||
}
|
||||
|
||||
public String getLogMessage() {
|
||||
return getSearchWord();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> toSource() {
|
||||
final Map<String, Object> sourceMap = super.toSource();
|
||||
|
|
|
@ -316,6 +316,12 @@ public interface FessHtmlPath {
|
|||
/** The path of the HTML: /admin/searchlist/admin_searchlist_edit.jsp */
|
||||
HtmlNext path_AdminSearchlist_AdminSearchlistEditJsp = new HtmlNext("/admin/searchlist/admin_searchlist_edit.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/searchlog/admin_searchlog.jsp */
|
||||
HtmlNext path_AdminSearchlog_AdminSearchlogJsp = new HtmlNext("/admin/searchlog/admin_searchlog.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/searchlog/admin_searchlog_details.jsp */
|
||||
HtmlNext path_AdminSearchlog_AdminSearchlogDetailsJsp = new HtmlNext("/admin/searchlog/admin_searchlog_details.jsp");
|
||||
|
||||
/** The path of the HTML: /admin/suggest/admin_suggest.jsp */
|
||||
HtmlNext path_AdminSuggest_AdminSuggestJsp = new HtmlNext("/admin/suggest/admin_suggest.jsp");
|
||||
|
||||
|
|
|
@ -455,6 +455,9 @@ public class FessLabels extends UserMessages {
|
|||
/** The key of the message: Account Filter */
|
||||
public static final String LABELS_LDAP_ACCOUNT_FILTER = "{labels.ldapAccountFilter}";
|
||||
|
||||
/** The key of the message: Group Filter */
|
||||
public static final String LABELS_LDAP_GROUP_FILTER = "{labels.ldapGroupFilter}";
|
||||
|
||||
/** The key of the message: memberOf Attribute */
|
||||
public static final String LABELS_LDAP_MEMBEROF_ATTRIBUTE = "{labels.ldapMemberofAttribute}";
|
||||
|
||||
|
@ -2388,6 +2391,9 @@ public class FessLabels extends UserMessages {
|
|||
/** The key of the message: Account Filter */
|
||||
public static final String LABELS_ldap_account_filter = "{labels.ldap_account_filter}";
|
||||
|
||||
/** The key of the message: Group Filter */
|
||||
public static final String LABELS_ldap_group_filter = "{labels.ldap_group_filter}";
|
||||
|
||||
/** The key of the message: memberOf Attribute */
|
||||
public static final String LABELS_ldap_memberof_attribute = "{labels.ldap_memberof_attribute}";
|
||||
|
||||
|
|
|
@ -1123,6 +1123,9 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
/** The key of the configuration. e.g. suggest */
|
||||
String ONLINE_HELP_NAME_SUGGEST = "online.help.name.suggest";
|
||||
|
||||
/** The key of the configuration. e.g. searchlog */
|
||||
String ONLINE_HELP_NAME_SEARCHLOG = "online.help.name.searchlog";
|
||||
|
||||
/** The key of the configuration. e.g. ja */
|
||||
String ONLINE_HELP_SUPPORTED_LANGS = "online.help.supported.langs";
|
||||
|
||||
|
@ -4981,6 +4984,13 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
*/
|
||||
String getOnlineHelpNameSuggest();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'online.help.name.searchlog'. <br>
|
||||
* The value is, e.g. searchlog <br>
|
||||
* @return The value of found property. (NotNull: if not found, exception but basically no way)
|
||||
*/
|
||||
String getOnlineHelpNameSearchlog();
|
||||
|
||||
/**
|
||||
* Get the value for the key 'online.help.supported.langs'. <br>
|
||||
* The value is, e.g. ja <br>
|
||||
|
@ -7737,6 +7747,10 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
return get(FessConfig.ONLINE_HELP_NAME_SUGGEST);
|
||||
}
|
||||
|
||||
public String getOnlineHelpNameSearchlog() {
|
||||
return get(FessConfig.ONLINE_HELP_NAME_SEARCHLOG);
|
||||
}
|
||||
|
||||
public String getOnlineHelpSupportedLangs() {
|
||||
return get(FessConfig.ONLINE_HELP_SUPPORTED_LANGS);
|
||||
}
|
||||
|
@ -8572,6 +8586,7 @@ public interface FessConfig extends FessEnv, org.codelibs.fess.mylasta.direction
|
|||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_ESREQ, "esreq");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_ACCESSTOKEN, "accesstoken");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_SUGGEST, "suggest");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_NAME_SEARCHLOG, "searchlog");
|
||||
defaultMap.put(FessConfig.ONLINE_HELP_SUPPORTED_LANGS, "ja");
|
||||
defaultMap.put(FessConfig.SUGGEST_POPULAR_WORD_SEED, "0");
|
||||
defaultMap.put(FessConfig.SUGGEST_POPULAR_WORD_TAGS, "");
|
||||
|
|
|
@ -572,6 +572,7 @@ online.help.name.upgrade=upgrade
|
|||
online.help.name.esreq=esreq
|
||||
online.help.name.accesstoken=accesstoken
|
||||
online.help.name.suggest=suggest
|
||||
online.help.name.searchlog=searchlog
|
||||
|
||||
online.help.supported.langs=ja
|
||||
|
||||
|
|
|
@ -179,6 +179,7 @@ labels.menu_system_info=Config Info
|
|||
labels.menu_crawling_info=Crawling Info
|
||||
labels.menu_log=Log Files
|
||||
labels.menu_jobLog=Job Log
|
||||
labels.menu_searchLog=Search Log
|
||||
labels.menu_failure_url=Failure URL
|
||||
labels.menu_search_list=Search
|
||||
labels.menu_backup=Back Up
|
||||
|
@ -909,3 +910,11 @@ labels.advance_search_timestamp_pastday=past 24 hours
|
|||
labels.advance_search_timestamp_pastweek=past week
|
||||
labels.advance_search_timestamp_pastmonth=past month
|
||||
labels.advance_search_timestamp_pastyear=past year
|
||||
labels.searchlog_configuration=Search Log
|
||||
labels.searchlog_title=Search Log
|
||||
labels.searchlog_log_type=Log Type
|
||||
labels.searchlog_log_type_search=Search Log
|
||||
labels.searchlog_log_type_click=Click Log
|
||||
labels.searchlog_log_type_favorite=Favorite Log
|
||||
labels.searchlog_log_message=Message
|
||||
labels.searchlog_requested_time=Time
|
||||
|
|
|
@ -179,6 +179,7 @@ labels.menu_system_info=Config Info
|
|||
labels.menu_crawling_info=Crawling Info
|
||||
labels.menu_log=Log Files
|
||||
labels.menu_jobLog=Job Log
|
||||
labels.menu_searchLog=Search Log
|
||||
labels.menu_failure_url=Failure URL
|
||||
labels.menu_search_list=Search
|
||||
labels.menu_backup=Back Up
|
||||
|
@ -909,3 +910,11 @@ labels.advance_search_timestamp_pastday=past 24 hours
|
|||
labels.advance_search_timestamp_pastweek=past week
|
||||
labels.advance_search_timestamp_pastmonth=past month
|
||||
labels.advance_search_timestamp_pastyear=past year
|
||||
labels.searchlog_configuration=Search Log
|
||||
labels.searchlog_title=Search Log
|
||||
labels.searchlog_log_type=Log Type
|
||||
labels.searchlog_log_type_search=Search Log
|
||||
labels.searchlog_log_type_click=Click Log
|
||||
labels.searchlog_log_type_favorite=Favorite Log
|
||||
labels.searchlog_log_message=Message
|
||||
labels.searchlog_requested_time=Time
|
||||
|
|
|
@ -171,6 +171,7 @@ labels.menu_system_info=設定情報
|
|||
labels.menu_crawling_info=クロール情報
|
||||
labels.menu_log=ログファイル
|
||||
labels.menu_jobLog=ジョブログ
|
||||
labels.menu_searchLog=検索ログ
|
||||
labels.menu_failure_url=障害URL
|
||||
labels.menu_search_list=検索
|
||||
labels.menu_backup=バックアップ
|
||||
|
@ -911,3 +912,11 @@ labels.advance_search_timestamp_pastday=24時間以内
|
|||
labels.advance_search_timestamp_pastweek=1週間以内
|
||||
labels.advance_search_timestamp_pastmonth=1ヶ月以内
|
||||
labels.advance_search_timestamp_pastyear=1年以内
|
||||
labels.searchlog_configuration=検索ログ
|
||||
labels.searchlog_title=検索ログ
|
||||
labels.searchlog_log_type=ログ種別
|
||||
labels.searchlog_log_type_search=検索ログ
|
||||
labels.searchlog_log_type_click=クリックログ
|
||||
labels.searchlog_log_type_favorite=お気に入りログ
|
||||
labels.searchlog_log_message=メッセージ
|
||||
labels.searchlog_requested_time=時刻
|
||||
|
|
125
src/main/webapp/WEB-INF/view/admin/searchlog/admin_searchlog.jsp
Normal file
125
src/main/webapp/WEB-INF/view/admin/searchlog/admin_searchlog.jsp
Normal file
|
@ -0,0 +1,125 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><la:message key="labels.admin_brand_title" /> | <la:message
|
||||
key="labels.searchlog_configuration" /></title>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/head.jsp"></jsp:include>
|
||||
</head>
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<jsp:include page="/WEB-INF/view/common/admin/header.jsp"></jsp:include>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/sidebar.jsp">
|
||||
<jsp:param name="menuCategoryType" value="log" />
|
||||
<jsp:param name="menuType" value="searchLog" />
|
||||
</jsp:include>
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<la:message key="labels.searchlog_configuration" />
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li class="active"><la:link href="/admin/searchlog">
|
||||
<la:message key="labels.searchlog_title" />
|
||||
</la:link></li>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">
|
||||
<la:message key="labels.searchlog_title" />
|
||||
</h3>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<%-- Message --%>
|
||||
<div>
|
||||
<la:info id="msg" message="true">
|
||||
<div class="alert alert-info">${msg}</div>
|
||||
</la:info>
|
||||
<la:errors />
|
||||
</div>
|
||||
<la:form action="/admin/searchlog/"
|
||||
styleClass="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="logTypeSearch" class="col-sm-2 control-label"><la:message
|
||||
key="labels.searchlog_log_type" /></label>
|
||||
<div class="col-sm-4">
|
||||
<la:select styleId="logTypeSearch" property="logType"
|
||||
styleClass="form-control">
|
||||
<la:option value="search"><la:message key="labels.searchlog_log_type_search" /></la:option>
|
||||
<la:option value="click"><la:message key="labels.searchlog_log_type_click" /></la:option>
|
||||
<la:option value="favorite"><la:message key="labels.searchlog_log_type_favorite" /></la:option>
|
||||
</la:select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-primary" id="submit"
|
||||
name="search"
|
||||
value="<la:message key="labels.crud_button_search" />">
|
||||
<i class="fa fa-search"></i>
|
||||
<la:message key="labels.crud_button_search" />
|
||||
</button>
|
||||
<button type="submit" class="btn btn-default" name="reset"
|
||||
value="<la:message key="labels.crud_button_reset" />">
|
||||
<la:message key="labels.crud_button_reset" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</la:form>
|
||||
<%-- List --%>
|
||||
<c:if test="${searchLogPager.allRecordCount == 0}">
|
||||
<div class="row top20">
|
||||
<div class="col-sm-12">
|
||||
<i class="fa fa-info-circle text-light-blue"></i>
|
||||
<la:message key="labels.list_could_not_find_crud_table" />
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${searchLogPager.allRecordCount > 0}">
|
||||
<div class="row top10">
|
||||
<div class="col-sm-12">
|
||||
<table class="table table-bordered table-striped dataTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-3"><la:message
|
||||
key="labels.searchlog_requested_time" /></th>
|
||||
<th><la:message
|
||||
key="labels.searchlog_log_message" /></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach var="data" varStatus="s"
|
||||
items="${searchLogItems}">
|
||||
<tr
|
||||
data-href="${contextPath}/admin/searchlog/details/4/${f:u(logType)}/${f:u(data.id)}">
|
||||
<td>${f:h(data.requestedAt)}</td>
|
||||
<td>${f:h(data.logMessage)}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<c:set var="pager" value="${searchLogPager}"
|
||||
scope="request" />
|
||||
<c:import url="/WEB-INF/view/common/admin/crud/pagination.jsp" />
|
||||
</c:if>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/footer.jsp"></jsp:include>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/foot.jsp"></jsp:include>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,160 @@
|
|||
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%><!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title><la:message key="labels.admin_brand_title" /> | <la:message
|
||||
key="labels.crawling_info_configuration" /></title>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/head.jsp"></jsp:include>
|
||||
</head>
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<jsp:include page="/WEB-INF/view/common/admin/header.jsp"></jsp:include>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/sidebar.jsp">
|
||||
<jsp:param name="menuCategoryType" value="log" />
|
||||
<jsp:param name="menuType" value="crawlingInfo" />
|
||||
</jsp:include>
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<la:message key="labels.crawling_info_title_confirm" />
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><la:link href="/admin/crawlinginfo">
|
||||
<la:message key="labels.crawling_info_link_top" />
|
||||
</la:link></li>
|
||||
<c:if test="${crudMode == 4}">
|
||||
<li class="active"><la:message
|
||||
key="labels.crawling_info_link_details" /></li>
|
||||
</c:if>
|
||||
</ol>
|
||||
</section>
|
||||
<section class="content">
|
||||
<la:form action="/admin/crawlinginfo/">
|
||||
<la:hidden property="crudMode" />
|
||||
<c:if test="${crudMode==4}">
|
||||
<la:hidden property="id" />
|
||||
</c:if>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div
|
||||
class="box <c:if test="${crudMode == 1}">box-success</c:if><c:if test="${crudMode == 2}">box-warning</c:if><c:if test="${crudMode == 3}">box-danger</c:if><c:if test="${crudMode == 4}">box-primary</c:if>">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">
|
||||
<c:if test="${crudMode == 1}">
|
||||
<la:message key="labels.crawling_info_link_create" />
|
||||
</c:if>
|
||||
<c:if test="${crudMode == 2}">
|
||||
<la:message key="labels.crawling_info_link_update" />
|
||||
</c:if>
|
||||
<c:if test="${crudMode == 3}">
|
||||
<la:message key="labels.crawling_info_link_delete" />
|
||||
</c:if>
|
||||
<c:if test="${crudMode == 4}">
|
||||
<la:message key="labels.crawling_info_link_details" />
|
||||
</c:if>
|
||||
</h3>
|
||||
<div class="btn-group pull-right">
|
||||
<la:link href="/admin/crawlinginfo"
|
||||
styleClass="btn btn-primary btn-xs">
|
||||
<la:message key="labels.crawling_info_link_top" />
|
||||
</la:link>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<%-- Message --%>
|
||||
<div>
|
||||
<la:info id="msg" message="true">
|
||||
<div class="alert alert-info">${msg}</div>
|
||||
</la:info>
|
||||
<la:errors />
|
||||
</div>
|
||||
<%-- Form Fields --%>
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><la:message
|
||||
key="labels.crawling_info_session_id" /></th>
|
||||
<td><a
|
||||
href="${fe:url('/admin/searchlist/search')}?q=segment:${f:u(sessionId)}">${f:h(sessionId)}</a>
|
||||
<la:hidden property="sessionId" /></td>
|
||||
</tr>
|
||||
<c:forEach var="info" items="${crawlingInfoParamItems}">
|
||||
<tr>
|
||||
<th>${f:h(info.keyMsg)}</th>
|
||||
<td>${f:h(info.value)}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-footer">
|
||||
<c:if test="${crudMode == 4}">
|
||||
<button type="submit" class="btn btn-default" name="back"
|
||||
value="<la:message key="labels.crawling_info_button_back" />">
|
||||
<i class="fa fa-arrow-circle-left"></i>
|
||||
<la:message key="labels.crawling_info_button_back" />
|
||||
</button>
|
||||
<button type="button" class="btn btn-danger" name="delete"
|
||||
data-toggle="modal" data-target="#confirmToDelete"
|
||||
value="<la:message key="labels.crawling_info_button_delete" />">
|
||||
<i class="fa fa-trash"></i>
|
||||
<la:message key="labels.crawling_info_button_delete" />
|
||||
</button>
|
||||
<div class="modal modal-danger fade" id="confirmToDelete"
|
||||
tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">
|
||||
<la:message key="labels.crud_title_delete" />
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>
|
||||
<la:message key="labels.crud_delete_confirmation" />
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-outline pull-left"
|
||||
data-dismiss="modal">
|
||||
<la:message key="labels.crud_button_cancel" />
|
||||
</button>
|
||||
<button type="submit" class="btn btn-outline btn-danger"
|
||||
name="delete"
|
||||
value="<la:message key="labels.crud_button_delete" />">
|
||||
<i class="fa fa-trash"></i>
|
||||
<la:message key="labels.crud_button_delete" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<c:if test="${running}">
|
||||
<button type="submit" class="btn btn-warning" name="threaddump"
|
||||
value="<la:message key="labels.crawling_info_thread_dump" />">
|
||||
<i class="fa fa-bolt"></i>
|
||||
<la:message key="labels.crawling_info_thread_dump" />
|
||||
</button>
|
||||
</c:if>
|
||||
</c:if>
|
||||
</div>
|
||||
<!-- /.box-footer -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
</la:form>
|
||||
</section>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/footer.jsp"></jsp:include>
|
||||
</div>
|
||||
<jsp:include page="/WEB-INF/view/common/admin/foot.jsp"></jsp:include>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -244,6 +244,12 @@
|
|||
<span><la:message key="labels.menu_system_info" /></span>
|
||||
</la:link></li>
|
||||
|
||||
<li <c:if test="${param.menuType=='searchLog'}">class="active"</c:if>><la:link
|
||||
href="/admin/searchlog/">
|
||||
<i class='fa fa-circle-o'></i>
|
||||
<span><la:message key="labels.menu_searchLog" /></span>
|
||||
</la:link></li>
|
||||
|
||||
<li <c:if test="${param.menuType=='jobLog'}">class="active"</c:if>><la:link
|
||||
href="/admin/joblog/">
|
||||
<i class='fa fa-circle-o'></i>
|
||||
|
|
Loading…
Add table
Reference in a new issue