Browse Source

modify boostdocumentrule action

Shinsuke Sugaya 10 years ago
parent
commit
04a8281aac

+ 0 - 2
pom.xml

@@ -146,9 +146,7 @@
 						<exclude>org/codelibs/fess/app/web/admin/LabelTypeForm.java</exclude>
 						<exclude>org/codelibs/fess/app/web/admin/FileConfigForm.java</exclude>
 						<exclude>org/codelibs/fess/app/web/admin/CrawlForm.java</exclude>
-						<exclude>org/codelibs/fess/app/web/admin/BoostDocumentRuleAction.java</exclude>
 						<exclude>org/codelibs/fess/app/web/admin/WizardForm.java</exclude>
-						<exclude>org/codelibs/fess/app/web/admin/BoostDocumentRuleForm.java</exclude>
 						<exclude>org/codelibs/fess/app/web/admin/FailureUrlForm.java</exclude>
 						<exclude>org/codelibs/fess/app/web/admin/FileAuthenticationForm.java</exclude>
 						<exclude>org/codelibs/fess/app/web/admin/RequestHeaderAction.java</exclude>

+ 0 - 323
src/main/java/org/codelibs/fess/app/web/admin/BoostDocumentRuleAction.java

@@ -1,323 +0,0 @@
-/*
- * Copyright 2009-2015 the 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;
-
-import java.beans.Beans;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.Resource;
-
-import org.codelibs.core.beans.util.BeanUtil;
-import org.codelibs.core.lang.StringUtil;
-import org.codelibs.fess.annotation.Token;
-import org.codelibs.fess.app.web.base.FessAdminAction;
-import org.codelibs.fess.beans.FessBeans;
-import org.codelibs.fess.crud.CommonConstants;
-import org.codelibs.fess.crud.CrudMessageException;
-import org.codelibs.fess.crud.util.SAStrutsUtil;
-import org.codelibs.fess.es.exentity.BoostDocumentRule;
-import org.codelibs.fess.exception.SSCActionMessagesException;
-import org.codelibs.fess.helper.SystemHelper;
-import org.codelibs.fess.app.pager.BoostDocumentRulePager;
-import org.codelibs.fess.app.service.BoostDocumentRuleService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BoostDocumentRuleAction extends FessAdminAction {
-
-    private static final Logger logger = LoggerFactory.getLogger(BoostDocumentRuleAction.class);
-
-    // for list
-
-    public List<BoostDocumentRule> boostDocumentRuleItems;
-
-    // for edit/confirm/delete
-
-    //@ActionForm
-    @Resource
-    protected BoostDocumentRuleForm boostDocumentRuleForm;
-
-    @Resource
-    protected BoostDocumentRuleService boostDocumentRuleService;
-
-    @Resource
-    protected BoostDocumentRulePager boostDocumentRulePager;
-
-    @Resource
-    protected SystemHelper systemHelper;
-
-    public String getHelpLink() {
-        return systemHelper.getHelpLink("boostDocumentRule");
-    }
-
-    protected String displayList(final boolean redirect) {
-        // page navi
-        boostDocumentRuleItems = boostDocumentRuleService.getBoostDocumentRuleList(boostDocumentRulePager);
-
-        // restore from pager
-        BeanUtil.copyBeanToBean(boostDocumentRulePager, boostDocumentRuleForm.searchParams,
-                option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE));
-
-        if (redirect) {
-            return "index?redirect=true";
-        } else {
-            return "index.jsp";
-        }
-    }
-
-    //@Execute(validator = false, input = "error.jsp")
-    public String index() {
-        return displayList(false);
-    }
-
-    //@Execute(validator = false, input = "error.jsp", urlPattern = "list/{pageNumber}")
-    public String list() {
-        // page navi
-        if (StringUtil.isNotBlank(boostDocumentRuleForm.pageNumber)) {
-            try {
-                boostDocumentRulePager.setCurrentPageNumber(Integer.parseInt(boostDocumentRuleForm.pageNumber));
-            } catch (final NumberFormatException e) {
-                if (logger.isDebugEnabled()) {
-                    logger.debug("Invalid value: " + boostDocumentRuleForm.pageNumber, e);
-                }
-            }
-        }
-
-        return displayList(false);
-    }
-
-    //@Execute(validator = false, input = "error.jsp")
-    public String search() {
-        BeanUtil.copyBeanToBean(boostDocumentRuleForm.searchParams, boostDocumentRulePager,
-                option -> option.exclude(CommonConstants.PAGER_CONVERSION_RULE));
-
-        return displayList(false);
-    }
-
-    //@Execute(validator = false, input = "error.jsp")
-    public String reset() {
-        boostDocumentRulePager.clear();
-
-        return displayList(false);
-    }
-
-    //@Execute(validator = false, input = "error.jsp")
-    public String back() {
-        return displayList(false);
-    }
-
-    @Token(save = true, validate = false)
-    //@Execute(validator = false, input = "error.jsp")
-    public String editagain() {
-        return "edit.jsp";
-    }
-
-    //@Execute(validator = false, input = "error.jsp", urlPattern = "confirmpage/{crudMode}/{id}")
-    public String confirmpage() {
-        if (boostDocumentRuleForm.crudMode != CommonConstants.CONFIRM_MODE) {
-            throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.CONFIRM_MODE,
-                    boostDocumentRuleForm.crudMode });
-        }
-
-        loadBoostDocumentRule();
-
-        return "confirm.jsp";
-    }
-
-    @Token(save = true, validate = false)
-    //@Execute(validator = false, input = "error.jsp")
-    public String createpage() {
-        // page navi
-        boostDocumentRuleForm.initialize();
-        boostDocumentRuleForm.crudMode = CommonConstants.CREATE_MODE;
-
-        return "edit.jsp";
-    }
-
-    @Token(save = true, validate = false)
-    //@Execute(validator = false, input = "error.jsp", urlPattern = "editpage/{crudMode}/{id}")
-    public String editpage() {
-        if (boostDocumentRuleForm.crudMode != CommonConstants.EDIT_MODE) {
-            throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.EDIT_MODE,
-                    boostDocumentRuleForm.crudMode });
-        }
-
-        loadBoostDocumentRule();
-
-        return "edit.jsp";
-    }
-
-    @Token(save = true, validate = false)
-    //@Execute(validator = false, input = "error.jsp")
-    public String editfromconfirm() {
-        boostDocumentRuleForm.crudMode = CommonConstants.EDIT_MODE;
-
-        loadBoostDocumentRule();
-
-        return "edit.jsp";
-    }
-
-    @Token(save = false, validate = true, keep = true)
-    //@Execute(validator = true, input = "edit.jsp")
-    public String confirmfromcreate() {
-        return "confirm.jsp";
-    }
-
-    @Token(save = false, validate = true, keep = true)
-    //@Execute(validator = true, input = "edit.jsp")
-    public String confirmfromupdate() {
-        return "confirm.jsp";
-    }
-
-    @Token(save = true, validate = false)
-    //@Execute(validator = false, input = "error.jsp", urlPattern = "deletepage/{crudMode}/{id}")
-    public String deletepage() {
-        if (boostDocumentRuleForm.crudMode != CommonConstants.DELETE_MODE) {
-            throw new ActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE,
-                    boostDocumentRuleForm.crudMode });
-        }
-
-        loadBoostDocumentRule();
-
-        return "confirm.jsp";
-    }
-
-    @Token(save = true, validate = false)
-    //@Execute(validator = false, input = "error.jsp")
-    public String deletefromconfirm() {
-        boostDocumentRuleForm.crudMode = CommonConstants.DELETE_MODE;
-
-        loadBoostDocumentRule();
-
-        return "confirm.jsp";
-    }
-
-    @Token(save = false, validate = true)
-    //@Execute(validator = true, input = "edit.jsp")
-    public String create() {
-        try {
-            final BoostDocumentRule boostDocumentRule = createBoostDocumentRule();
-            boostDocumentRuleService.store(boostDocumentRule);
-            SAStrutsUtil.addSessionMessage("success.crud_create_crud_table");
-
-            return displayList(true);
-        } catch (final ActionMessagesException e) {
-            logger.error(e.getMessage(), e);
-            throw e;
-        } catch (final CrudMessageException e) {
-            logger.error(e.getMessage(), e);
-            throw new ActionMessagesException(e.getMessageId(), e.getArgs());
-        } catch (final Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new ActionMessagesException("errors.crud_failed_to_create_crud_table");
-        }
-    }
-
-    @Token(save = false, validate = true)
-    //@Execute(validator = true, input = "edit.jsp")
-    public String update() {
-        try {
-            final BoostDocumentRule boostDocumentRule = createBoostDocumentRule();
-            boostDocumentRuleService.store(boostDocumentRule);
-            SAStrutsUtil.addSessionMessage("success.crud_update_crud_table");
-
-            return displayList(true);
-        } catch (final ActionMessagesException e) {
-            logger.error(e.getMessage(), e);
-            throw e;
-        } catch (final CrudMessageException e) {
-            logger.error(e.getMessage(), e);
-            throw new ActionMessagesException(e.getMessageId(), e.getArgs());
-        } catch (final Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new ActionMessagesException("errors.crud_failed_to_update_crud_table");
-        }
-    }
-
-    protected Map<String, String> createKeyMap() {
-        final Map<String, String> keys = new HashMap<String, String>();
-
-        keys.put("id", boostDocumentRuleForm.id);
-
-        return keys;
-    }
-
-    protected void loadBoostDocumentRule() {
-
-        final BoostDocumentRule boostDocumentRule = boostDocumentRuleService.getBoostDocumentRule(createKeyMap());
-        if (boostDocumentRule == null) {
-            // throw an exception
-            throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { boostDocumentRuleForm.id });
-        }
-
-        BeanUtil.copyBeanToBean(boostDocumentRule, boostDocumentRuleForm, option -> option.exclude("searchParams", "mode"));
-    }
-
-    protected BoostDocumentRule createBoostDocumentRule() {
-        BoostDocumentRule boostDocumentRule;
-        final String username = systemHelper.getUsername();
-        final long currentTime = systemHelper.getCurrentTimeAsLong();
-        if (boostDocumentRuleForm.crudMode == CommonConstants.EDIT_MODE) {
-            boostDocumentRule = boostDocumentRuleService.getBoostDocumentRule(createKeyMap());
-            if (boostDocumentRule == null) {
-                // throw an exception
-                throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { boostDocumentRuleForm.id });
-            }
-        } else {
-            boostDocumentRule = new BoostDocumentRule();
-            boostDocumentRule.setCreatedBy(username);
-            boostDocumentRule.setCreatedTime(currentTime);
-        }
-        boostDocumentRule.setUpdatedBy(username);
-        boostDocumentRule.setUpdatedTime(currentTime);
-        BeanUtil.copyBeanToBean(boostDocumentRuleForm, boostDocumentRule, option -> option.exclude(CommonConstants.COMMON_CONVERSION_RULE));
-
-        return boostDocumentRule;
-    }
-
-    //@Execute(validator = false, input = "error.jsp")
-    public String delete() {
-        if (boostDocumentRuleForm.crudMode != CommonConstants.DELETE_MODE) {
-            throw new SSCActionMessagesException("errors.crud_invalid_mode", new Object[] { CommonConstants.DELETE_MODE,
-                    boostDocumentRuleForm.crudMode });
-        }
-
-        try {
-            final BoostDocumentRule boostDocumentRule = boostDocumentRuleService.getBoostDocumentRule(createKeyMap());
-            if (boostDocumentRule == null) {
-                // throw an exception
-                throw new SSCActionMessagesException("errors.crud_could_not_find_crud_table", new Object[] { boostDocumentRuleForm.id });
-            }
-
-            boostDocumentRuleService.delete(boostDocumentRule);
-            SAStrutsUtil.addSessionMessage("success.crud_delete_crud_table");
-
-            return displayList(true);
-        } catch (final ActionMessagesException e) {
-            logger.error(e.getMessage(), e);
-            throw e;
-        } catch (final CrudMessageException e) {
-            logger.error(e.getMessage(), e);
-            throw new SSCActionMessagesException(e, e.getMessageId(), e.getArgs());
-        } catch (final Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new SSCActionMessagesException(e, "errors.crud_failed_to_delete_crud_table");
-        }
-    }
-}

+ 273 - 0
src/main/java/org/codelibs/fess/app/web/admin/boostdocumentrule/AdminBoostdocumentruleAction.java

@@ -0,0 +1,273 @@
+/*
+ * Copyright 2009-2015 the 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.boostdocumentrule;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.annotation.Resource;
+
+import org.codelibs.fess.annotation.Token;
+import org.codelibs.fess.app.pager.BoostDocumentRulePager;
+import org.codelibs.fess.app.service.BoostDocumentRuleService;
+import org.codelibs.fess.app.web.base.FessAdminAction;
+import org.codelibs.fess.crud.CommonConstants;
+import org.codelibs.fess.es.exentity.BoostDocumentRule;
+import org.codelibs.fess.helper.SystemHelper;
+import org.lastaflute.web.Execute;
+import org.lastaflute.web.callback.ActionRuntime;
+import org.lastaflute.web.response.HtmlResponse;
+import org.lastaflute.web.response.render.RenderData;
+import org.lastaflute.web.validation.VaErrorHook;
+
+/**
+ * @author shinsuke
+ */
+public class AdminBoostdocumentruleAction extends FessAdminAction {
+
+    // ===================================================================================
+    //                                                                           Attribute
+    //                                                                           =========
+    @Resource
+    private BoostDocumentRuleService boostDocumentRuleService;
+    @Resource
+    private BoostDocumentRulePager boostDocumentRulePager;
+    @Resource
+    private SystemHelper systemHelper;
+
+    // ===================================================================================
+    //                                                                               Hook
+    //                                                                              ======
+    @Override
+    protected void setupHtmlData(ActionRuntime runtime) {
+        super.setupHtmlData(runtime);
+        runtime.registerData("helpLink", systemHelper.getHelpLink("boostDocumentRule"));
+    }
+
+    // ===================================================================================
+    //                                                                      Search Execute
+    //                                                                      ==============
+    @Execute
+    public HtmlResponse index(BoostDocumentRuleSearchForm form) {
+        return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> {
+            searchPaging(data, form);
+        });
+    }
+
+    @Execute
+    public HtmlResponse list(Integer pageNumber, BoostDocumentRuleSearchForm form) {
+        boostDocumentRulePager.setCurrentPageNumber(pageNumber);
+        return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> {
+            searchPaging(data, form);
+        });
+    }
+
+    @Execute
+    public HtmlResponse search(BoostDocumentRuleSearchForm form) {
+        copyBeanToBean(form.searchParams, boostDocumentRulePager, op -> op.exclude(CommonConstants.PAGER_CONVERSION_RULE));
+        return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> {
+            searchPaging(data, form);
+        });
+    }
+
+    @Execute
+    public HtmlResponse reset(BoostDocumentRuleSearchForm form) {
+        boostDocumentRulePager.clear();
+        return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> {
+            searchPaging(data, form);
+        });
+    }
+
+    @Execute
+    public HtmlResponse back(BoostDocumentRuleSearchForm form) {
+        return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> {
+            searchPaging(data, form);
+        });
+    }
+
+    protected void searchPaging(RenderData data, BoostDocumentRuleSearchForm form) {
+        data.register("boostDocumentRuleItems", boostDocumentRuleService.getBoostDocumentRuleList(boostDocumentRulePager)); // page navi
+
+        // restore from pager
+        copyBeanToBean(boostDocumentRulePager, form.searchParams, op -> op.exclude(CommonConstants.PAGER_CONVERSION_RULE));
+    }
+
+    // ===================================================================================
+    //                                                                        Edit Execute
+    //                                                                        ============
+    // -----------------------------------------------------
+    //                                            Entry Page
+    //                                            ----------
+    @Token(save = true, validate = false)
+    @Execute
+    public HtmlResponse createpage(BoostDocumentRuleEditForm form) {
+        form.crudMode = CommonConstants.CREATE_MODE;
+        return asHtml(path_AdminBoostdocumentrule_EditJsp);
+    }
+
+    @Token(save = true, validate = false)
+    @Execute
+    public HtmlResponse editpage(int crudMode, String id, BoostDocumentRuleEditForm form) {
+        form.crudMode = crudMode;
+        form.id = id;
+        verifyCrudMode(form, CommonConstants.EDIT_MODE);
+        loadBoostDocumentRule(form);
+        return asHtml(path_AdminBoostdocumentrule_EditJsp);
+    }
+
+    @Token(save = true, validate = false)
+    @Execute
+    public HtmlResponse editagain(BoostDocumentRuleEditForm form) {
+        return asHtml(path_AdminBoostdocumentrule_EditJsp);
+    }
+
+    @Token(save = true, validate = false)
+    @Execute
+    public HtmlResponse editfromconfirm(BoostDocumentRuleEditForm form) {
+        form.crudMode = CommonConstants.EDIT_MODE;
+        loadBoostDocumentRule(form);
+        return asHtml(path_AdminBoostdocumentrule_EditJsp);
+    }
+
+    @Token(save = true, validate = false)
+    @Execute
+    public HtmlResponse deletepage(int crudMode, String id, BoostDocumentRuleEditForm form) {
+        form.crudMode = crudMode;
+        form.id = id;
+        verifyCrudMode(form, CommonConstants.DELETE_MODE);
+        loadBoostDocumentRule(form);
+        return asHtml(path_AdminBoostdocumentrule_ConfirmJsp);
+    }
+
+    @Token(save = true, validate = false)
+    @Execute
+    public HtmlResponse deletefromconfirm(BoostDocumentRuleEditForm form) {
+        form.crudMode = CommonConstants.DELETE_MODE;
+        loadBoostDocumentRule(form);
+        return asHtml(path_AdminBoostdocumentrule_ConfirmJsp);
+    }
+
+    // -----------------------------------------------------
+    //                                               Confirm
+    //                                               -------
+    @Execute
+    public HtmlResponse confirmpage(int crudMode, String id, BoostDocumentRuleEditForm form) {
+        form.crudMode = crudMode;
+        form.id = id;
+        verifyCrudMode(form, CommonConstants.CONFIRM_MODE);
+        loadBoostDocumentRule(form);
+        return asHtml(path_AdminBoostdocumentrule_ConfirmJsp);
+    }
+
+    @Token(save = false, validate = true, keep = true)
+    @Execute
+    public HtmlResponse confirmfromcreate(BoostDocumentRuleEditForm form) {
+        validate(form, messages -> {}, toEditHtml());
+        return asHtml(path_AdminBoostdocumentrule_ConfirmJsp);
+    }
+
+    @Token(save = false, validate = true, keep = true)
+    @Execute
+    public HtmlResponse confirmfromupdate(BoostDocumentRuleEditForm form) {
+        validate(form, messages -> {}, toEditHtml());
+        return asHtml(path_AdminBoostdocumentrule_ConfirmJsp);
+    }
+
+    // -----------------------------------------------------
+    //                                         Actually Crud
+    //                                         -------------
+    @Token(save = false, validate = true)
+    @Execute
+    public HtmlResponse create(BoostDocumentRuleEditForm form) {
+        validate(form, messages -> {}, toEditHtml());
+        boostDocumentRuleService.store(createBoostDocumentRule(form));
+        saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
+        return redirect(getClass());
+    }
+
+    @Token(save = false, validate = true)
+    @Execute
+    public HtmlResponse update(BoostDocumentRuleEditForm form) {
+        validate(form, messages -> {}, toEditHtml());
+        boostDocumentRuleService.store(createBoostDocumentRule(form));
+        saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
+        return redirect(getClass());
+    }
+
+    @Execute
+    public HtmlResponse delete(BoostDocumentRuleEditForm form) {
+        verifyCrudMode(form, CommonConstants.DELETE_MODE);
+        boostDocumentRuleService.delete(getBoostDocumentRule(form));
+        saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
+        return redirect(getClass());
+    }
+
+    // ===================================================================================
+    //                                                                        Assist Logic
+    //                                                                        ============
+    protected void loadBoostDocumentRule(BoostDocumentRuleEditForm form) {
+        copyBeanToBean(getBoostDocumentRule(form), form, op -> op.exclude("crudMode"));
+    }
+
+    protected BoostDocumentRule getBoostDocumentRule(BoostDocumentRuleEditForm form) {
+        final BoostDocumentRule boostDocumentRule = boostDocumentRuleService.getBoostDocumentRule(createKeyMap(form));
+        if (boostDocumentRule == null) {
+            throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.id), toEditHtml());
+        }
+        return boostDocumentRule;
+    }
+
+    protected BoostDocumentRule createBoostDocumentRule(BoostDocumentRuleEditForm form) {
+        BoostDocumentRule boostDocumentRule;
+        final String username = systemHelper.getUsername();
+        final long currentTime = systemHelper.getCurrentTimeAsLong();
+        if (form.crudMode == CommonConstants.EDIT_MODE) {
+            boostDocumentRule = getBoostDocumentRule(form);
+        } else {
+            boostDocumentRule = new BoostDocumentRule();
+            boostDocumentRule.setCreatedBy(username);
+            boostDocumentRule.setCreatedTime(currentTime);
+        }
+        boostDocumentRule.setUpdatedBy(username);
+        boostDocumentRule.setUpdatedTime(currentTime);
+        copyBeanToBean(form, boostDocumentRule, op -> op.exclude(CommonConstants.COMMON_CONVERSION_RULE));
+        return boostDocumentRule;
+    }
+
+    protected Map<String, String> createKeyMap(BoostDocumentRuleEditForm form) {
+        final Map<String, String> keys = new HashMap<String, String>();
+        keys.put("id", form.id);
+        return keys;
+    }
+
+    // ===================================================================================
+    //                                                                        Small Helper
+    //                                                                        ============
+    protected void verifyCrudMode(BoostDocumentRuleEditForm form, int expectedMode) {
+        if (form.crudMode != expectedMode) {
+            throwValidationError(messages -> {
+                messages.addErrorsCrudInvalidMode(GLOBAL, String.valueOf(expectedMode), String.valueOf(form.crudMode));
+            }, toEditHtml());
+        }
+    }
+
+    protected VaErrorHook toEditHtml() {
+        return () -> {
+            return asHtml(path_AdminBoostdocumentrule_EditJsp);
+        };
+    }
+}

+ 9 - 14
src/main/java/org/codelibs/fess/app/web/admin/BoostDocumentRuleForm.java → src/main/java/org/codelibs/fess/app/web/admin/boostdocumentrule/BoostDocumentRuleEditForm.java

@@ -14,26 +14,23 @@
  * governing permissions and limitations under the License.
  */
 
-package org.codelibs.fess.app.web.admin;
+package org.codelibs.fess.app.web.admin.boostdocumentrule;
 
-import java.util.HashMap;
-import java.util.Map;
+import java.io.Serializable;
 
 import org.codelibs.fess.util.ComponentUtil;
 
-public class BoostDocumentRuleForm {
-    //@IntegerType
-    public String pageNumber;
+/**
+ * @author codelibs
+ * @author jflute
+ */
+public class BoostDocumentRuleEditForm implements Serializable {
 
-    public Map<String, String> searchParams = new HashMap<String, String>();
+    private static final long serialVersionUID = 1L;
 
     //@IntegerType
     public int crudMode;
 
-    public String getCurrentPageNumber() {
-        return pageNumber;
-    }
-
     //@Required(target = "confirmfromupdate,update,delete")
     //@Maxbytelength(maxbytelength = 1000)
     public String id;
@@ -70,7 +67,6 @@ public class BoostDocumentRuleForm {
     public String versionNo;
 
     public void initialize() {
-
         id = null;
         urlExpr = null;
         boostExpr = null;
@@ -83,5 +79,4 @@ public class BoostDocumentRuleForm {
 
         sortOrder = "0";
     }
-
-}
+}

+ 39 - 0
src/main/java/org/codelibs/fess/app/web/admin/boostdocumentrule/BoostDocumentRuleSearchForm.java

@@ -0,0 +1,39 @@
+/*
+ * Copyright 2009-2015 the 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.boostdocumentrule;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author codelibs
+ * @author jflute
+ */
+public class BoostDocumentRuleSearchForm implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    public Map<String, String> searchParams = new HashMap<String, String>();
+
+    //@IntegerType
+    public String pageNumber;
+
+    public String getCurrentPageNumber() {
+        return pageNumber;
+    }
+}

+ 3 - 3
src/main/webapp/WEB-INF/view/common/admin2/sidebar.jsp

@@ -90,12 +90,12 @@
 							<span><la:message key="labels.menu.key_match" /></span>
 						</la:link></li>
 
-					<li <c:if test="${param.menuType=='boostDocumentRule'}">class="active"</c:if>><todo:link
-							href="/admin/boostDocumentRule/index"
+					<li <c:if test="${param.menuType=='boostDocumentRule'}">class="active"</c:if>><la:link
+							href="/admin/boostdocumentrule/index"
 						>
 							<i class='fa fa-angle-right'></i>
 							<span><la:message key="labels.menu.boost_document_rule" /></span>
-						</todo:link></li>
+						</la:link></li>
 
 					<li <c:if test="${param.menuType=='pathMapping'}">class="active"</c:if>><todo:link
 							href="/admin/pathMapping/index"