Add search option for dataconfig
This commit is contained in:
parent
df51fdcdc0
commit
36f59b5729
6 changed files with 74 additions and 6 deletions
|
@ -60,6 +60,8 @@ public class DataConfigPager implements Serializable {
|
|||
|
||||
public String versionNo;
|
||||
|
||||
public String description;
|
||||
|
||||
public void clear() {
|
||||
allRecordCount = 0;
|
||||
allPageCount = 0;
|
||||
|
@ -77,6 +79,7 @@ public class DataConfigPager implements Serializable {
|
|||
createdBy = null;
|
||||
createdTime = null;
|
||||
versionNo = null;
|
||||
description = null;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.List;
|
|||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.core.beans.util.BeanUtil;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.app.pager.DataConfigPager;
|
||||
import org.codelibs.fess.es.config.cbean.DataConfigCB;
|
||||
|
@ -74,8 +75,14 @@ public class DataConfigService {
|
|||
}
|
||||
|
||||
protected void setupListCondition(final DataConfigCB cb, final DataConfigPager dataConfigPager) {
|
||||
if (dataConfigPager.id != null) {
|
||||
cb.query().docMeta().setId_Equal(dataConfigPager.id);
|
||||
if (StringUtil.isNotBlank(dataConfigPager.name)) {
|
||||
cb.query().setName_Wildcard(dataConfigPager.name);
|
||||
}
|
||||
if (StringUtil.isNotBlank(dataConfigPager.handlerName)) {
|
||||
cb.query().setHandlerName_Wildcard(dataConfigPager.handlerName);
|
||||
}
|
||||
if (StringUtil.isNotBlank(dataConfigPager.description)) {
|
||||
cb.query().setDescription_Wildcard(dataConfigPager.description);
|
||||
}
|
||||
// TODO Long, Integer, String supported only.
|
||||
|
||||
|
|
|
@ -112,9 +112,10 @@ public class AdminDataconfigAction extends FessAdminAction {
|
|||
|
||||
protected void searchPaging(final RenderData data, final SearchForm form) {
|
||||
RenderDataUtil.register(data, "dataConfigItems", dataConfigService.getDataConfigList(dataConfigPager)); // page navi
|
||||
registerHandlerNames(data);
|
||||
|
||||
// restore from pager
|
||||
copyBeanToBean(dataConfigPager, form, op -> op.include("id"));
|
||||
copyBeanToBean(dataConfigPager, form, op -> op.include("name", "handlerName", "description"));
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
|
@ -352,9 +353,10 @@ public class AdminDataconfigAction extends FessAdminAction {
|
|||
private HtmlResponse asListHtml() {
|
||||
return asHtml(path_AdminDataconfig_AdminDataconfigJsp).renderWith(data -> {
|
||||
RenderDataUtil.register(data, "dataConfigItems", dataConfigService.getDataConfigList(dataConfigPager));
|
||||
registerHandlerNames(data);
|
||||
}).useForm(SearchForm.class, setup -> {
|
||||
setup.setup(form -> {
|
||||
copyBeanToBean(dataConfigPager, form, op -> op.include("id"));
|
||||
copyBeanToBean(dataConfigPager, form, op -> op.include("name", "handlerName", "description"));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -21,5 +21,10 @@ package org.codelibs.fess.app.web.admin.dataconfig;
|
|||
*/
|
||||
public class SearchForm {
|
||||
|
||||
public String id;
|
||||
public String name;
|
||||
|
||||
public String handlerName;
|
||||
|
||||
public String description;
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,11 @@ package org.codelibs.fess.app.web.api.admin.dataconfig;
|
|||
import org.codelibs.fess.app.web.api.admin.BaseSearchBody;
|
||||
|
||||
public class SearchBody extends BaseSearchBody {
|
||||
public String id;
|
||||
|
||||
public String name;
|
||||
|
||||
public String handlerName;
|
||||
|
||||
public String description;
|
||||
|
||||
}
|
||||
|
|
|
@ -36,6 +36,52 @@
|
|||
</la:info>
|
||||
<la:errors />
|
||||
</div>
|
||||
<la:form action="/admin/dataconfig/"
|
||||
styleClass="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label"><la:message
|
||||
key="labels.name" /></label>
|
||||
<div class="col-sm-10">
|
||||
<la:text styleId="name" property="name" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="handlerName" class="col-sm-2 control-label"><la:message
|
||||
key="labels.handler_name" /></label>
|
||||
<div class="col-sm-10">
|
||||
<la:errors property="handlerName" />
|
||||
<la:select styleId="handlerName" property="handlerName" size="1"
|
||||
styleClass="form-control">
|
||||
<la:option value="" />
|
||||
<c:forEach var="hn" varStatus="s"
|
||||
items="${handlerNameItems}">
|
||||
<la:option value="${f:u(hn.value)}">${f:h(hn.label)}</la:option>
|
||||
</c:forEach>
|
||||
</la:select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="description" class="col-sm-2 control-label"><la:message
|
||||
key="labels.description" /></label>
|
||||
<div class="col-sm-10">
|
||||
<la:text styleId="description" property="description" styleClass="form-control" />
|
||||
</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" />">
|
||||
<em class="fa fa-search"></em>
|
||||
<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="${dataConfigPager.allRecordCount == 0}">
|
||||
<div class="row top10">
|
||||
|
|
Loading…
Add table
Reference in a new issue