Browse Source

copy on to boolean and modify jsp

Shinsuke Sugaya 9 years ago
parent
commit
f7a616d007

+ 6 - 0
src/main/java/org/codelibs/fess/app/web/admin/scheduledjob/AdminScheduledjobAction.java

@@ -240,6 +240,9 @@ public class AdminScheduledjobAction extends FessAdminAction {
         validate(form, messages -> {}, toEditHtml());
         validate(form, messages -> {}, toEditHtml());
         createScheduledJob(form).ifPresent(entity -> {
         createScheduledJob(form).ifPresent(entity -> {
             copyBeanToBean(form, entity, op -> op.exclude(Constants.COMMON_CONVERSION_RULE));
             copyBeanToBean(form, entity, op -> op.exclude(Constants.COMMON_CONVERSION_RULE));
+            entity.setAvailable(Constants.ON.equalsIgnoreCase(form.available));
+            entity.setCrawler(Constants.ON.equalsIgnoreCase(form.crawler));
+            entity.setJobLogging(Constants.ON.equalsIgnoreCase(form.jobLogging));
             scheduledJobService.store(entity);
             scheduledJobService.store(entity);
             saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
             saveInfo(messages -> messages.addSuccessCrudCreateCrudTable(GLOBAL));
         }).orElse(() -> {
         }).orElse(() -> {
@@ -254,6 +257,9 @@ public class AdminScheduledjobAction extends FessAdminAction {
         validate(form, messages -> {}, toEditHtml());
         validate(form, messages -> {}, toEditHtml());
         createScheduledJob(form).ifPresent(entity -> {
         createScheduledJob(form).ifPresent(entity -> {
             copyBeanToBean(form, entity, op -> op.exclude(Constants.COMMON_CONVERSION_RULE));
             copyBeanToBean(form, entity, op -> op.exclude(Constants.COMMON_CONVERSION_RULE));
+            entity.setAvailable(Constants.ON.equalsIgnoreCase(form.available));
+            entity.setCrawler(Constants.ON.equalsIgnoreCase(form.crawler));
+            entity.setJobLogging(Constants.ON.equalsIgnoreCase(form.jobLogging));
             scheduledJobService.store(entity);
             scheduledJobService.store(entity);
             saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
             saveInfo(messages -> messages.addSuccessCrudUpdateCrudTable(GLOBAL));
         }).orElse(() -> {
         }).orElse(() -> {

+ 2 - 2
src/main/webapp/WEB-INF/view/admin/scheduledjob/index.jsp

@@ -81,10 +81,10 @@
 															<la:message key="labels.scheduledjob_running" />
 															<la:message key="labels.scheduledjob_running" />
 														</c:if>
 														</c:if>
 														<c:if test="${!data.running}">
 														<c:if test="${!data.running}">
-															<c:if test="${data.available=='T'}">
+															<c:if test="${data.available}">
 																<la:message key="labels.scheduledjob_active" />
 																<la:message key="labels.scheduledjob_active" />
 															</c:if>
 															</c:if>
-															<c:if test="${data.available!='T'}">
+															<c:if test="${!data.available}">
 																<la:message key="labels.scheduledjob_nojob" />
 																<la:message key="labels.scheduledjob_nojob" />
 															</c:if>
 															</c:if>
 														</c:if></td>
 														</c:if></td>