Esempio n. 1
0
 @Execute
 public HtmlResponse delete(final EditForm form) {
   verifyCrudMode(form.crudMode, CrudMode.DETAILS);
   validate(form, messages -> {}, () -> asDetailsHtml());
   verifyToken(() -> asDetailsHtml());
   final String id = form.id;
   failureUrlService
       .getFailureUrl(id)
       .alwaysPresent(
           entity -> {
             failureUrlService.delete(entity);
             saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
           });
   return redirect(getClass());
 }
Esempio n. 2
0
 protected FailureUrl getFailureUrl(final FailureUrlEditForm form) {
   final FailureUrl failureUrl = failureUrlService.getFailureUrl(createKeyMap(form));
   if (failureUrl == null) {
     // TODO
   }
   return failureUrl;
 }
Esempio n. 3
0
 @Execute
 public HtmlResponse delete(final FailureUrlEditForm form) {
   // TODO verifyCrudMode(form, CrudMode.DELETE);
   failureUrlService.delete(getFailureUrl(form));
   saveInfo(messages -> messages.addSuccessCrudDeleteCrudTable(GLOBAL));
   return redirect(getClass());
 }
Esempio n. 4
0
 // -----------------------------------------------------
 //                                               Details
 //                                               -------
 @Execute
 public HtmlResponse details(final int crudMode, final String id) {
   verifyCrudMode(crudMode, CrudMode.DETAILS);
   return asHtml(path_AdminFailureurl_AdminFailureurlDetailsJsp)
       .useForm(
           EditForm.class,
           op -> {
             op.setup(
                 form -> {
                   failureUrlService
                       .getFailureUrl(id)
                       .ifPresent(
                           entity -> {
                             copyBeanToBean(
                                 entity,
                                 form,
                                 copyOp -> {
                                   copyOp.excludeNull();
                                 });
                             form.crudMode = crudMode;
                           })
                       .orElse(
                           () -> {
                             throwValidationError(
                                 messages ->
                                     messages.addErrorsCrudCouldNotFindCrudTable(GLOBAL, id),
                                 () -> asListHtml());
                           });
                 });
           });
 }
Esempio n. 5
0
  protected void searchPaging(final RenderData data, final FailureUrlSearchForm form) {
    data.register(
        "failureUrlItems", failureUrlService.getFailureUrlList(failureUrlPager)); // page navi

    // restore from pager
    copyBeanToBean(
        failureUrlPager, form.searchParams, op -> op.exclude(Constants.PAGER_CONVERSION_RULE));
  }
Esempio n. 6
0
 @Execute
 public HtmlResponse deleteall() {
   verifyToken(() -> asListHtml());
   failureUrlService.deleteAll(failureUrlPager);
   failureUrlPager.clear();
   saveInfo(messages -> messages.addSuccessFailureUrlDeleteAll(GLOBAL));
   return redirect(getClass());
 }
Esempio n. 7
0
  protected void searchPaging(final RenderData data, final SearchForm form) {
    RenderDataUtil.register(
        data, "failureUrlItems", failureUrlService.getFailureUrlList(failureUrlPager)); // page navi

    // restore from pager
    copyBeanToBean(
        failureUrlPager,
        form,
        op -> op.include("url", "errorCountMin", "errorCountMax", "errorName"));
  }
Esempio n. 8
0
 private HtmlResponse asListHtml() {
   return asHtml(path_AdminFailureurl_AdminFailureurlJsp)
       .renderWith(
           data -> {
             RenderDataUtil.register(
                 data,
                 "failureUrlItems",
                 failureUrlService.getFailureUrlList(failureUrlPager)); // page navi
           })
       .useForm(
           SearchForm.class,
           setup -> {
             setup.setup(
                 form -> {
                   copyBeanToBean(
                       failureUrlPager,
                       form,
                       op -> op.include("url", "errorCountMin", "errorCountMax", "errorName"));
                 });
           });
 }
Esempio n. 9
0
 @Execute
 public HtmlResponse deleteall(final FailureUrlEditForm form) {
   failureUrlService.deleteAll(failureUrlPager);
   saveInfo(messages -> messages.addSuccessFailureUrlDeleteAll(GLOBAL));
   return redirect(getClass());
 }