diff --git a/src/main/java/org/codelibs/fess/app/web/CrudMode.java b/src/main/java/org/codelibs/fess/app/web/CrudMode.java index 063d9a502..00306457b 100644 --- a/src/main/java/org/codelibs/fess/app/web/CrudMode.java +++ b/src/main/java/org/codelibs/fess/app/web/CrudMode.java @@ -24,7 +24,7 @@ public class CrudMode { public static final int DELETE = 3; - public static final int CONFIRM = 4; + public static final int DETAILS = 4; protected CrudMode() { // nothing diff --git a/src/main/java/org/codelibs/fess/app/web/admin/boostdocumentrule/AdminBoostdocumentruleAction.java b/src/main/java/org/codelibs/fess/app/web/admin/boostdocumentrule/AdminBoostdocumentruleAction.java index 67109f811..06231de98 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/boostdocumentrule/AdminBoostdocumentruleAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/boostdocumentrule/AdminBoostdocumentruleAction.java @@ -25,9 +25,11 @@ import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.es.config.exentity.BoostDocumentRule; import org.codelibs.fess.helper.SystemHelper; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.validation.VaErrorHook; @@ -67,8 +69,12 @@ public class AdminBoostdocumentruleAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - boostDocumentRulePager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + boostDocumentRulePager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + boostDocumentRulePager.setCurrentPageNumber(0); + }); return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -90,13 +96,6 @@ public class AdminBoostdocumentruleAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminBoostdocumentrule_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("boostDocumentRuleItems", boostDocumentRuleService.getBoostDocumentRuleList(boostDocumentRulePager)); // page navi @@ -111,7 +110,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminBoostdocumentrule_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -121,86 +120,35 @@ public class AdminBoostdocumentruleAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminBoostdocumentrule_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - boostDocumentRuleService.getBoostDocumentRule(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminBoostdocumentrule_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminBoostdocumentrule_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminBoostdocumentrule_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminBoostdocumentrule_EditJsp; + break; + } final String id = form.id; boostDocumentRuleService.getBoostDocumentRule(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminBoostdocumentrule_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminBoostdocumentrule_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - boostDocumentRuleService.getBoostDocumentRule(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - boostDocumentRuleService.getBoostDocumentRule(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminBoostdocumentrule_ConfirmJsp); + return asHtml(next); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminBoostdocumentrule_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminBoostdocumentrule_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { boostDocumentRuleService.getBoostDocumentRule(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -214,24 +162,10 @@ public class AdminBoostdocumentruleAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminBoostdocumentrule_ConfirmJsp); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminBoostdocumentrule_ConfirmJsp); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -245,7 +179,7 @@ public class AdminBoostdocumentruleAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); diff --git a/src/main/java/org/codelibs/fess/app/web/admin/crawlingsession/AdminCrawlingsessionAction.java b/src/main/java/org/codelibs/fess/app/web/admin/crawlingsession/AdminCrawlingsessionAction.java index 815fa3a0f..e58f627db 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/crawlingsession/AdminCrawlingsessionAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/crawlingsession/AdminCrawlingsessionAction.java @@ -141,7 +141,7 @@ public class AdminCrawlingsessionAction extends FessAdminAction { // ------- @Execute public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); + verifyCrudMode(crudMode, CrudMode.DETAILS); return asHtml(path_AdminCrawlingsession_ConfirmJsp).useForm(EditForm.class, op -> { op.setup(form -> { crawlingSessionService.getCrawlingSession(id).ifPresent(entity -> { diff --git a/src/main/java/org/codelibs/fess/app/web/admin/dataconfig/AdminDataconfigAction.java b/src/main/java/org/codelibs/fess/app/web/admin/dataconfig/AdminDataconfigAction.java index 759397df0..6d563d742 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/dataconfig/AdminDataconfigAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/dataconfig/AdminDataconfigAction.java @@ -33,9 +33,11 @@ import org.codelibs.fess.ds.DataStoreFactory; import org.codelibs.fess.es.config.exentity.DataConfig; import org.codelibs.fess.helper.SystemHelper; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.validation.VaErrorHook; @@ -82,8 +84,12 @@ public class AdminDataconfigAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - dataConfigPager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + dataConfigPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + dataConfigPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminDataconfig_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -105,13 +111,6 @@ public class AdminDataconfigAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminDataconfig_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("dataConfigItems", dataConfigService.getDataConfigList(dataConfigPager)); // page navi @@ -126,7 +125,7 @@ public class AdminDataconfigAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminDataconfig_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -139,48 +138,19 @@ public class AdminDataconfigAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminDataconfig_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - dataConfigService.getDataConfig(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }).renderWith(data -> { - registerRolesAndLabels(data); - registerHandlerNames(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminDataconfig_EditJsp).renderWith(data -> { - registerRolesAndLabels(data); - registerHandlerNames(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminDataconfig_EditJsp).renderWith(data -> { - registerRolesAndLabels(data); - registerHandlerNames(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminDataconfig_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminDataconfig_EditJsp; + break; + } form.crudMode = CrudMode.EDIT; final String id = form.id; dataConfigService.getDataConfig(id).ifPresent(entity -> { @@ -188,55 +158,19 @@ public class AdminDataconfigAction extends FessAdminAction { }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminDataconfig_EditJsp).renderWith(data -> { - registerRolesAndLabels(data); - registerHandlerNames(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminDataconfig_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - dataConfigService.getDataConfig(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }).renderWith(data -> { - registerRolesAndLabels(data); - registerHandlerNames(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - dataConfigService.getDataConfig(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminDataconfig_ConfirmJsp).renderWith(data -> { + return asHtml(next).renderWith(data -> { registerRolesAndLabels(data); registerHandlerNames(data); }); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminDataconfig_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminDataconfig_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { dataConfigService.getDataConfig(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -253,30 +187,10 @@ public class AdminDataconfigAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminDataconfig_ConfirmJsp).renderWith(data -> { - registerRolesAndLabels(data); - registerHandlerNames(data); - }); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminDataconfig_ConfirmJsp).renderWith(data -> { - registerRolesAndLabels(data); - registerHandlerNames(data); - }); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -290,7 +204,7 @@ public class AdminDataconfigAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); @@ -306,7 +220,7 @@ public class AdminDataconfigAction extends FessAdminAction { @Execute public HtmlResponse delete(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.DELETE); + verifyCrudMode(form.crudMode, CrudMode.DETAILS); validate(form, messages -> {}, toEditHtml()); final String id = form.id; dataConfigService.getDataConfig(id).ifPresent(entity -> { diff --git a/src/main/java/org/codelibs/fess/app/web/admin/dict/kuromoji/AdminDictKuromojiAction.java b/src/main/java/org/codelibs/fess/app/web/admin/dict/kuromoji/AdminDictKuromojiAction.java index 3e2fa1bcc..6d32890e0 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/dict/kuromoji/AdminDictKuromojiAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/dict/kuromoji/AdminDictKuromojiAction.java @@ -33,10 +33,12 @@ import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.dict.kuromoji.KuromojiItem; import org.codelibs.fess.helper.SystemHelper; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.ActionResponse; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.validation.VaErrorHook; @@ -80,9 +82,13 @@ public class AdminDictKuromojiAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { validate(form, messages -> {}, toIndexHtml()); - kuromojiPager.setCurrentPageNumber(pageNumber); + pageNumber.ifPresent(num -> { + kuromojiPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + kuromojiPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminDictKuromoji_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -106,14 +112,6 @@ public class AdminDictKuromojiAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - validate(form, messages -> {}, toIndexHtml()); - return asHtml(path_AdminDictKuromoji_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { // page navi data.register("kuromojiItemItems", kuromojiService.getKuromojiList(form.dictId, kuromojiPager)); @@ -131,7 +129,7 @@ public class AdminDictKuromojiAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage(final String dictId) { + public HtmlResponse createnew(final String dictId) { return asHtml(path_AdminDictKuromoji_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -142,79 +140,34 @@ public class AdminDictKuromojiAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final String dictId, final int crudMode, final long id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminDictKuromoji_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - kuromojiService.getKuromojiItem(dictId, id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, dictId + ":" + id), toEditHtml()); - }); - form.crudMode = crudMode; - form.dictId = dictId; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminDictKuromoji_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminDictKuromoji_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminDictKuromoji_EditJsp; + break; + } kuromojiService.getKuromojiItem(form.dictId, form.id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.getDisplayId()), toEditHtml()); }); - return asHtml(path_AdminDictKuromoji_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final String dictId, final int crudMode, final long id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminDictKuromoji_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - kuromojiService.getKuromojiItem(dictId, id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, dictId + ":" + id), toEditHtml()); - }); - form.crudMode = crudMode; - form.dictId = dictId; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - kuromojiService.getKuromojiItem(form.dictId, form.id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.getDisplayId()), toEditHtml()); - }); - return asHtml(path_AdminDictKuromoji_ConfirmJsp); + return asHtml(next); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final String dictId, final int crudMode, final long id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminDictKuromoji_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final String dictId, final int crudMode, final long id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminDictKuromoji_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { kuromojiService.getKuromojiItem(dictId, id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -229,20 +182,6 @@ public class AdminDictKuromojiAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminDictKuromoji_ConfirmJsp); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminDictKuromoji_ConfirmJsp); - } - // ----------------------------------------------------- // Download // ------- @@ -315,7 +254,7 @@ public class AdminDictKuromojiAction extends FessAdminAction { // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -332,7 +271,7 @@ public class AdminDictKuromojiAction extends FessAdminAction { return redirectWith(getClass(), moreUrl("list/1").params("dictId", form.dictId)); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); diff --git a/src/main/java/org/codelibs/fess/app/web/admin/dict/synonym/AdminDictSynonymAction.java b/src/main/java/org/codelibs/fess/app/web/admin/dict/synonym/AdminDictSynonymAction.java index 835a2a5d9..748448870 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/dict/synonym/AdminDictSynonymAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/dict/synonym/AdminDictSynonymAction.java @@ -35,10 +35,12 @@ import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.dict.synonym.SynonymItem; import org.codelibs.fess.helper.SystemHelper; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.ActionResponse; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.validation.VaErrorHook; @@ -82,9 +84,13 @@ public class AdminDictSynonymAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { validate(form, messages -> {}, toIndexHtml()); - synonymPager.setCurrentPageNumber(pageNumber); + pageNumber.ifPresent(num -> { + synonymPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + synonymPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminDictSynonym_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -108,14 +114,6 @@ public class AdminDictSynonymAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - validate(form, messages -> {}, toIndexHtml()); - return asHtml(path_AdminDictSynonym_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { // page navi data.register("synonymItemItems", synonymService.getSynonymList(form.dictId, synonymPager)); @@ -133,7 +131,7 @@ public class AdminDictSynonymAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage(final String dictId) { + public HtmlResponse createnew(final String dictId) { return asHtml(path_AdminDictSynonym_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -144,9 +142,35 @@ public class AdminDictSynonymAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final String dictId, final int crudMode, final long id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminDictSynonym_EditJsp).useForm(EditForm.class, op -> { + public HtmlResponse edit(final EditForm form) { + validate(form, messages -> {}, toEditHtml()); + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminDictSynonym_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminDictSynonym_EditJsp; + break; + } + synonymService.getSynonymItem(form.dictId, form.id).ifPresent(entity -> { + form.inputs = entity.getInputsValue(); + form.outputs = entity.getOutputsValue(); + }).orElse(() -> { + throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.getDisplayId()), toEditHtml()); + }); + return asHtml(next); + } + + // ----------------------------------------------------- + // Details + // ------- + @Execute + public HtmlResponse details(final String dictId, final int crudMode, final long id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminDictSynonym_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { synonymService.getSynonymItem(dictId, id).ifPresent(entity -> { form.inputs = entity.getInputsValue(); @@ -161,87 +185,19 @@ public class AdminDictSynonymAction extends FessAdminAction { }); } - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminDictSynonym_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - synonymService.getSynonymItem(form.dictId, form.id).ifPresent(entity -> { - form.inputs = entity.getInputsValue(); - form.outputs = entity.getOutputsValue(); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.getDisplayId()), toEditHtml()); - }); - return asHtml(path_AdminDictSynonym_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final String dictId, final int crudMode, final long id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminDictSynonym_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - synonymService.getSynonymItem(dictId, id).ifPresent(entity -> { - form.inputs = entity.getInputsValue(); - form.outputs = entity.getOutputsValue(); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, dictId + ":" + id), toEditHtml()); - }); - form.id = id; - form.crudMode = crudMode; - form.dictId = dictId; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - synonymService.getSynonymItem(form.dictId, form.id).ifPresent(entity -> { - form.inputs = entity.getInputsValue(); - form.outputs = entity.getOutputsValue(); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, form.getDisplayId()), toEditHtml()); - }); - return asHtml(path_AdminDictSynonym_ConfirmJsp); - } - // ----------------------------------------------------- // Confirm // ------- - @Execute - public HtmlResponse confirmpage(final String dictId, final int crudMode, final long id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminDictSynonym_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - synonymService.getSynonymItem(dictId, id).ifPresent(entity -> { - form.inputs = entity.getInputsValue(); - form.outputs = entity.getOutputsValue(); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, dictId + ":" + id), toEditHtml()); - }); - form.id = id; - form.crudMode = crudMode; - form.dictId = dictId; - }); - }); - } @Execute(token = TxToken.VALIDATE_KEEP) public HtmlResponse confirmfromcreate(final CreateForm form) { validate(form, messages -> {}, toEditHtml()); form.crudMode = CrudMode.CREATE; final String[] newInputs = splitLine(form.inputs); - validateSynonymString(newInputs, () -> createpage(form.dictId)); + validateSynonymString(newInputs, () -> createnew(form.dictId)); final String[] newOutputs = splitLine(form.outputs); - validateSynonymString(newOutputs, () -> createpage(form.dictId)); - return asHtml(path_AdminDictSynonym_ConfirmJsp); + validateSynonymString(newOutputs, () -> createnew(form.dictId)); + return asHtml(path_AdminDictSynonym_DetailsJsp); } @Execute(token = TxToken.VALIDATE_KEEP) @@ -249,10 +205,10 @@ public class AdminDictSynonymAction extends FessAdminAction { validate(form, messages -> {}, toEditHtml()); form.crudMode = CrudMode.EDIT; final String[] newInputs = splitLine(form.inputs); - validateSynonymString(newInputs, () -> editpage(form.dictId, form.crudMode, form.id)); + validateSynonymString(newInputs, () -> edit(form)); final String[] newOutputs = splitLine(form.outputs); - validateSynonymString(newOutputs, () -> editpage(form.dictId, form.crudMode, form.id)); - return asHtml(path_AdminDictSynonym_ConfirmJsp); + validateSynonymString(newOutputs, () -> edit(form)); + return asHtml(path_AdminDictSynonym_DetailsJsp); } // ----------------------------------------------------- @@ -327,7 +283,7 @@ public class AdminDictSynonymAction extends FessAdminAction { // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -346,7 +302,7 @@ public class AdminDictSynonymAction extends FessAdminAction { return redirectWith(getClass(), moreUrl("list/1").params("dictId", form.dictId)); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); diff --git a/src/main/java/org/codelibs/fess/app/web/admin/fileauthentication/AdminFileauthenticationAction.java b/src/main/java/org/codelibs/fess/app/web/admin/fileauthentication/AdminFileauthenticationAction.java index c0332b2c2..a6d3526e6 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/fileauthentication/AdminFileauthenticationAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/fileauthentication/AdminFileauthenticationAction.java @@ -34,9 +34,11 @@ import org.codelibs.fess.es.config.exentity.FileConfig; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.util.ComponentUtil; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.util.LaRequestUtil; @@ -80,8 +82,12 @@ public class AdminFileauthenticationAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - fileAuthenticationPager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + fileAuthenticationPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + fileAuthenticationPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminFileauthentication_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -103,13 +109,6 @@ public class AdminFileauthenticationAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminFileauthentication_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("fileAuthenticationItems", fileAuthenticationService.getFileAuthenticationList(fileAuthenticationPager)); // page navi data.register("displayCreateLink", !fileConfigService.getAllFileConfigList(false, false, false, null).isEmpty()); @@ -124,7 +123,7 @@ public class AdminFileauthenticationAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminFileauthentication_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -137,104 +136,38 @@ public class AdminFileauthenticationAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminFileauthentication_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - fileAuthenticationService.getFileAuthentication(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }).renderWith(data -> { - registerProtocolSchemeItems(data); - registerFileConfigItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminFileauthentication_EditJsp).renderWith(data -> { - registerProtocolSchemeItems(data); - registerFileConfigItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminFileauthentication_EditJsp).renderWith(data -> { - registerProtocolSchemeItems(data); - registerFileConfigItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminFileauthentication_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminFileauthentication_EditJsp; + break; + } final String id = form.id; fileAuthenticationService.getFileAuthentication(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminFileauthentication_EditJsp).renderWith(data -> { - registerProtocolSchemeItems(data); - registerFileConfigItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminFileauthentication_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - fileAuthenticationService.getFileAuthentication(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }).renderWith(data -> { - registerProtocolSchemeItems(data); - registerFileConfigItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - fileAuthenticationService.getFileAuthentication(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminFileauthentication_ConfirmJsp).renderWith(data -> { + return asHtml(next).renderWith(data -> { registerProtocolSchemeItems(data); registerFileConfigItems(data); }); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminFileauthentication_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminFileauthentication_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { fileAuthenticationService.getFileAuthentication(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -251,30 +184,10 @@ public class AdminFileauthenticationAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminFileauthentication_ConfirmJsp).renderWith(data -> { - registerProtocolSchemeItems(data); - registerFileConfigItems(data); - }); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminFileauthentication_ConfirmJsp).renderWith(data -> { - registerProtocolSchemeItems(data); - registerFileConfigItems(data); - }); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -288,7 +201,7 @@ public class AdminFileauthenticationAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); diff --git a/src/main/java/org/codelibs/fess/app/web/admin/fileconfig/AdminFileconfigAction.java b/src/main/java/org/codelibs/fess/app/web/admin/fileconfig/AdminFileconfigAction.java index 83b0cd272..0e0f49ea4 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/fileconfig/AdminFileconfigAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/fileconfig/AdminFileconfigAction.java @@ -27,9 +27,11 @@ import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.es.config.exentity.FileConfig; import org.codelibs.fess.helper.SystemHelper; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.validation.VaErrorHook; @@ -74,8 +76,12 @@ public class AdminFileconfigAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - fileConfigPager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + fileConfigPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + fileConfigPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminFileconfig_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -97,13 +103,6 @@ public class AdminFileconfigAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminFileconfig_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("fileConfigItems", fileConfigService.getFileConfigList(fileConfigPager)); // page navi @@ -118,7 +117,7 @@ public class AdminFileconfigAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminFileconfig_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -130,98 +129,37 @@ public class AdminFileconfigAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminFileconfig_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - fileConfigService.getFileConfig(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }).renderWith(data -> { - registerRolesAndLabels(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminFileconfig_EditJsp).renderWith(data -> { - registerRolesAndLabels(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminFileconfig_EditJsp).renderWith(data -> { - registerRolesAndLabels(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminFileconfig_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminFileconfig_EditJsp; + break; + } final String id = form.id; fileConfigService.getFileConfig(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminFileconfig_EditJsp).renderWith(data -> { - registerRolesAndLabels(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminFileconfig_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - fileConfigService.getFileConfig(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }).renderWith(data -> { - registerRolesAndLabels(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - fileConfigService.getFileConfig(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminFileconfig_ConfirmJsp).renderWith(data -> { + return asHtml(next).renderWith(data -> { registerRolesAndLabels(data); }); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminFileconfig_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminFileconfig_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { fileConfigService.getFileConfig(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -237,28 +175,10 @@ public class AdminFileconfigAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminFileconfig_ConfirmJsp).renderWith(data -> { - registerRolesAndLabels(data); - }); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminFileconfig_ConfirmJsp).renderWith(data -> { - registerRolesAndLabels(data); - }); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -272,7 +192,7 @@ public class AdminFileconfigAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); @@ -288,7 +208,7 @@ public class AdminFileconfigAction extends FessAdminAction { @Execute public HtmlResponse delete(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.DELETE); + verifyCrudMode(form.crudMode, CrudMode.DETAILS); validate(form, messages -> {}, toEditHtml()); final String id = form.id; fileConfigService.getFileConfig(id).ifPresent(entity -> { diff --git a/src/main/java/org/codelibs/fess/app/web/admin/group/AdminGroupAction.java b/src/main/java/org/codelibs/fess/app/web/admin/group/AdminGroupAction.java index 700c0a68a..5c4b931a0 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/group/AdminGroupAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/group/AdminGroupAction.java @@ -27,9 +27,11 @@ import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.es.user.exentity.Group; import org.codelibs.fess.helper.SystemHelper; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.validation.VaErrorHook; @@ -70,8 +72,12 @@ public class AdminGroupAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - groupPager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + groupPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + groupPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminGroup_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -93,13 +99,6 @@ public class AdminGroupAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminGroup_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("groupItems", groupService.getGroupList(groupPager)); // page navi @@ -114,7 +113,7 @@ public class AdminGroupAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminGroup_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -124,86 +123,35 @@ public class AdminGroupAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminGroup_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - groupService.getGroup(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminGroup_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminGroup_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminGroup_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminGroup_EditJsp; + break; + } final String id = form.id; groupService.getGroup(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminGroup_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminGroup_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - groupService.getGroup(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - groupService.getGroup(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminGroup_ConfirmJsp); + return asHtml(next); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminGroup_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminGroup_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { groupService.getGroup(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -217,24 +165,10 @@ public class AdminGroupAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminGroup_ConfirmJsp); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminGroup_ConfirmJsp); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -249,7 +183,7 @@ public class AdminGroupAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); diff --git a/src/main/java/org/codelibs/fess/app/web/admin/joblog/AdminJoblogAction.java b/src/main/java/org/codelibs/fess/app/web/admin/joblog/AdminJoblogAction.java index 2ab1447df..e0c0220f2 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/joblog/AdminJoblogAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/joblog/AdminJoblogAction.java @@ -119,14 +119,14 @@ public class AdminJoblogAction extends FessAdminAction { form.id = id; verifyCrudMode(form, CrudMode.DELETE); loadJobLog(form); - return asHtml(path_AdminJoblog_ConfirmJsp); + return asHtml(path_AdminJoblog_DetailsJsp); } @Execute(token = TxToken.SAVE) public HtmlResponse deletefromconfirm(final JobLogEditForm form) { form.crudMode = CrudMode.DELETE; loadJobLog(form); - return asHtml(path_AdminJoblog_ConfirmJsp); + return asHtml(path_AdminJoblog_DetailsJsp); } // ----------------------------------------------------- @@ -136,9 +136,9 @@ public class AdminJoblogAction extends FessAdminAction { public HtmlResponse confirmpage(final int crudMode, final String id, final JobLogEditForm form) { form.crudMode = crudMode; form.id = id; - verifyCrudMode(form, CrudMode.CONFIRM); + verifyCrudMode(form, CrudMode.DETAILS); loadJobLog(form); - return asHtml(path_AdminJoblog_ConfirmJsp); + return asHtml(path_AdminJoblog_DetailsJsp); } // ----------------------------------------------------- diff --git a/src/main/java/org/codelibs/fess/app/web/admin/keymatch/AdminKeymatchAction.java b/src/main/java/org/codelibs/fess/app/web/admin/keymatch/AdminKeymatchAction.java index 6222fc4fb..c2a782949 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/keymatch/AdminKeymatchAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/keymatch/AdminKeymatchAction.java @@ -26,9 +26,11 @@ import org.codelibs.fess.es.config.exentity.KeyMatch; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.util.ComponentUtil; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.validation.VaErrorHook; @@ -69,8 +71,12 @@ public class AdminKeymatchAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - keyMatchPager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + keyMatchPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + keyMatchPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminKeymatch_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -92,13 +98,6 @@ public class AdminKeymatchAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminKeymatch_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("keyMatchItems", keyMatchService.getKeyMatchList(keyMatchPager)); // page navi @@ -113,7 +112,7 @@ public class AdminKeymatchAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminKeymatch_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -123,86 +122,35 @@ public class AdminKeymatchAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminKeymatch_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - keyMatchService.getKeyMatch(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminKeymatch_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminKeymatch_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminKeymatch_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminKeymatch_EditJsp; + break; + } final String id = form.id; keyMatchService.getKeyMatch(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminKeymatch_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminKeymatch_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - keyMatchService.getKeyMatch(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - form.crudMode = CrudMode.DELETE; - validate(form, messages -> {}, toEditHtml()); - final String id = form.id; - keyMatchService.getKeyMatch(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminKeymatch_ConfirmJsp); + return asHtml(next); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminKeymatch_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminKeymatch_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { keyMatchService.getKeyMatch(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -216,24 +164,10 @@ public class AdminKeymatchAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminKeymatch_ConfirmJsp); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminKeymatch_ConfirmJsp); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -248,7 +182,7 @@ public class AdminKeymatchAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); @@ -265,7 +199,7 @@ public class AdminKeymatchAction extends FessAdminAction { @Execute public HtmlResponse delete(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.DELETE); + verifyCrudMode(form.crudMode, CrudMode.DETAILS); validate(form, messages -> {}, toEditHtml()); final String id = form.id; keyMatchService.getKeyMatch(id).ifPresent(entity -> { diff --git a/src/main/java/org/codelibs/fess/app/web/admin/labeltype/AdminLabeltypeAction.java b/src/main/java/org/codelibs/fess/app/web/admin/labeltype/AdminLabeltypeAction.java index c8b4ceaa5..195fbb2bd 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/labeltype/AdminLabeltypeAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/labeltype/AdminLabeltypeAction.java @@ -26,9 +26,11 @@ import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.es.config.exentity.LabelType; import org.codelibs.fess.helper.SystemHelper; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.validation.VaErrorHook; @@ -72,8 +74,12 @@ public class AdminLabeltypeAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - labelTypePager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + labelTypePager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + labelTypePager.setCurrentPageNumber(0); + }); return asHtml(path_AdminLabeltype_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -95,13 +101,6 @@ public class AdminLabeltypeAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminLabeltype_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("labelTypeItems", labelTypeService.getLabelTypeList(labelTypePager)); // page navi @@ -116,7 +115,7 @@ public class AdminLabeltypeAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminLabeltype_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -128,98 +127,37 @@ public class AdminLabeltypeAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminLabeltype_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - labelTypeService.getLabelType(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }).renderWith(data -> { - registerRoleTypeItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminLabeltype_EditJsp).renderWith(data -> { - registerRoleTypeItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminLabeltype_EditJsp).renderWith(data -> { - registerRoleTypeItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminLabeltype_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminLabeltype_EditJsp; + break; + } final String id = form.id; labelTypeService.getLabelType(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminLabeltype_EditJsp).renderWith(data -> { - registerRoleTypeItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminLabeltype_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - labelTypeService.getLabelType(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }).renderWith(data -> { - registerRoleTypeItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - labelTypeService.getLabelType(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminLabeltype_ConfirmJsp).renderWith(data -> { + return asHtml(next).renderWith(data -> { registerRoleTypeItems(data); }); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminLabeltype_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminLabeltype_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { labelTypeService.getLabelType(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -235,28 +173,10 @@ public class AdminLabeltypeAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminLabeltype_ConfirmJsp).renderWith(data -> { - registerRoleTypeItems(data); - }); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminLabeltype_ConfirmJsp).renderWith(data -> { - registerRoleTypeItems(data); - }); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -270,7 +190,7 @@ public class AdminLabeltypeAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); @@ -286,7 +206,7 @@ public class AdminLabeltypeAction extends FessAdminAction { @Execute public HtmlResponse delete(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.DELETE); + verifyCrudMode(form.crudMode, CrudMode.DETAILS); validate(form, messages -> {}, toEditHtml()); final String id = form.id; labelTypeService.getLabelType(id).ifPresent(entity -> { diff --git a/src/main/java/org/codelibs/fess/app/web/admin/labeltype/CreateForm.java b/src/main/java/org/codelibs/fess/app/web/admin/labeltype/CreateForm.java index d09fa3b72..1c8860b8e 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/labeltype/CreateForm.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/labeltype/CreateForm.java @@ -50,15 +50,12 @@ public class CreateForm implements Serializable { @Pattern(regexp = "^[a-zA-Z0-9_-| ]+$") public String value; - @Required @Size(max = 4000) public String includedPaths; - @Required @Size(max = 4000) public String excludedPaths; - @Required @Min(value = 0) @Max(value = 2147483647) @Digits(integer = 10, fraction = 0) diff --git a/src/main/java/org/codelibs/fess/app/web/admin/overlappinghost/AdminOverlappinghostAction.java b/src/main/java/org/codelibs/fess/app/web/admin/overlappinghost/AdminOverlappinghostAction.java index c78cda328..24215cc57 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/overlappinghost/AdminOverlappinghostAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/overlappinghost/AdminOverlappinghostAction.java @@ -25,9 +25,11 @@ import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.es.config.exentity.OverlappingHost; import org.codelibs.fess.helper.SystemHelper; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.validation.VaErrorHook; @@ -68,8 +70,12 @@ public class AdminOverlappinghostAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - overlappingHostPager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + overlappingHostPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + overlappingHostPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminOverlappinghost_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -91,13 +97,6 @@ public class AdminOverlappinghostAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminOverlappinghost_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("overlappingHostItems", overlappingHostService.getOverlappingHostList(overlappingHostPager)); // page navi @@ -112,7 +111,7 @@ public class AdminOverlappinghostAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminOverlappinghost_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -122,86 +121,35 @@ public class AdminOverlappinghostAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminOverlappinghost_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - overlappingHostService.getOverlappingHost(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminOverlappinghost_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminOverlappinghost_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminOverlappinghost_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminOverlappinghost_EditJsp; + break; + } final String id = form.id; overlappingHostService.getOverlappingHost(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminOverlappinghost_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminOverlappinghost_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - overlappingHostService.getOverlappingHost(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - overlappingHostService.getOverlappingHost(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminOverlappinghost_ConfirmJsp); + return asHtml(next); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminOverlappinghost_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminOverlappinghost_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { overlappingHostService.getOverlappingHost(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -215,24 +163,10 @@ public class AdminOverlappinghostAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminOverlappinghost_ConfirmJsp); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminOverlappinghost_ConfirmJsp); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -246,7 +180,7 @@ public class AdminOverlappinghostAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); diff --git a/src/main/java/org/codelibs/fess/app/web/admin/pathmapping/AdminPathmappingAction.java b/src/main/java/org/codelibs/fess/app/web/admin/pathmapping/AdminPathmappingAction.java index 99a0f5508..071357df8 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/pathmapping/AdminPathmappingAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/pathmapping/AdminPathmappingAction.java @@ -25,9 +25,11 @@ import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.es.config.exentity.PathMapping; import org.codelibs.fess.helper.SystemHelper; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.validation.VaErrorHook; @@ -69,8 +71,12 @@ public class AdminPathmappingAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - pathMappingPager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + pathMappingPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + pathMappingPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminPathmapping_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -92,13 +98,6 @@ public class AdminPathmappingAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminPathmapping_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("pathMappingItems", pathMappingService.getPathMappingList(pathMappingPager)); // page navi @@ -113,7 +112,7 @@ public class AdminPathmappingAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminPathmapping_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -123,86 +122,35 @@ public class AdminPathmappingAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminPathmapping_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - pathMappingService.getPathMapping(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminPathmapping_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminPathmapping_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminPathmapping_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminPathmapping_EditJsp; + break; + } final String id = form.id; pathMappingService.getPathMapping(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminPathmapping_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminPathmapping_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - pathMappingService.getPathMapping(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - pathMappingService.getPathMapping(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminPathmapping_ConfirmJsp); + return asHtml(next); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminPathmapping_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminPathmapping_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { pathMappingService.getPathMapping(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -216,24 +164,10 @@ public class AdminPathmappingAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminPathmapping_ConfirmJsp); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminPathmapping_ConfirmJsp); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -247,7 +181,7 @@ public class AdminPathmappingAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); diff --git a/src/main/java/org/codelibs/fess/app/web/admin/requestheader/AdminRequestheaderAction.java b/src/main/java/org/codelibs/fess/app/web/admin/requestheader/AdminRequestheaderAction.java index 47dfb3c73..152845b76 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/requestheader/AdminRequestheaderAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/requestheader/AdminRequestheaderAction.java @@ -34,9 +34,11 @@ import org.codelibs.fess.es.config.exentity.WebConfig; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.util.ComponentUtil; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.util.LaRequestUtil; @@ -81,8 +83,12 @@ public class AdminRequestheaderAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - requestHeaderPager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + requestHeaderPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + requestHeaderPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminRequestheader_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -104,13 +110,6 @@ public class AdminRequestheaderAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminRequestheader_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("requestHeaderItems", requestHeaderService.getRequestHeaderList(requestHeaderPager)); // page navi data.register("displayCreateLink", !webConfigService.getAllWebConfigList(false, false, false, null).isEmpty()); @@ -126,7 +125,7 @@ public class AdminRequestheaderAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminRequestheader_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -139,104 +138,38 @@ public class AdminRequestheaderAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminRequestheader_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - requestHeaderService.getRequestHeader(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }).renderWith(data -> { - registerProtocolSchemeItems(data); - registerWebConfigItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminRequestheader_EditJsp).renderWith(data -> { - registerProtocolSchemeItems(data); - registerWebConfigItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminRequestheader_EditJsp).renderWith(data -> { - registerProtocolSchemeItems(data); - registerWebConfigItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminRequestheader_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminRequestheader_EditJsp; + break; + } final String id = form.id; requestHeaderService.getRequestHeader(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminRequestheader_EditJsp).renderWith(data -> { - registerProtocolSchemeItems(data); - registerWebConfigItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminRequestheader_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - requestHeaderService.getRequestHeader(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }).renderWith(data -> { - registerProtocolSchemeItems(data); - registerWebConfigItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - requestHeaderService.getRequestHeader(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminRequestheader_ConfirmJsp).renderWith(data -> { + return asHtml(next).renderWith(data -> { registerProtocolSchemeItems(data); registerWebConfigItems(data); }); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminRequestheader_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminRequestheader_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { requestHeaderService.getRequestHeader(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -253,30 +186,10 @@ public class AdminRequestheaderAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminRequestheader_ConfirmJsp).renderWith(data -> { - registerProtocolSchemeItems(data); - registerWebConfigItems(data); - }); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminRequestheader_ConfirmJsp).renderWith(data -> { - registerProtocolSchemeItems(data); - registerWebConfigItems(data); - }); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -290,7 +203,7 @@ public class AdminRequestheaderAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); diff --git a/src/main/java/org/codelibs/fess/app/web/admin/role/AdminRoleAction.java b/src/main/java/org/codelibs/fess/app/web/admin/role/AdminRoleAction.java index 9d9fd2d9c..3e3e526ab 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/role/AdminRoleAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/role/AdminRoleAction.java @@ -27,9 +27,11 @@ import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.es.user.exentity.Role; import org.codelibs.fess.helper.SystemHelper; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.validation.VaErrorHook; @@ -70,8 +72,12 @@ public class AdminRoleAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - rolePager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + rolePager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + rolePager.setCurrentPageNumber(0); + }); return asHtml(path_AdminRole_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -93,13 +99,6 @@ public class AdminRoleAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminRole_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("roleItems", roleService.getRoleList(rolePager)); // page navi @@ -114,7 +113,7 @@ public class AdminRoleAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminRole_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -124,86 +123,35 @@ public class AdminRoleAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminRole_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - roleService.getRole(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminRole_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminRole_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminRole_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminRole_EditJsp; + break; + } final String id = form.id; roleService.getRole(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminRole_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminRole_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - roleService.getRole(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - roleService.getRole(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminRole_ConfirmJsp); + return asHtml(next); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminRole_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminRole_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { roleService.getRole(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -217,24 +165,10 @@ public class AdminRoleAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminRole_ConfirmJsp); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminRole_ConfirmJsp); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -249,7 +183,7 @@ public class AdminRoleAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); diff --git a/src/main/java/org/codelibs/fess/app/web/admin/roletype/AdminRoletypeAction.java b/src/main/java/org/codelibs/fess/app/web/admin/roletype/AdminRoletypeAction.java index 33e0fd7ef..1907ff940 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/roletype/AdminRoletypeAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/roletype/AdminRoletypeAction.java @@ -25,9 +25,11 @@ import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.es.config.exentity.RoleType; import org.codelibs.fess.helper.SystemHelper; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.validation.VaErrorHook; @@ -68,8 +70,12 @@ public class AdminRoletypeAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - roleTypePager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + roleTypePager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + roleTypePager.setCurrentPageNumber(0); + }); return asHtml(path_AdminRoletype_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -91,13 +97,6 @@ public class AdminRoletypeAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminRoletype_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("roleTypeItems", roleTypeService.getRoleTypeList(roleTypePager)); // page navi @@ -112,7 +111,7 @@ public class AdminRoletypeAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminRoletype_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -122,86 +121,35 @@ public class AdminRoletypeAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminRoletype_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - roleTypeService.getRoleType(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminRoletype_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminRoletype_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminRoletype_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminRoletype_EditJsp; + break; + } final String id = form.id; roleTypeService.getRoleType(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminRoletype_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminRoletype_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - roleTypeService.getRoleType(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - roleTypeService.getRoleType(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminRoletype_ConfirmJsp); + return asHtml(next); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminRoletype_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminRoletype_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { roleTypeService.getRoleType(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -215,24 +163,10 @@ public class AdminRoletypeAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminRoletype_ConfirmJsp); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminRoletype_ConfirmJsp); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -246,7 +180,7 @@ public class AdminRoletypeAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); diff --git a/src/main/java/org/codelibs/fess/app/web/admin/scheduledjob/AdminScheduledjobAction.java b/src/main/java/org/codelibs/fess/app/web/admin/scheduledjob/AdminScheduledjobAction.java index 325467aab..b3583505b 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/scheduledjob/AdminScheduledjobAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/scheduledjob/AdminScheduledjobAction.java @@ -27,9 +27,11 @@ import org.codelibs.fess.helper.JobHelper; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.job.JobExecutor; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.util.LaRequestUtil; @@ -73,8 +75,12 @@ public class AdminScheduledjobAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - scheduledJobPager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + scheduledJobPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + scheduledJobPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminScheduledjob_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -96,13 +102,6 @@ public class AdminScheduledjobAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminScheduledjob_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("scheduledJobItems", scheduledJobService.getScheduledJobList(scheduledJobPager)); // page navi @@ -117,7 +116,7 @@ public class AdminScheduledjobAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminScheduledjob_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -127,82 +126,35 @@ public class AdminScheduledjobAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminScheduledjob_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - scheduledJobService.getScheduledJob(id).ifPresent(entity -> { - loadScheduledJob(form, entity); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminScheduledjob_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminScheduledjob_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminScheduledjob_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminScheduledjob_EditJsp; + break; + } final String id = form.id; scheduledJobService.getScheduledJob(id).ifPresent(entity -> { loadScheduledJob(form, entity); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminScheduledjob_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminScheduledjob_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - scheduledJobService.getScheduledJob(id).ifPresent(entity -> { - loadScheduledJob(form, entity); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - scheduledJobService.getScheduledJob(id).ifPresent(entity -> { - loadScheduledJob(form, entity); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminScheduledjob_ConfirmJsp); + return asHtml(next); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminScheduledjob_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminScheduledjob_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { scheduledJobService.getScheduledJob(id).ifPresent(entity -> { loadScheduledJob(form, entity); @@ -217,24 +169,10 @@ public class AdminScheduledjobAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminScheduledjob_ConfirmJsp); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminScheduledjob_ConfirmJsp); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -251,7 +189,7 @@ public class AdminScheduledjobAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); @@ -284,7 +222,7 @@ public class AdminScheduledjobAction extends FessAdminAction { @Execute public HtmlResponse start(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.CONFIRM); + verifyCrudMode(form.crudMode, CrudMode.DETAILS); validate(form, messages -> {}, toEditHtml()); final String id = form.id; scheduledJobService.getScheduledJob(id).ifPresent(entity -> { @@ -306,7 +244,7 @@ public class AdminScheduledjobAction extends FessAdminAction { @Execute public HtmlResponse stop(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.CONFIRM); + verifyCrudMode(form.crudMode, CrudMode.DETAILS); validate(form, messages -> {}, toEditHtml()); final String id = form.id; scheduledJobService.getScheduledJob(id).ifPresent(entity -> { diff --git a/src/main/java/org/codelibs/fess/app/web/admin/suggestbadword/AdminSuggestbadwordAction.java b/src/main/java/org/codelibs/fess/app/web/admin/suggestbadword/AdminSuggestbadwordAction.java index e8643da51..98a662e37 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/suggestbadword/AdminSuggestbadwordAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/suggestbadword/AdminSuggestbadwordAction.java @@ -41,9 +41,11 @@ import org.codelibs.fess.es.config.exentity.SuggestBadWord; import org.codelibs.fess.exception.FessSystemException; import org.codelibs.fess.helper.SystemHelper; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.util.LaResponseUtil; @@ -86,8 +88,12 @@ public class AdminSuggestbadwordAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - suggestBadWordPager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + suggestBadWordPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + suggestBadWordPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminSuggestbadword_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -109,13 +115,6 @@ public class AdminSuggestbadwordAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminSuggestbadword_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("suggestBadWordItems", suggestBadWordService.getSuggestBadWordList(suggestBadWordPager)); // page navi @@ -130,7 +129,7 @@ public class AdminSuggestbadwordAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminSuggestbadword_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -140,86 +139,35 @@ public class AdminSuggestbadwordAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminSuggestbadword_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - suggestBadWordService.getSuggestBadWord(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminSuggestbadword_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminSuggestbadword_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminSuggestbadword_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminSuggestbadword_EditJsp; + break; + } final String id = form.id; suggestBadWordService.getSuggestBadWord(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminSuggestbadword_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminSuggestbadword_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - suggestBadWordService.getSuggestBadWord(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - suggestBadWordService.getSuggestBadWord(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminSuggestbadword_ConfirmJsp); + return asHtml(next); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminSuggestbadword_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminSuggestbadword_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { suggestBadWordService.getSuggestBadWord(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -233,20 +181,6 @@ public class AdminSuggestbadwordAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminSuggestbadword_ConfirmJsp); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminSuggestbadword_ConfirmJsp); - } - // ----------------------------------------------------- // Download // ------- @@ -281,7 +215,7 @@ public class AdminSuggestbadwordAction extends FessAdminAction { // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -295,7 +229,7 @@ public class AdminSuggestbadwordAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); diff --git a/src/main/java/org/codelibs/fess/app/web/admin/suggestelevateword/AdminSuggestelevatewordAction.java b/src/main/java/org/codelibs/fess/app/web/admin/suggestelevateword/AdminSuggestelevatewordAction.java index eff3f75be..3ecd18f46 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/suggestelevateword/AdminSuggestelevatewordAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/suggestelevateword/AdminSuggestelevatewordAction.java @@ -41,9 +41,11 @@ import org.codelibs.fess.es.config.exentity.SuggestElevateWord; import org.codelibs.fess.exception.FessSystemException; import org.codelibs.fess.helper.SystemHelper; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.util.LaResponseUtil; @@ -86,8 +88,12 @@ public class AdminSuggestelevatewordAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - suggestElevateWordPager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + suggestElevateWordPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + suggestElevateWordPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminSuggestelevateword_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -109,13 +115,6 @@ public class AdminSuggestelevatewordAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminSuggestelevateword_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("suggestElevateWordItems", suggestElevateWordService.getSuggestElevateWordList(suggestElevateWordPager)); // page navi @@ -130,7 +129,7 @@ public class AdminSuggestelevatewordAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminSuggestelevateword_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -140,86 +139,35 @@ public class AdminSuggestelevatewordAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminSuggestelevateword_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - suggestElevateWordService.getSuggestElevateWord(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminSuggestelevateword_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminSuggestelevateword_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminSuggestelevateword_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminSuggestelevateword_EditJsp; + break; + } final String id = form.id; suggestElevateWordService.getSuggestElevateWord(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminSuggestelevateword_EditJsp); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminSuggestelevateword_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - suggestElevateWordService.getSuggestElevateWord(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - suggestElevateWordService.getSuggestElevateWord(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminSuggestelevateword_ConfirmJsp); + return asHtml(next); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminSuggestelevateword_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminSuggestelevateword_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { suggestElevateWordService.getSuggestElevateWord(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -233,20 +181,6 @@ public class AdminSuggestelevatewordAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminSuggestelevateword_ConfirmJsp); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminSuggestelevateword_ConfirmJsp); - } - // ----------------------------------------------------- // Download // ------- @@ -281,7 +215,7 @@ public class AdminSuggestelevatewordAction extends FessAdminAction { // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -295,7 +229,7 @@ public class AdminSuggestelevatewordAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); diff --git a/src/main/java/org/codelibs/fess/app/web/admin/user/AdminUserAction.java b/src/main/java/org/codelibs/fess/app/web/admin/user/AdminUserAction.java index 7a9993b11..169b16f65 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/user/AdminUserAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/user/AdminUserAction.java @@ -32,9 +32,11 @@ import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.es.user.exentity.User; import org.codelibs.fess.helper.SystemHelper; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.validation.VaErrorHook; @@ -82,9 +84,13 @@ public class AdminUserAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { clearStoredPassword(); - userPager.setCurrentPageNumber(pageNumber); + pageNumber.ifPresent(num -> { + userPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + userPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminUser_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -108,14 +114,6 @@ public class AdminUserAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - clearStoredPassword(); - return asHtml(path_AdminUser_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("userItems", userService.getUserList(userPager)); // page navi // restore from pager @@ -134,7 +132,7 @@ public class AdminUserAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { clearStoredPassword(); return asHtml(path_AdminUser_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { @@ -147,50 +145,19 @@ public class AdminUserAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { + public HtmlResponse edit(final EditForm form) { clearStoredPassword(); - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminUser_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - userService.getUser(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - resetPassword(form); - }); - }).renderWith(data -> { - registerForms(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - clearStoredPassword(); - verifyCrudMode(form.crudMode, CrudMode.CREATE); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminUser_EditJsp).renderWith(data -> { - registerForms(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - clearStoredPassword(); - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminUser_EditJsp).renderWith(data -> { - registerForms(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - clearStoredPassword(); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminUser_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminUser_EditJsp; + break; + } final String id = form.id; userService.getUser(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); @@ -199,56 +166,18 @@ public class AdminUserAction extends FessAdminAction { }); resetPassword(form); validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminUser_EditJsp).renderWith(data -> { - registerForms(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - clearStoredPassword(); - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminUser_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - userService.getUser(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - resetPassword(form); - }); - }).renderWith(data -> { - registerForms(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - clearStoredPassword(); - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - userService.getUser(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - resetPassword(form); - return asHtml(path_AdminUser_ConfirmJsp).renderWith(data -> { + return asHtml(next).renderWith(data -> { registerForms(data); }); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminUser_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminUser_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { userService.getUser(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -265,32 +194,10 @@ public class AdminUserAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - verifyPassword(form); - storePassword(form); - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminUser_ConfirmJsp).renderWith(data -> { - registerForms(data); - }); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - verifyPassword(form); - storePassword(form); - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminUser_ConfirmJsp).renderWith(data -> { - registerForms(data); - }); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -305,7 +212,7 @@ public class AdminUserAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); diff --git a/src/main/java/org/codelibs/fess/app/web/admin/webauthentication/AdminWebauthenticationAction.java b/src/main/java/org/codelibs/fess/app/web/admin/webauthentication/AdminWebauthenticationAction.java index 1585fc001..175c56308 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/webauthentication/AdminWebauthenticationAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/webauthentication/AdminWebauthenticationAction.java @@ -34,9 +34,11 @@ import org.codelibs.fess.es.config.exentity.WebConfig; import org.codelibs.fess.helper.SystemHelper; import org.codelibs.fess.util.ComponentUtil; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.util.LaRequestUtil; @@ -81,8 +83,12 @@ public class AdminWebauthenticationAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - webAuthenticationPager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + webAuthenticationPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + webAuthenticationPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminWebauthentication_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -104,13 +110,6 @@ public class AdminWebauthenticationAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminWebauthentication_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("webAuthenticationItems", webAuthenticationService.getWebAuthenticationList(webAuthenticationPager)); // page navi data.register("displayCreateLink", !webConfigService.getAllWebConfigList(false, false, false, null).isEmpty()); @@ -125,7 +124,7 @@ public class AdminWebauthenticationAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminWebauthentication_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -138,104 +137,38 @@ public class AdminWebauthenticationAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminWebauthentication_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - webAuthenticationService.getWebAuthentication(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }).renderWith(data -> { - registerProtocolSchemeItems(data); - registerWebConfigItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminWebauthentication_EditJsp).renderWith(data -> { - registerProtocolSchemeItems(data); - registerWebConfigItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminWebauthentication_EditJsp).renderWith(data -> { - registerProtocolSchemeItems(data); - registerWebConfigItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminWebauthentication_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminWebauthentication_EditJsp; + break; + } final String id = form.id; webAuthenticationService.getWebAuthentication(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminWebauthentication_EditJsp).renderWith(data -> { - registerProtocolSchemeItems(data); - registerWebConfigItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminWebauthentication_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - webAuthenticationService.getWebAuthentication(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }).renderWith(data -> { - registerProtocolSchemeItems(data); - registerWebConfigItems(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - webAuthenticationService.getWebAuthentication(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminWebauthentication_ConfirmJsp).renderWith(data -> { + return asHtml(next).renderWith(data -> { registerProtocolSchemeItems(data); registerWebConfigItems(data); }); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminWebauthentication_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminWebauthentication_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { webAuthenticationService.getWebAuthentication(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -252,30 +185,10 @@ public class AdminWebauthenticationAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminWebauthentication_ConfirmJsp).renderWith(data -> { - registerProtocolSchemeItems(data); - registerWebConfigItems(data); - }); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminWebauthentication_ConfirmJsp).renderWith(data -> { - registerProtocolSchemeItems(data); - registerWebConfigItems(data); - }); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -289,7 +202,7 @@ public class AdminWebauthenticationAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); diff --git a/src/main/java/org/codelibs/fess/app/web/admin/webconfig/AdminWebconfigAction.java b/src/main/java/org/codelibs/fess/app/web/admin/webconfig/AdminWebconfigAction.java index 9810e6e1c..70c7e61d9 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/webconfig/AdminWebconfigAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/webconfig/AdminWebconfigAction.java @@ -27,9 +27,11 @@ import org.codelibs.fess.app.web.base.FessAdminAction; import org.codelibs.fess.es.config.exentity.WebConfig; import org.codelibs.fess.helper.SystemHelper; import org.dbflute.optional.OptionalEntity; +import org.dbflute.optional.OptionalThing; import org.lastaflute.web.Execute; import org.lastaflute.web.callback.ActionRuntime; import org.lastaflute.web.response.HtmlResponse; +import org.lastaflute.web.response.next.HtmlNext; import org.lastaflute.web.response.render.RenderData; import org.lastaflute.web.token.TxToken; import org.lastaflute.web.validation.VaErrorHook; @@ -75,8 +77,12 @@ public class AdminWebconfigAction extends FessAdminAction { } @Execute - public HtmlResponse list(final Integer pageNumber, final SearchForm form) { - webConfigPager.setCurrentPageNumber(pageNumber); + public HtmlResponse list(final OptionalThing pageNumber, final SearchForm form) { + pageNumber.ifPresent(num -> { + webConfigPager.setCurrentPageNumber(pageNumber.get()); + }).orElse(() -> { + webConfigPager.setCurrentPageNumber(0); + }); return asHtml(path_AdminWebconfig_IndexJsp).renderWith(data -> { searchPaging(data, form); }); @@ -98,17 +104,10 @@ public class AdminWebconfigAction extends FessAdminAction { }); } - @Execute - public HtmlResponse back(final SearchForm form) { - return asHtml(path_AdminWebconfig_IndexJsp).renderWith(data -> { - searchPaging(data, form); - }); - } - protected void searchPaging(final RenderData data, final SearchForm form) { data.register("webConfigItems", webConfigService.getWebConfigList(webConfigPager)); // page navi - // restore from pager + // restore from webConfigPager copyBeanToBean(webConfigPager, form, op -> op.include("id")); } @@ -119,7 +118,7 @@ public class AdminWebconfigAction extends FessAdminAction { // Entry Page // ---------- @Execute(token = TxToken.SAVE) - public HtmlResponse createpage() { + public HtmlResponse createnew() { return asHtml(path_AdminWebconfig_EditJsp).useForm(CreateForm.class, op -> { op.setup(form -> { form.initialize(); @@ -131,98 +130,37 @@ public class AdminWebconfigAction extends FessAdminAction { } @Execute(token = TxToken.SAVE) - public HtmlResponse editpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.EDIT); - return asHtml(path_AdminWebconfig_EditJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - webConfigService.getWebConfig(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }).renderWith(data -> { - registerRolesAndLabels(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse createagain(final CreateForm form) { - verifyCrudMode(form.crudMode, CrudMode.CREATE); + public HtmlResponse edit(final EditForm form) { validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminWebconfig_EditJsp).renderWith(data -> { - registerRolesAndLabels(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editagain(final EditForm form) { - verifyCrudMode(form.crudMode, CrudMode.EDIT); - validate(form, messages -> {}, toEditHtml()); - return asHtml(path_AdminWebconfig_EditJsp).renderWith(data -> { - registerRolesAndLabels(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse editfromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; + HtmlNext next; + switch (form.crudMode) { + case CrudMode.EDIT: // back + form.crudMode = CrudMode.DETAILS; + next = path_AdminWebconfig_DetailsJsp; + break; + default: + form.crudMode = CrudMode.EDIT; + next = path_AdminWebconfig_EditJsp; + break; + } final String id = form.id; webConfigService.getWebConfig(id).ifPresent(entity -> { copyBeanToBean(entity, form, op -> {}); }).orElse(() -> { throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); }); - return asHtml(path_AdminWebconfig_EditJsp).renderWith(data -> { - registerRolesAndLabels(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletepage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.DELETE); - return asHtml(path_AdminWebconfig_ConfirmJsp).useForm(EditForm.class, op -> { - op.setup(form -> { - webConfigService.getWebConfig(id).ifPresent(entity -> { - copyBeanToBean(entity, form, copyOp -> { - copyOp.excludeNull(); - }); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - form.crudMode = crudMode; - }); - }).renderWith(data -> { - registerRolesAndLabels(data); - }); - } - - @Execute(token = TxToken.SAVE) - public HtmlResponse deletefromconfirm(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.DELETE; - final String id = form.id; - webConfigService.getWebConfig(id).ifPresent(entity -> { - copyBeanToBean(entity, form, op -> {}); - }).orElse(() -> { - throwValidationError(messages -> messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id), toEditHtml()); - }); - return asHtml(path_AdminWebconfig_ConfirmJsp).renderWith(data -> { + return asHtml(next).renderWith(data -> { registerRolesAndLabels(data); }); } // ----------------------------------------------------- - // Confirm + // Details // ------- @Execute - public HtmlResponse confirmpage(final int crudMode, final String id) { - verifyCrudMode(crudMode, CrudMode.CONFIRM); - return asHtml(path_AdminWebconfig_ConfirmJsp).useForm(EditForm.class, op -> { + public HtmlResponse details(final int crudMode, final String id) { + verifyCrudMode(crudMode, CrudMode.DETAILS); + return asHtml(path_AdminWebconfig_DetailsJsp).useForm(EditForm.class, op -> { op.setup(form -> { webConfigService.getWebConfig(id).ifPresent(entity -> { copyBeanToBean(entity, form, copyOp -> { @@ -238,28 +176,10 @@ public class AdminWebconfigAction extends FessAdminAction { }); } - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromcreate(final CreateForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.CREATE; - return asHtml(path_AdminWebconfig_ConfirmJsp).renderWith(data -> { - registerRolesAndLabels(data); - }); - } - - @Execute(token = TxToken.VALIDATE_KEEP) - public HtmlResponse confirmfromupdate(final EditForm form) { - validate(form, messages -> {}, toEditHtml()); - form.crudMode = CrudMode.EDIT; - return asHtml(path_AdminWebconfig_ConfirmJsp).renderWith(data -> { - registerRolesAndLabels(data); - }); - } - // ----------------------------------------------------- // Actually Crud // ------------- - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse create(final CreateForm form) { verifyCrudMode(form.crudMode, CrudMode.CREATE); validate(form, messages -> {}, toEditHtml()); @@ -273,7 +193,7 @@ public class AdminWebconfigAction extends FessAdminAction { return redirect(getClass()); } - @Execute(token = TxToken.VALIDATE) + @Execute public HtmlResponse update(final EditForm form) { verifyCrudMode(form.crudMode, CrudMode.EDIT); validate(form, messages -> {}, toEditHtml()); diff --git a/src/main/java/org/codelibs/fess/mylasta/action/FessHtmlPath.java b/src/main/java/org/codelibs/fess/mylasta/action/FessHtmlPath.java index 58b34d435..f4f45d582 100644 --- a/src/main/java/org/codelibs/fess/mylasta/action/FessHtmlPath.java +++ b/src/main/java/org/codelibs/fess/mylasta/action/FessHtmlPath.java @@ -23,8 +23,8 @@ import org.lastaflute.web.response.next.HtmlNext; */ public interface FessHtmlPath { - /** The path of the HTML: /admin/boostdocumentrule/confirm.jsp */ - HtmlNext path_AdminBoostdocumentrule_ConfirmJsp = new HtmlNext("/admin/boostdocumentrule/confirm.jsp"); + /** The path of the HTML: /admin/boostdocumentrule/details.jsp */ + HtmlNext path_AdminBoostdocumentrule_DetailsJsp = new HtmlNext("/admin/boostdocumentrule/details.jsp"); /** The path of the HTML: /admin/boostdocumentrule/edit.jsp */ HtmlNext path_AdminBoostdocumentrule_EditJsp = new HtmlNext("/admin/boostdocumentrule/edit.jsp"); @@ -32,8 +32,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/boostdocumentrule/index.jsp */ HtmlNext path_AdminBoostdocumentrule_IndexJsp = new HtmlNext("/admin/boostdocumentrule/index.jsp"); - /** The path of the HTML: /admin/crawlingsession/confirm.jsp */ - HtmlNext path_AdminCrawlingsession_ConfirmJsp = new HtmlNext("/admin/crawlingsession/confirm.jsp"); + /** The path of the HTML: /admin/crawlingsession/details.jsp */ + HtmlNext path_AdminCrawlingsession_DetailsJsp = new HtmlNext("/admin/crawlingsession/details.jsp"); /** The path of the HTML: /admin/crawlingsession/index.jsp */ HtmlNext path_AdminCrawlingsession_IndexJsp = new HtmlNext("/admin/crawlingsession/index.jsp"); @@ -41,8 +41,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/data/index.jsp */ HtmlNext path_AdminData_IndexJsp = new HtmlNext("/admin/data/index.jsp"); - /** The path of the HTML: /admin/dataconfig/confirm.jsp */ - HtmlNext path_AdminDataconfig_ConfirmJsp = new HtmlNext("/admin/dataconfig/confirm.jsp"); + /** The path of the HTML: /admin/dataconfig/details.jsp */ + HtmlNext path_AdminDataconfig_DetailsJsp = new HtmlNext("/admin/dataconfig/details.jsp"); /** The path of the HTML: /admin/dataconfig/edit.jsp */ HtmlNext path_AdminDataconfig_EditJsp = new HtmlNext("/admin/dataconfig/edit.jsp"); @@ -59,8 +59,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/dict/index.jsp */ HtmlNext path_AdminDict_IndexJsp = new HtmlNext("/admin/dict/index.jsp"); - /** The path of the HTML: /admin/dict/kuromoji/confirm.jsp */ - HtmlNext path_AdminDictKuromoji_ConfirmJsp = new HtmlNext("/admin/dict/kuromoji/confirm.jsp"); + /** The path of the HTML: /admin/dict/kuromoji/details.jsp */ + HtmlNext path_AdminDictKuromoji_DetailsJsp = new HtmlNext("/admin/dict/kuromoji/details.jsp"); /** The path of the HTML: /admin/dict/kuromoji/download.jsp */ HtmlNext path_AdminDictKuromoji_DownloadJsp = new HtmlNext("/admin/dict/kuromoji/download.jsp"); @@ -77,8 +77,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/dict/kuromoji/upload.jsp */ HtmlNext path_AdminDictKuromoji_UploadJsp = new HtmlNext("/admin/dict/kuromoji/upload.jsp"); - /** The path of the HTML: /admin/dict/synonym/confirm.jsp */ - HtmlNext path_AdminDictSynonym_ConfirmJsp = new HtmlNext("/admin/dict/synonym/confirm.jsp"); + /** The path of the HTML: /admin/dict/synonym/details.jsp */ + HtmlNext path_AdminDictSynonym_DetailsJsp = new HtmlNext("/admin/dict/synonym/details.jsp"); /** The path of the HTML: /admin/dict/synonym/download.jsp */ HtmlNext path_AdminDictSynonym_DownloadJsp = new HtmlNext("/admin/dict/synonym/download.jsp"); @@ -98,14 +98,14 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/error/error.jsp */ HtmlNext path_AdminError_ErrorJsp = new HtmlNext("/admin/error/error.jsp"); - /** The path of the HTML: /admin/failureurl/confirm.jsp */ - HtmlNext path_AdminFailureurl_ConfirmJsp = new HtmlNext("/admin/failureurl/confirm.jsp"); + /** The path of the HTML: /admin/failureurl/details.jsp */ + HtmlNext path_AdminFailureurl_DetailsJsp = new HtmlNext("/admin/failureurl/details.jsp"); /** The path of the HTML: /admin/failureurl/index.jsp */ HtmlNext path_AdminFailureurl_IndexJsp = new HtmlNext("/admin/failureurl/index.jsp"); - /** The path of the HTML: /admin/fileauthentication/confirm.jsp */ - HtmlNext path_AdminFileauthentication_ConfirmJsp = new HtmlNext("/admin/fileauthentication/confirm.jsp"); + /** The path of the HTML: /admin/fileauthentication/details.jsp */ + HtmlNext path_AdminFileauthentication_DetailsJsp = new HtmlNext("/admin/fileauthentication/details.jsp"); /** The path of the HTML: /admin/fileauthentication/edit.jsp */ HtmlNext path_AdminFileauthentication_EditJsp = new HtmlNext("/admin/fileauthentication/edit.jsp"); @@ -113,8 +113,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/fileauthentication/index.jsp */ HtmlNext path_AdminFileauthentication_IndexJsp = new HtmlNext("/admin/fileauthentication/index.jsp"); - /** The path of the HTML: /admin/fileconfig/confirm.jsp */ - HtmlNext path_AdminFileconfig_ConfirmJsp = new HtmlNext("/admin/fileconfig/confirm.jsp"); + /** The path of the HTML: /admin/fileconfig/details.jsp */ + HtmlNext path_AdminFileconfig_DetailsJsp = new HtmlNext("/admin/fileconfig/details.jsp"); /** The path of the HTML: /admin/fileconfig/edit.jsp */ HtmlNext path_AdminFileconfig_EditJsp = new HtmlNext("/admin/fileconfig/edit.jsp"); @@ -125,8 +125,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/general/index.jsp */ HtmlNext path_AdminGeneral_IndexJsp = new HtmlNext("/admin/general/index.jsp"); - /** The path of the HTML: /admin/group/confirm.jsp */ - HtmlNext path_AdminGroup_ConfirmJsp = new HtmlNext("/admin/group/confirm.jsp"); + /** The path of the HTML: /admin/group/details.jsp */ + HtmlNext path_AdminGroup_DetailsJsp = new HtmlNext("/admin/group/details.jsp"); /** The path of the HTML: /admin/group/edit.jsp */ HtmlNext path_AdminGroup_EditJsp = new HtmlNext("/admin/group/edit.jsp"); @@ -134,14 +134,14 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/group/index.jsp */ HtmlNext path_AdminGroup_IndexJsp = new HtmlNext("/admin/group/index.jsp"); - /** The path of the HTML: /admin/joblog/confirm.jsp */ - HtmlNext path_AdminJoblog_ConfirmJsp = new HtmlNext("/admin/joblog/confirm.jsp"); + /** The path of the HTML: /admin/joblog/details.jsp */ + HtmlNext path_AdminJoblog_DetailsJsp = new HtmlNext("/admin/joblog/details.jsp"); /** The path of the HTML: /admin/joblog/index.jsp */ HtmlNext path_AdminJoblog_IndexJsp = new HtmlNext("/admin/joblog/index.jsp"); - /** The path of the HTML: /admin/keymatch/confirm.jsp */ - HtmlNext path_AdminKeymatch_ConfirmJsp = new HtmlNext("/admin/keymatch/confirm.jsp"); + /** The path of the HTML: /admin/keymatch/details.jsp */ + HtmlNext path_AdminKeymatch_DetailsJsp = new HtmlNext("/admin/keymatch/details.jsp"); /** The path of the HTML: /admin/keymatch/edit.jsp */ HtmlNext path_AdminKeymatch_EditJsp = new HtmlNext("/admin/keymatch/edit.jsp"); @@ -149,8 +149,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/keymatch/index.jsp */ HtmlNext path_AdminKeymatch_IndexJsp = new HtmlNext("/admin/keymatch/index.jsp"); - /** The path of the HTML: /admin/labeltype/confirm.jsp */ - HtmlNext path_AdminLabeltype_ConfirmJsp = new HtmlNext("/admin/labeltype/confirm.jsp"); + /** The path of the HTML: /admin/labeltype/details.jsp */ + HtmlNext path_AdminLabeltype_DetailsJsp = new HtmlNext("/admin/labeltype/details.jsp"); /** The path of the HTML: /admin/labeltype/edit.jsp */ HtmlNext path_AdminLabeltype_EditJsp = new HtmlNext("/admin/labeltype/edit.jsp"); @@ -161,8 +161,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/log/index.jsp */ HtmlNext path_AdminLog_IndexJsp = new HtmlNext("/admin/log/index.jsp"); - /** The path of the HTML: /admin/overlappinghost/confirm.jsp */ - HtmlNext path_AdminOverlappinghost_ConfirmJsp = new HtmlNext("/admin/overlappinghost/confirm.jsp"); + /** The path of the HTML: /admin/overlappinghost/details.jsp */ + HtmlNext path_AdminOverlappinghost_DetailsJsp = new HtmlNext("/admin/overlappinghost/details.jsp"); /** The path of the HTML: /admin/overlappinghost/edit.jsp */ HtmlNext path_AdminOverlappinghost_EditJsp = new HtmlNext("/admin/overlappinghost/edit.jsp"); @@ -170,8 +170,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/overlappinghost/index.jsp */ HtmlNext path_AdminOverlappinghost_IndexJsp = new HtmlNext("/admin/overlappinghost/index.jsp"); - /** The path of the HTML: /admin/pathmapping/confirm.jsp */ - HtmlNext path_AdminPathmapping_ConfirmJsp = new HtmlNext("/admin/pathmapping/confirm.jsp"); + /** The path of the HTML: /admin/pathmapping/details.jsp */ + HtmlNext path_AdminPathmapping_DetailsJsp = new HtmlNext("/admin/pathmapping/details.jsp"); /** The path of the HTML: /admin/pathmapping/edit.jsp */ HtmlNext path_AdminPathmapping_EditJsp = new HtmlNext("/admin/pathmapping/edit.jsp"); @@ -179,8 +179,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/pathmapping/index.jsp */ HtmlNext path_AdminPathmapping_IndexJsp = new HtmlNext("/admin/pathmapping/index.jsp"); - /** The path of the HTML: /admin/requestheader/confirm.jsp */ - HtmlNext path_AdminRequestheader_ConfirmJsp = new HtmlNext("/admin/requestheader/confirm.jsp"); + /** The path of the HTML: /admin/requestheader/details.jsp */ + HtmlNext path_AdminRequestheader_DetailsJsp = new HtmlNext("/admin/requestheader/details.jsp"); /** The path of the HTML: /admin/requestheader/edit.jsp */ HtmlNext path_AdminRequestheader_EditJsp = new HtmlNext("/admin/requestheader/edit.jsp"); @@ -188,8 +188,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/requestheader/index.jsp */ HtmlNext path_AdminRequestheader_IndexJsp = new HtmlNext("/admin/requestheader/index.jsp"); - /** The path of the HTML: /admin/role/confirm.jsp */ - HtmlNext path_AdminRole_ConfirmJsp = new HtmlNext("/admin/role/confirm.jsp"); + /** The path of the HTML: /admin/role/details.jsp */ + HtmlNext path_AdminRole_DetailsJsp = new HtmlNext("/admin/role/details.jsp"); /** The path of the HTML: /admin/role/edit.jsp */ HtmlNext path_AdminRole_EditJsp = new HtmlNext("/admin/role/edit.jsp"); @@ -197,8 +197,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/role/index.jsp */ HtmlNext path_AdminRole_IndexJsp = new HtmlNext("/admin/role/index.jsp"); - /** The path of the HTML: /admin/roletype/confirm.jsp */ - HtmlNext path_AdminRoletype_ConfirmJsp = new HtmlNext("/admin/roletype/confirm.jsp"); + /** The path of the HTML: /admin/roletype/details.jsp */ + HtmlNext path_AdminRoletype_DetailsJsp = new HtmlNext("/admin/roletype/details.jsp"); /** The path of the HTML: /admin/roletype/edit.jsp */ HtmlNext path_AdminRoletype_EditJsp = new HtmlNext("/admin/roletype/edit.jsp"); @@ -206,8 +206,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/roletype/index.jsp */ HtmlNext path_AdminRoletype_IndexJsp = new HtmlNext("/admin/roletype/index.jsp"); - /** The path of the HTML: /admin/scheduledjob/confirm.jsp */ - HtmlNext path_AdminScheduledjob_ConfirmJsp = new HtmlNext("/admin/scheduledjob/confirm.jsp"); + /** The path of the HTML: /admin/scheduledjob/details.jsp */ + HtmlNext path_AdminScheduledjob_DetailsJsp = new HtmlNext("/admin/scheduledjob/details.jsp"); /** The path of the HTML: /admin/scheduledjob/edit.jsp */ HtmlNext path_AdminScheduledjob_EditJsp = new HtmlNext("/admin/scheduledjob/edit.jsp"); @@ -221,8 +221,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/searchlist/index.jsp */ HtmlNext path_AdminSearchlist_IndexJsp = new HtmlNext("/admin/searchlist/index.jsp"); - /** The path of the HTML: /admin/suggestbadword/confirm.jsp */ - HtmlNext path_AdminSuggestbadword_ConfirmJsp = new HtmlNext("/admin/suggestbadword/confirm.jsp"); + /** The path of the HTML: /admin/suggestbadword/details.jsp */ + HtmlNext path_AdminSuggestbadword_DetailsJsp = new HtmlNext("/admin/suggestbadword/details.jsp"); /** The path of the HTML: /admin/suggestbadword/download.jsp */ HtmlNext path_AdminSuggestbadword_DownloadJsp = new HtmlNext("/admin/suggestbadword/download.jsp"); @@ -236,8 +236,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/suggestbadword/upload.jsp */ HtmlNext path_AdminSuggestbadword_UploadJsp = new HtmlNext("/admin/suggestbadword/upload.jsp"); - /** The path of the HTML: /admin/suggestelevateword/confirm.jsp */ - HtmlNext path_AdminSuggestelevateword_ConfirmJsp = new HtmlNext("/admin/suggestelevateword/confirm.jsp"); + /** The path of the HTML: /admin/suggestelevateword/details.jsp */ + HtmlNext path_AdminSuggestelevateword_DetailsJsp = new HtmlNext("/admin/suggestelevateword/details.jsp"); /** The path of the HTML: /admin/suggestelevateword/download.jsp */ HtmlNext path_AdminSuggestelevateword_DownloadJsp = new HtmlNext("/admin/suggestelevateword/download.jsp"); @@ -257,8 +257,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/systeminfo/index.jsp */ HtmlNext path_AdminSysteminfo_IndexJsp = new HtmlNext("/admin/systeminfo/index.jsp"); - /** The path of the HTML: /admin/user/confirm.jsp */ - HtmlNext path_AdminUser_ConfirmJsp = new HtmlNext("/admin/user/confirm.jsp"); + /** The path of the HTML: /admin/user/details.jsp */ + HtmlNext path_AdminUser_DetailsJsp = new HtmlNext("/admin/user/details.jsp"); /** The path of the HTML: /admin/user/edit.jsp */ HtmlNext path_AdminUser_EditJsp = new HtmlNext("/admin/user/edit.jsp"); @@ -266,8 +266,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/user/index.jsp */ HtmlNext path_AdminUser_IndexJsp = new HtmlNext("/admin/user/index.jsp"); - /** The path of the HTML: /admin/webauthentication/confirm.jsp */ - HtmlNext path_AdminWebauthentication_ConfirmJsp = new HtmlNext("/admin/webauthentication/confirm.jsp"); + /** The path of the HTML: /admin/webauthentication/details.jsp */ + HtmlNext path_AdminWebauthentication_DetailsJsp = new HtmlNext("/admin/webauthentication/details.jsp"); /** The path of the HTML: /admin/webauthentication/edit.jsp */ HtmlNext path_AdminWebauthentication_EditJsp = new HtmlNext("/admin/webauthentication/edit.jsp"); @@ -275,8 +275,8 @@ public interface FessHtmlPath { /** The path of the HTML: /admin/webauthentication/index.jsp */ HtmlNext path_AdminWebauthentication_IndexJsp = new HtmlNext("/admin/webauthentication/index.jsp"); - /** The path of the HTML: /admin/webconfig/confirm.jsp */ - HtmlNext path_AdminWebconfig_ConfirmJsp = new HtmlNext("/admin/webconfig/confirm.jsp"); + /** The path of the HTML: /admin/webconfig/details.jsp */ + HtmlNext path_AdminWebconfig_DetailsJsp = new HtmlNext("/admin/webconfig/details.jsp"); /** The path of the HTML: /admin/webconfig/edit.jsp */ HtmlNext path_AdminWebconfig_EditJsp = new HtmlNext("/admin/webconfig/edit.jsp"); diff --git a/src/main/resources/fess_label.properties b/src/main/resources/fess_label.properties index fbc83b19e..a13d5249f 100644 --- a/src/main/resources/fess_label.properties +++ b/src/main/resources/fess_label.properties @@ -1234,14 +1234,22 @@ labels.crud_button_edit=Edit labels.crud_button_confirm=Confirm labels.crud_button_search=Search labels.crud_button_reset=Reset -labels.crud_link_create_new=Create New +labels.crud_button_cancel=Cancel +labels.crud_link_create=Create New labels.crud_link_delete=Delete labels.crud_link_back=Back labels.crud_link_edit=Edit +labels.crud_link_details=Details +labels.crud_link_list=List labels.crud_link_next_page=Next labels.crud_link_prev_page=Prev -labels.crud_title_details=Details +labels.crud_title_list=List +labels.crud_title_create=Create +labels.crud_title_edit=Edit +labels.crud_title_delete=Confirm to delete labels.crud_title_confirm=Confirmation +labels.crud_title_details=Details +labels.crud_delete_confirmation=Do you really want to delete it? labels.admin_brand_title=Fess labels.admin_dashboard_title=Dashboard labels.admin_toggle_navi=Toggle navigation diff --git a/src/main/webapp/WEB-INF/view/admin/boostdocumentrule/confirm.jsp b/src/main/webapp/WEB-INF/view/admin/boostdocumentrule/confirm.jsp deleted file mode 100644 index 45d2f8519..000000000 --- a/src/main/webapp/WEB-INF/view/admin/boostdocumentrule/confirm.jsp +++ /dev/null @@ -1,177 +0,0 @@ -<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%> - - - -<la:message key="labels.admin_brand_title" /> | <la:message - key="labels.boost_document_rule_configuration" /> - - - -
- - - - - - -
- - <%-- Content Header --%> -
-

- -

- -
- -
- - <%-- Form --%> - - - - - - - - -
-
-
box-successbox-warningbox-dangerbox-primary"> - <%-- Box Header --%> -
-

- - - - - - - - - - - - -

-
- - - -
-
- <%-- Box Body --%> -
- <%-- Message --%> -
- -
${msg}
-
- -
- - <%-- Form Fields --%> - - - - - - - - - - - - - - - -
${f:h(urlExpr)}
${f:h(boostExpr)}
${f:h(sortOrder)}
- -
- <%-- Box Footer --%> - -
-
-
-
- -
-
- -
- - - diff --git a/src/main/webapp/WEB-INF/view/admin/boostdocumentrule/details.jsp b/src/main/webapp/WEB-INF/view/admin/boostdocumentrule/details.jsp new file mode 100644 index 000000000..9d399f796 --- /dev/null +++ b/src/main/webapp/WEB-INF/view/admin/boostdocumentrule/details.jsp @@ -0,0 +1,87 @@ +<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%> + + + +<la:message key="labels.admin_brand_title" /> | <la:message + key="labels.boost_document_rule_configuration" /> + + + +
+ + + + + +
+
+

+ +

+ +
+
+ + + + + + + + +
+
+
box-successbox-warningbox-dangerbox-primary"> + <%-- Box Header --%> +
+ +
+ <%-- Box Body --%> +
+ <%-- Message --%> +
+ +
${msg}
+
+ +
+ <%-- Form Fields --%> + + + + + + + + + + + + + + + +
${f:h(urlExpr)}
${f:h(boostExpr)}
${f:h(sortOrder)}
+
+ + + +
+ +
+
+
+ +
+
+ +
+ + + diff --git a/src/main/webapp/WEB-INF/view/admin/boostdocumentrule/edit.jsp b/src/main/webapp/WEB-INF/view/admin/boostdocumentrule/edit.jsp index 9701494c9..68b44cb92 100644 --- a/src/main/webapp/WEB-INF/view/admin/boostdocumentrule/edit.jsp +++ b/src/main/webapp/WEB-INF/view/admin/boostdocumentrule/edit.jsp @@ -13,41 +13,14 @@ -
- - - <%-- Content Header --%>

- +
-
- - <%-- Form --%> @@ -62,20 +35,7 @@ class="box box-successbox-warning"> <%-- Box Header --%>
-

- - - - - - -

-
- - - -
+
<%-- Box Body --%>
@@ -86,7 +46,6 @@
- <%-- Form Fields --%>
- - <%-- Box Footer --%> + + + - diff --git a/src/main/webapp/WEB-INF/view/admin/boostdocumentrule/index.jsp b/src/main/webapp/WEB-INF/view/admin/boostdocumentrule/index.jsp index 0ffbe7d02..d68e26eea 100644 --- a/src/main/webapp/WEB-INF/view/admin/boostdocumentrule/index.jsp +++ b/src/main/webapp/WEB-INF/view/admin/boostdocumentrule/index.jsp @@ -13,35 +13,21 @@ -
<%-- Content Header --%>

- +
-
-
<%-- Box Header --%>
-

- -

-
- - - -
+
<%-- Box Body --%>
@@ -59,72 +45,39 @@

- - - - - - - - - - - - - -
${f:h(data.urlExpr)}
+
+
+ + + + + + + + + + + + + +
${f:h(data.urlExpr)}
+
+
+ +
- -
- <%-- Box Footer --%> - +
+
-
- diff --git a/src/main/webapp/WEB-INF/view/admin/crawlingsession/confirm.jsp b/src/main/webapp/WEB-INF/view/admin/crawlingsession/details.jsp similarity index 86% rename from src/main/webapp/WEB-INF/view/admin/crawlingsession/confirm.jsp rename to src/main/webapp/WEB-INF/view/admin/crawlingsession/details.jsp index f5e353284..52a9366a4 100644 --- a/src/main/webapp/WEB-INF/view/admin/crawlingsession/confirm.jsp +++ b/src/main/webapp/WEB-INF/view/admin/crawlingsession/details.jsp @@ -58,26 +58,7 @@ class="box box-successbox-warningbox-dangerbox-primary"> <%-- Box Header --%>
-

- - - - - - - - - - - - -

-
- - - -
+
<%-- Box Body --%>
diff --git a/src/main/webapp/WEB-INF/view/admin/crawlingsession/index.jsp b/src/main/webapp/WEB-INF/view/admin/crawlingsession/index.jsp index a6384294a..90869ee1c 100644 --- a/src/main/webapp/WEB-INF/view/admin/crawlingsession/index.jsp +++ b/src/main/webapp/WEB-INF/view/admin/crawlingsession/index.jsp @@ -13,9 +13,7 @@ -
- <%-- Content Header --%>

@@ -95,7 +93,7 @@ + data-href="${contextPath}/admin/crawlingsession/details/4/${f:u(data.id)}"> ${f:h(data.sessionId)}

-
diff --git a/src/main/webapp/WEB-INF/view/admin/dataconfig/confirm.jsp b/src/main/webapp/WEB-INF/view/admin/dataconfig/details.jsp similarity index 56% rename from src/main/webapp/WEB-INF/view/admin/dataconfig/confirm.jsp rename to src/main/webapp/WEB-INF/view/admin/dataconfig/details.jsp index 8110c7fee..980d706d1 100644 --- a/src/main/webapp/WEB-INF/view/admin/dataconfig/confirm.jsp +++ b/src/main/webapp/WEB-INF/view/admin/dataconfig/details.jsp @@ -13,40 +13,14 @@ -
- - <%-- Content Header --%>

- +
-
- - <%-- Form --%> @@ -60,30 +34,10 @@
box-successbox-warningbox-dangerbox-primary"> - <%-- Box Header --%>
-

- - - - - - - - - - - - -

-
- - - -
+
- <%-- Box Body --%> +
<%-- Message --%>
@@ -173,64 +127,18 @@
- - <%-- Box Footer --%> + +
+
-
- diff --git a/src/main/webapp/WEB-INF/view/admin/dataconfig/edit.jsp b/src/main/webapp/WEB-INF/view/admin/dataconfig/edit.jsp index f610a95ed..638817cbc 100644 --- a/src/main/webapp/WEB-INF/view/admin/dataconfig/edit.jsp +++ b/src/main/webapp/WEB-INF/view/admin/dataconfig/edit.jsp @@ -13,40 +13,14 @@ -
- - <%-- Content Header --%>

- +
-
- - <%-- Form --%> @@ -60,24 +34,10 @@
box-successbox-warning"> - <%-- Box Header --%>
-

- - - - - - -

-
- - - -
+
- <%-- Box Body --%> +
<%-- Message --%>
@@ -169,40 +129,18 @@
- - <%-- Box Footer --%> + +
+
- - diff --git a/src/main/webapp/WEB-INF/view/admin/dataconfig/index.jsp b/src/main/webapp/WEB-INF/view/admin/dataconfig/index.jsp index e2ca517c3..0559bfb18 100644 --- a/src/main/webapp/WEB-INF/view/admin/dataconfig/index.jsp +++ b/src/main/webapp/WEB-INF/view/admin/dataconfig/index.jsp @@ -2,7 +2,8 @@ -<la:message key="labels.admin_brand_title"/> | <la:message key="labels.data_crawling_configuration" /> +<la:message key="labels.admin_brand_title" /> | <la:message + key="labels.data_crawling_configuration" /> @@ -14,48 +15,28 @@
- - <%-- Content Header --%>

- +
-
-
- <%-- Box Header --%>
-

- -

-
- - - -
+
- <%-- Box Body --%> +
<%-- Message --%>
-
- ${msg} -
+
${msg}
- <%-- List --%>

@@ -63,70 +44,44 @@

- - - - - - - - - - - - - - - -
${f:h(data.name)} - - - - - -
+
+
+ + + + + + + + + + + + + + + +
${f:h(data.name)} + + + +
+ + +
+
- -
- <%-- Box Footer --%> - +
+
-
- diff --git a/src/main/webapp/WEB-INF/view/admin/dict/index.jsp b/src/main/webapp/WEB-INF/view/admin/dict/index.jsp index 2d3bd294d..9b5b8a1e3 100644 --- a/src/main/webapp/WEB-INF/view/admin/dict/index.jsp +++ b/src/main/webapp/WEB-INF/view/admin/dict/index.jsp @@ -69,18 +69,14 @@ - - - <%-- Box Footer --%> - + + - - diff --git a/src/main/webapp/WEB-INF/view/admin/dict/kuromoji/confirm.jsp b/src/main/webapp/WEB-INF/view/admin/dict/kuromoji/details.jsp similarity index 56% rename from src/main/webapp/WEB-INF/view/admin/dict/kuromoji/confirm.jsp rename to src/main/webapp/WEB-INF/view/admin/dict/kuromoji/details.jsp index b9fa0f9d7..d45c40ae0 100644 --- a/src/main/webapp/WEB-INF/view/admin/dict/kuromoji/confirm.jsp +++ b/src/main/webapp/WEB-INF/view/admin/dict/kuromoji/details.jsp @@ -13,40 +13,14 @@ -
- - <%-- Content Header --%>

- +
-
- - <%-- Form --%> @@ -74,8 +48,7 @@
- +
- <%-- Form Fields --%> @@ -130,64 +102,18 @@
- - <%-- Box Footer --%> + + + - - diff --git a/src/main/webapp/WEB-INF/view/admin/dict/kuromoji/download.jsp b/src/main/webapp/WEB-INF/view/admin/dict/kuromoji/download.jsp index 770f7e334..eca3fafe7 100644 --- a/src/main/webapp/WEB-INF/view/admin/dict/kuromoji/download.jsp +++ b/src/main/webapp/WEB-INF/view/admin/dict/kuromoji/download.jsp @@ -21,6 +21,7 @@

+