Skip to content

Commit

Permalink
fix #2811 upgrade tasks for 14.13
Browse files Browse the repository at this point in the history
  • Loading branch information
marevol committed Apr 13, 2024
1 parent 2cc346d commit bcbdfc4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ public class AdminUpgradeAction extends FessAdminAction {

private static final String VERSION_14_11 = "14.11";

private static final String VERSION_14_12 = "14.12";

// ===================================================================================
// Attribute
//
Expand Down Expand Up @@ -212,6 +214,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -252,6 +255,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -291,6 +295,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -329,6 +334,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -366,6 +372,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -402,6 +409,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -437,6 +445,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -471,6 +480,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -504,6 +514,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -536,6 +547,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -567,6 +579,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -596,6 +609,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -624,6 +638,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand Down Expand Up @@ -651,6 +666,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -677,6 +693,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -703,6 +720,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -728,6 +746,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -752,6 +771,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -775,6 +795,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -797,6 +818,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -818,6 +840,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -838,6 +861,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -857,6 +881,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -875,6 +900,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -892,6 +918,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -908,6 +935,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -923,6 +951,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -937,6 +966,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
upgradeFrom14_9();
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -950,6 +980,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
try {
upgradeFrom14_10();
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -962,6 +993,7 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
} else if (VERSION_14_11.equals(form.targetVersion)) {
try {
upgradeFrom14_11();
upgradeFrom14_12();
upgradeFromAll();

saveInfo(messages -> messages.addSuccessStartedDataUpdate(GLOBAL));
Expand All @@ -971,6 +1003,18 @@ public HtmlResponse upgradeFrom(final UpgradeForm form) {
logger.warn("Failed to upgrade data.", e);
saveError(messages -> messages.addErrorsFailedToUpgradeFrom(GLOBAL, VERSION_14_11, e.getLocalizedMessage()));
}
} else if (VERSION_14_12.equals(form.targetVersion)) {
try {
upgradeFrom14_12();
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_12, e.getLocalizedMessage()));
}
} else {
saveError(messages -> messages.addErrorsUnknownVersionForUpgrade(GLOBAL));
}
Expand Down Expand Up @@ -1190,6 +1234,10 @@ private void upgradeFrom14_11() {
// nothing
}

private void upgradeFrom14_12() {
// 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(2025, 8 - 1, 1); // EOL Date
cal.set(2025, 10 - 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 @@ -80,6 +80,7 @@
<la:option value="14.9">14.9</la:option>
<la:option value="14.10">14.10</la:option>
<la:option value="14.11">14.11</la:option>
<la:option value="14.12">14.12</la:option>
</la:select>
</div>
</div>
Expand Down

0 comments on commit bcbdfc4

Please sign in to comment.