From 7261c5359d70dabd0aae86722f13dd5f8fb2e893 Mon Sep 17 00:00:00 2001 From: Shinsuke Sugaya Date: Sun, 30 Jun 2024 13:41:29 +0900 Subject: [PATCH] fix #2825 upgrade tasks for 14.15 --- .../web/admin/upgrade/AdminUpgradeAction.java | 50 +++++++++++++++++++ .../codelibs/fess/helper/SystemHelper.java | 2 +- .../view/admin/upgrade/admin_upgrade.jsp | 1 + 3 files changed, 52 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 a1d639600..001964091 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 @@ -120,6 +120,8 @@ public class AdminUpgradeAction extends FessAdminAction { private static final String VERSION_14_13 = "14.13"; + private static final String VERSION_14_14 = "14.14"; + // =================================================================================== // Attribute // @@ -218,6 +220,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -260,6 +263,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -301,6 +305,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -341,6 +346,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -380,6 +386,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -418,6 +425,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -455,6 +463,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -491,6 +500,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -526,6 +536,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -560,6 +571,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -593,6 +605,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -624,6 +637,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -654,6 +668,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -683,6 +698,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -711,6 +727,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -739,6 +756,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -766,6 +784,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -792,6 +811,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -817,6 +837,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -841,6 +862,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -864,6 +886,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -886,6 +909,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -907,6 +931,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -927,6 +952,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -946,6 +972,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -964,6 +991,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -981,6 +1009,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -997,6 +1026,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -1012,6 +1042,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -1026,6 +1057,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { upgradeFrom14_11(); upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -1039,6 +1071,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { try { upgradeFrom14_12(); upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -1051,6 +1084,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { } else if (VERSION_14_13.equals(form.targetVersion)) { try { upgradeFrom14_13(); + upgradeFrom14_14(); upgradeFromAll(); saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL)); @@ -1060,6 +1094,18 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) { logger.warn("Failed to upgrade data.", e); saveError(messages -> messages.addErrorsFailedToUpgradeFrom(GLOBAL, VERSION_14_13, e.getLocalizedMessage())); } + } else if (VERSION_14_14.equals(form.targetVersion)) { + try { + upgradeFrom14_14(); + 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_14, e.getLocalizedMessage())); + } } else { saveError(messages -> messages.addErrorsUnknownVersionForUpgrade(GLOBAL)); } @@ -1287,6 +1333,10 @@ private void upgradeFrom14_13() { // nothing } + private void upgradeFrom14_14() { + // nothing + } + private String[] getDictionaryPaths() { try (CurlResponse response = ComponentUtil.getCurlHelper().get("/_configsync/file").param("size", "1000").execute()) { if (response.getHttpStatusCode() == 200) { diff --git a/src/main/java/org/codelibs/fess/helper/SystemHelper.java b/src/main/java/org/codelibs/fess/helper/SystemHelper.java index bb50f6f6f..a506d9e8f 100644 --- a/src/main/java/org/codelibs/fess/helper/SystemHelper.java +++ b/src/main/java/org/codelibs/fess/helper/SystemHelper.java @@ -135,7 +135,7 @@ public void init() { logger.debug("Initialize {}", this.getClass().getSimpleName()); } final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC")); - cal.set(2025, 11 - 1, 1); // EOL Date + cal.set(2026, 1 - 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 7050b6204..b51001a09 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 @@ -82,6 +82,7 @@ 14.11 14.12 14.13 + 14.14