Example #1
0
 protected FailureUrl getFailureUrl(final FailureUrlEditForm form) {
   final FailureUrl failureUrl = failureUrlService.getFailureUrl(createKeyMap(form));
   if (failureUrl == null) {
     // TODO
   }
   return failureUrl;
 }
Example #2
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());
                           });
                 });
           });
 }
Example #3
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());
 }