Add search option for labeltype
This commit is contained in:
parent
36f59b5729
commit
4f1a4054c7
5 changed files with 47 additions and 6 deletions
|
@ -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.LabelTypePager;
|
||||
import org.codelibs.fess.es.config.cbean.LabelTypeCB;
|
||||
|
@ -68,8 +69,11 @@ public class LabelTypeService {
|
|||
}
|
||||
|
||||
protected void setupListCondition(final LabelTypeCB cb, final LabelTypePager labelTypePager) {
|
||||
if (labelTypePager.id != null) {
|
||||
cb.query().docMeta().setId_Equal(labelTypePager.id);
|
||||
if (StringUtil.isNotBlank(labelTypePager.name)) {
|
||||
cb.query().setName_Wildcard(labelTypePager.name);
|
||||
}
|
||||
if (StringUtil.isNotBlank(labelTypePager.value)) {
|
||||
cb.query().setValue_Wildcard(labelTypePager.value);
|
||||
}
|
||||
// TODO Long, Integer, String supported only.
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
RenderDataUtil.register(data, "labelTypeItems", labelTypeService.getLabelTypeList(labelTypePager)); // page navi
|
||||
|
||||
// restore from pager
|
||||
copyBeanToBean(labelTypePager, form, op -> op.include("id"));
|
||||
copyBeanToBean(labelTypePager, form, op -> op.include("name", "value"));
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
|
@ -330,7 +330,7 @@ public class AdminLabeltypeAction extends FessAdminAction {
|
|||
RenderDataUtil.register(data, "labelTypeItems", labelTypeService.getLabelTypeList(labelTypePager)); // page navi
|
||||
}).useForm(SearchForm.class, setup -> {
|
||||
setup.setup(form -> {
|
||||
copyBeanToBean(labelTypePager, form, op -> op.include("id"));
|
||||
copyBeanToBean(labelTypePager, form, op -> op.include("name", "value"));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -21,5 +21,8 @@ package org.codelibs.fess.app.web.admin.labeltype;
|
|||
*/
|
||||
public class SearchForm {
|
||||
|
||||
public String id;
|
||||
public String name;
|
||||
|
||||
public String value;
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,9 @@ package org.codelibs.fess.app.web.api.admin.labeltype;
|
|||
import org.codelibs.fess.app.web.api.admin.BaseSearchBody;
|
||||
|
||||
public class SearchBody extends BaseSearchBody {
|
||||
public String id;
|
||||
|
||||
public String name;
|
||||
|
||||
public String value;
|
||||
|
||||
}
|
||||
|
|
|
@ -36,6 +36,37 @@
|
|||
</la:info>
|
||||
<la:errors />
|
||||
</div>
|
||||
<la:form action="/admin/labeltype/"
|
||||
styleClass="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label"><la:message
|
||||
key="labels.labeltype_name" /></label>
|
||||
<div class="col-sm-10">
|
||||
<la:text styleId="name" property="name" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="value" class="col-sm-2 control-label"><la:message
|
||||
key="labels.labeltype_value" /></label>
|
||||
<div class="col-sm-10">
|
||||
<la:text styleId="value" property="value" 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="${labelTypePager.allRecordCount == 0}">
|
||||
<div class="row top10">
|
||||
|
|
Loading…
Add table
Reference in a new issue