From 5c1e6810955398c1b5040c7b10725f44fa87c441 Mon Sep 17 00:00:00 2001 From: Shinsuke Sugaya Date: Thu, 22 Jun 2023 09:11:05 +0900 Subject: [PATCH] fix #2752 upgrade task for 14.9 --- .../web/admin/upgrade/AdminUpgradeAction.java | 44 +++++++++++++++++++ .../codelibs/fess/helper/SystemHelper.java | 2 +- .../view/admin/upgrade/admin_upgrade.jsp | 1 + 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/codelibs/fess/app/web/admin/upgrade/AdminUpgradeAction.java b/src/main/java/org/codelibs/fess/app/web/admin/upgrade/AdminUpgradeAction.java index 77e47db65..2ea425e7e 100644 --- a/src/main/java/org/codelibs/fess/app/web/admin/upgrade/AdminUpgradeAction.java +++ b/src/main/java/org/codelibs/fess/app/web/admin/upgrade/AdminUpgradeAction.java @@ -97,6 +97,8 @@ public class AdminUpgradeAction extends FessAdminAction { private static final String VERSION_14_7 = "14.7"; + private static final String VERSION_14_8 = "14.8"; + // =================================================================================== // Attribute // @@ -189,6 +191,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -225,6 +228,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -260,6 +264,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -294,6 +299,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -327,6 +333,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -359,6 +366,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -390,6 +398,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -420,6 +429,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -449,6 +459,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -477,6 +488,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -504,6 +516,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -529,6 +542,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -553,6 +567,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -576,6 +591,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -598,6 +614,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -620,6 +637,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -641,6 +659,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -661,6 +680,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -680,6 +700,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -698,6 +719,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -715,6 +737,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -731,6 +754,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -746,6 +770,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -760,6 +785,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_5(); upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -773,6 +799,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { try { upgradeFrom14_6(); upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -785,6 +812,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { } else if (VERSION_14_7.equals(form.targetVersion)) { try { upgradeFrom14_7(); + upgradeFrom14_8(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -794,6 +822,18 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { logger.warn("Failed to upgrade data.", e); saveError(messages -> messages.addErrorsFailedToUpgradeFrom(GLOBAL, VERSION_14_7, e.getLocalizedMessage())); } + } else if (VERSION_14_8.equals(form.targetVersion)) { + try { + upgradeFrom14_8(); + upgradeFromAll(); + + saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); + + systemHelper.reloadConfiguration(); + } catch (final Exception e) { + logger.warn("Failed to upgrade data.", e); + saveError(messages -> messages.addErrorsFailedToUpgradeFrom(GLOBAL, VERSION_14_8, e.getLocalizedMessage())); + } } else { saveError(messages -> messages.addErrorsUnknownVersionForUpgrade(GLOBAL)); } @@ -966,6 +1006,10 @@ private void upgradeFrom14_7() { // nothing } + private void upgradeFrom14_8() { + // nothing + } + private void upgradeFromAll() { // nothing } diff --git a/src/main/java/org/codelibs/fess/helper/SystemHelper.java b/src/main/java/org/codelibs/fess/helper/SystemHelper.java index 2029da8ba..d4742bb80 100644 --- a/src/main/java/org/codelibs/fess/helper/SystemHelper.java +++ b/src/main/java/org/codelibs/fess/helper/SystemHelper.java @@ -126,7 +126,7 @@ public void init() { logger.debug("Initialize {}", this.getClass().getSimpleName()); } final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); - cal.set(2024, 11 - 1, 1); // EOL Date + cal.set(2024, 12 - 1, 1); // EOL Date eolTime = cal.getTimeInMillis(); if (isEoled()) { logger.error("Your system is out of support. See https://fess.codelibs.org/eol.html"); diff --git a/src/main/webapp/WEB-INF/view/admin/upgrade/admin_upgrade.jsp b/src/main/webapp/WEB-INF/view/admin/upgrade/admin_upgrade.jsp index 4edb689ec..b7f62c6e0 100644 --- a/src/main/webapp/WEB-INF/view/admin/upgrade/admin_upgrade.jsp +++ b/src/main/webapp/WEB-INF/view/admin/upgrade/admin_upgrade.jsp @@ -76,6 +76,7 @@ 14.5 14.6 14.7 + 14.8