Skip to content

Commit

Permalink
fix #2843 upgrade task for 14.17
Browse files Browse the repository at this point in the history
  • Loading branch information
marevol committed Sep 22, 2024
1 parent cf9b73e commit 3dec731
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ public class AdminUpgradeAction extends FessAdminAction {

private static final String VERSION_14_15 = "14.15";

private static final String VERSION_14_16 = "14.16";

// ===================================================================================
// Attribute
//
Expand Down Expand Up @@ -224,6 +226,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -268,6 +271,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -311,6 +315,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -353,6 +358,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -394,6 +400,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -434,6 +441,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -473,6 +481,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -511,6 +520,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -548,6 +558,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -584,6 +595,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -619,6 +631,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -652,6 +665,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -684,6 +698,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -715,6 +730,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -745,6 +761,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -775,6 +792,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -804,6 +822,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -832,6 +851,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -859,6 +879,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -885,6 +906,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -910,6 +932,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -934,6 +957,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -957,6 +981,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -979,6 +1004,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -1000,6 +1026,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -1020,6 +1047,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -1039,6 +1067,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -1057,6 +1086,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -1074,6 +1104,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -1090,6 +1121,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -1105,6 +1137,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -1119,6 +1152,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_13();
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -1132,6 +1166,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
try {
upgradeFrom14_14();
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -1144,6 +1179,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
} else if (VERSION_14_15.equals(form.targetVersion)) {
try {
upgradeFrom14_15();
upgradeFrom14_16();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -1153,6 +1189,18 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
logger.warn("Failed to upgrade data.", e);
saveError(messages -> messages.addErrorsFailedToUpgradeFrom(GLOBAL, VERSION_14_15, e.getLocalizedMessage()));
}
} else if (VERSION_14_16.equals(form.targetVersion)) {
try {
upgradeFrom14_16();
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_16, e.getLocalizedMessage()));
}
} else {
saveError(messages -> messages.addErrorsUnknownVersionForUpgrade(GLOBAL));
}
Expand Down Expand Up @@ -1388,6 +1436,10 @@ private void upgradeFrom14_15() {
// nothing
}

private void upgradeFrom14_16() {
// nothing
}

private String[] getDictionaryPaths() {
try (CurlResponse response = ComponentUtil.getCurlHelper().get("/_configsync/file").param("size", "1000").execute()) {
if (response.getHttpStatusCode() == 200) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/codelibs/fess/helper/SystemHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void init() {
logger.debug("Initialize {}", this.getClass().getSimpleName());
}
final Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
cal.set(2026, 2 - 1, 1); // EOL Date
cal.set(2026, 3 - 1, 1); // EOL Date
eolTime = cal.getTimeInMillis();
if (isEoled()) {
logger.error("Your system is out of support. See https://fess.codelibs.org/eol.html");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<la:option value="14.13">14.13</la:option>
<la:option value="14.14">14.14</la:option>
<la:option value="14.15">14.15</la:option>
<la:option value="14.15">14.16</la:option>
</la:select>
</div>
</div>
Expand Down

0 comments on commit 3dec731

Please sign in to comment.