From 3495855ff49c6607e62cfee86ad862c8b00a6c9f Mon Sep 17 00:00:00 2001 From: "nicolas.hirrle" Date: Thu, 7 Dec 2023 11:17:46 +0100 Subject: [PATCH 01/13] updating poms for 6.5.1-SNAPSHOT development --- api/pom.xml | 2 +- cloud.startup.hook/pom.xml | 2 +- complete-cloud/pom.xml | 2 +- complete/pom.xml | 2 +- core/pom.xml | 2 +- examples-cloud/pom.xml | 2 +- examples/pom.xml | 2 +- oak.index/pom.xml | 2 +- pom.xml | 2 +- ui.apps/pom.xml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index a6dc1683..6efa9bf8 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu - 6.5.0-SNAPSHOT + 6.5.1-SNAPSHOT aecu.api diff --git a/cloud.startup.hook/pom.xml b/cloud.startup.hook/pom.xml index 41be8299..e04fa7d0 100644 --- a/cloud.startup.hook/pom.xml +++ b/cloud.startup.hook/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu - 6.5.0-SNAPSHOT + 6.5.1-SNAPSHOT aecu.cloud.startup.hook diff --git a/complete-cloud/pom.xml b/complete-cloud/pom.xml index 12230b21..fbd6d88a 100644 --- a/complete-cloud/pom.xml +++ b/complete-cloud/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.0-SNAPSHOT + 6.5.1-SNAPSHOT aecu.complete.cloud diff --git a/complete/pom.xml b/complete/pom.xml index 681cc6c0..aa5af5ca 100644 --- a/complete/pom.xml +++ b/complete/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.0-SNAPSHOT + 6.5.1-SNAPSHOT aecu.complete diff --git a/core/pom.xml b/core/pom.xml index afe63178..a83859e7 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu - 6.5.0-SNAPSHOT + 6.5.1-SNAPSHOT aecu.core diff --git a/examples-cloud/pom.xml b/examples-cloud/pom.xml index 0477bf74..79cfa832 100644 --- a/examples-cloud/pom.xml +++ b/examples-cloud/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.0-SNAPSHOT + 6.5.1-SNAPSHOT aecu.examples-cloud diff --git a/examples/pom.xml b/examples/pom.xml index 60423335..ccdbde05 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.0-SNAPSHOT + 6.5.1-SNAPSHOT aecu.examples diff --git a/oak.index/pom.xml b/oak.index/pom.xml index 27df4dc5..d1943c0e 100644 --- a/oak.index/pom.xml +++ b/oak.index/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.0-SNAPSHOT + 6.5.1-SNAPSHOT aecu.oak.index diff --git a/pom.xml b/pom.xml index 98a3c3b6..6ab06f31 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu pom - 6.5.0-SNAPSHOT + 6.5.1-SNAPSHOT AECU AEM Easy Content Upgrade https://github.com/valtech/aem-easy-content-upgrade diff --git a/ui.apps/pom.xml b/ui.apps/pom.xml index eedb4060..51e8a609 100644 --- a/ui.apps/pom.xml +++ b/ui.apps/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.0-SNAPSHOT + 6.5.1-SNAPSHOT aecu.ui.apps From 337efdffa8e46ad21893b91fd579db60659a175c Mon Sep 17 00:00:00 2001 From: "nicolas.hirrle" Date: Thu, 7 Dec 2023 12:33:15 +0100 Subject: [PATCH 02/13] updating develop poms to master versions to avoid merge conflicts --- api/pom.xml | 2 +- cloud.startup.hook/pom.xml | 2 +- complete-cloud/pom.xml | 2 +- complete/pom.xml | 2 +- core/pom.xml | 2 +- examples-cloud/pom.xml | 2 +- examples/pom.xml | 2 +- oak.index/pom.xml | 2 +- pom.xml | 2 +- ui.apps/pom.xml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index 6efa9bf8..f3d3b77e 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.0 aecu.api diff --git a/cloud.startup.hook/pom.xml b/cloud.startup.hook/pom.xml index e04fa7d0..d1af0937 100644 --- a/cloud.startup.hook/pom.xml +++ b/cloud.startup.hook/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.0 aecu.cloud.startup.hook diff --git a/complete-cloud/pom.xml b/complete-cloud/pom.xml index fbd6d88a..bb4f9360 100644 --- a/complete-cloud/pom.xml +++ b/complete-cloud/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.0 aecu.complete.cloud diff --git a/complete/pom.xml b/complete/pom.xml index aa5af5ca..b7b055e3 100644 --- a/complete/pom.xml +++ b/complete/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.0 aecu.complete diff --git a/core/pom.xml b/core/pom.xml index a83859e7..f0d28073 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.0 aecu.core diff --git a/examples-cloud/pom.xml b/examples-cloud/pom.xml index 79cfa832..760f1967 100644 --- a/examples-cloud/pom.xml +++ b/examples-cloud/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.0 aecu.examples-cloud diff --git a/examples/pom.xml b/examples/pom.xml index ccdbde05..0af32e54 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.0 aecu.examples diff --git a/oak.index/pom.xml b/oak.index/pom.xml index d1943c0e..13ee5fcc 100644 --- a/oak.index/pom.xml +++ b/oak.index/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.0 aecu.oak.index diff --git a/pom.xml b/pom.xml index 6ab06f31..d58113e9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu pom - 6.5.1-SNAPSHOT + 6.5.0 AECU AEM Easy Content Upgrade https://github.com/valtech/aem-easy-content-upgrade diff --git a/ui.apps/pom.xml b/ui.apps/pom.xml index 51e8a609..14a2fc66 100644 --- a/ui.apps/pom.xml +++ b/ui.apps/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.0 aecu.ui.apps From 60b1717ce4ce85fa42823f1b9e5c2edd89440fc6 Mon Sep 17 00:00:00 2001 From: "nicolas.hirrle" Date: Thu, 7 Dec 2023 12:33:18 +0100 Subject: [PATCH 03/13] Updating develop poms back to pre merge state --- api/pom.xml | 2 +- cloud.startup.hook/pom.xml | 2 +- complete-cloud/pom.xml | 2 +- complete/pom.xml | 2 +- core/pom.xml | 2 +- examples-cloud/pom.xml | 2 +- examples/pom.xml | 2 +- oak.index/pom.xml | 2 +- pom.xml | 2 +- ui.apps/pom.xml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index f3d3b77e..6efa9bf8 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu - 6.5.0 + 6.5.1-SNAPSHOT aecu.api diff --git a/cloud.startup.hook/pom.xml b/cloud.startup.hook/pom.xml index d1af0937..e04fa7d0 100644 --- a/cloud.startup.hook/pom.xml +++ b/cloud.startup.hook/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu - 6.5.0 + 6.5.1-SNAPSHOT aecu.cloud.startup.hook diff --git a/complete-cloud/pom.xml b/complete-cloud/pom.xml index bb4f9360..fbd6d88a 100644 --- a/complete-cloud/pom.xml +++ b/complete-cloud/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.0 + 6.5.1-SNAPSHOT aecu.complete.cloud diff --git a/complete/pom.xml b/complete/pom.xml index b7b055e3..aa5af5ca 100644 --- a/complete/pom.xml +++ b/complete/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.0 + 6.5.1-SNAPSHOT aecu.complete diff --git a/core/pom.xml b/core/pom.xml index f0d28073..a83859e7 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu - 6.5.0 + 6.5.1-SNAPSHOT aecu.core diff --git a/examples-cloud/pom.xml b/examples-cloud/pom.xml index 760f1967..79cfa832 100644 --- a/examples-cloud/pom.xml +++ b/examples-cloud/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.0 + 6.5.1-SNAPSHOT aecu.examples-cloud diff --git a/examples/pom.xml b/examples/pom.xml index 0af32e54..ccdbde05 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.0 + 6.5.1-SNAPSHOT aecu.examples diff --git a/oak.index/pom.xml b/oak.index/pom.xml index 13ee5fcc..d1943c0e 100644 --- a/oak.index/pom.xml +++ b/oak.index/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.0 + 6.5.1-SNAPSHOT aecu.oak.index diff --git a/pom.xml b/pom.xml index d58113e9..6ab06f31 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu pom - 6.5.0 + 6.5.1-SNAPSHOT AECU AEM Easy Content Upgrade https://github.com/valtech/aem-easy-content-upgrade diff --git a/ui.apps/pom.xml b/ui.apps/pom.xml index 14a2fc66..51e8a609 100644 --- a/ui.apps/pom.xml +++ b/ui.apps/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.0 + 6.5.1-SNAPSHOT aecu.ui.apps From 44b8b146ca689adb7bc85fa2cb7ee46ede3eb2f8 Mon Sep 17 00:00:00 2001 From: Christine Baumann Date: Mon, 22 Apr 2024 17:14:45 +0200 Subject: [PATCH 04/13] docs: Add documentation on logging running script details --- Readme.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 26729641..efd557c6 100644 --- a/Readme.md +++ b/Readme.md @@ -25,7 +25,8 @@ Table of contents 4. [Execution of Migration Scripts](#execution) 1. [Startup Hook](#startupHook) 2. [Install Hook](#installHook) - 2. [Manual Execution](#manualExecution) + 3. [Manual Execution](#manualExecution) + 4. [Execution Details](#executionDetails) 5. [History of Past Runs](#history) 6. [Extension to Groovy Console](#groovy) 1. [Content Upgrades](#content_upgrades) @@ -259,6 +260,17 @@ Once execution is done you will see if the script(s) succeeded. Click on the his + + +## Execution Details and Output +When executing, `de.valtech.aecu.core.service.AecuServiceImpl` will emit a log statement to inform script is currently being executed, and when execution is done, a second log statement including the result (success, failure, skipped if prechecks failed) is emitted. +To capture these logs, configure a logger on `de.valtech.aecu` with level `INFO` to append/emit logs as you desire. +These logs are helpful if you are executing scripts via hook. + +Additionally, as stated above, manual execution provides the UI to indicate which script is currently running. Please note however that if you leave the page while execution is in progress, you will not be able to go back to it to see the execution details again. + +In both cases, you can see more details on the execution in the history. See below for more information. + # History of Past Runs From 9ba76c0df4227eada5442b05af550d639190db59 Mon Sep 17 00:00:00 2001 From: Pablo Castelo Date: Tue, 23 Apr 2024 10:32:14 +0200 Subject: [PATCH 05/13] Remove property not allowed in index definition, add small section on readme for maintenance --- Readme.md | 4 ++++ .../jcr_root/_oak_index/aecuHistory-custom-1/.content.xml | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 26729641..2e3681a2 100644 --- a/Readme.md +++ b/Readme.md @@ -163,6 +163,10 @@ Then delete "aem-groovy-console" packages in package manager. +## Upgrade from version lower than 5.0.0 (On Premise) + +The index was moved from /var/aecu to /oak:index for cloud compatibility reasons, please remove the /var/aecu/oak:index/aecuHistory to avoid duplicate index definitions + # File and Folder Structure All migration scripts need to be located in: diff --git a/oak.index/src/main/content/jcr_root/_oak_index/aecuHistory-custom-1/.content.xml b/oak.index/src/main/content/jcr_root/_oak_index/aecuHistory-custom-1/.content.xml index ce1e370c..0b92742c 100644 --- a/oak.index/src/main/content/jcr_root/_oak_index/aecuHistory-custom-1/.content.xml +++ b/oak.index/src/main/content/jcr_root/_oak_index/aecuHistory-custom-1/.content.xml @@ -4,7 +4,6 @@ async="async" compatVersion="{Long}2" evaluatePathRestrictions="{Boolean}true" - reindex="{Boolean}false" reindexCount="{Long}0" type="lucene" includedPaths="[/var/aecu]" From 89331f42d03e6f99071c770f96358585d075cd78 Mon Sep 17 00:00:00 2001 From: Christine Baumann Date: Tue, 23 Apr 2024 12:13:34 +0200 Subject: [PATCH 06/13] fix: adjust workflow file to use Java 11 for compilation, tests, etc, and use Java 17 for running sonar scan --- .github/workflows/maven.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index c61fddd9..f6a899ca 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -15,12 +15,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' + - uses: actions/checkout@v4 + + - name: Set up Java Env + uses: actions/setup-java@v4 + with: # The last version will be used by default and available globally via JAVA_HOME. + java-version: | + 17 + 11 distribution: 'temurin' cache: maven @@ -38,11 +40,14 @@ jobs: key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - - name: Build with Maven + - name: Build and Test with Maven + env: + JAVA_HOME: ${{ env.JAVA_HOME_11_X64 }} run: mvn clean install javadoc:javadoc - - name: Build and analyze + - name: Analyze with SonarQube env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=aecu + JAVA_HOME: ${{ env.JAVA_HOME_17_X64 }} + run: mvn -B org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=aecu From 8adc66f7e4c6377e8af8071dbbd4559842dae011 Mon Sep 17 00:00:00 2001 From: Pablo Castelo Date: Wed, 29 May 2024 10:47:01 +0200 Subject: [PATCH 07/13] Check if the output reach the LuceneIndex limit for a node property, if that's the case it will be stored as binary --- .../aecu/core/history/HistoryUtil.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java b/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java index 3f16c533..69d9c8bd 100644 --- a/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java +++ b/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java @@ -18,6 +18,9 @@ */ package de.valtech.aecu.core.history; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Calendar; import java.util.GregorianCalendar; @@ -50,6 +53,12 @@ import de.valtech.aecu.api.service.HistoryEntry.STATE; import de.valtech.aecu.core.service.HistoryEntryImpl; +import javax.jcr.Binary; +import javax.jcr.RepositoryException; +import javax.jcr.Session; +import javax.jcr.Value; +import javax.jcr.ValueFactory; + /** * Reads and writes history entries. * @@ -77,6 +86,9 @@ public class HistoryUtil { protected static final String ATTR_START = "start"; protected static final String ATTR_END = "end"; private static final String NAME_INDEX = "oak:index"; + // This size is limited by the LuceneDocumentMaker to be able to read the property and create the new index + // The limit is 102400 but just to be in the safe size, is set to a bit lower number + private static final int MAXIMUN_PROPERTY_SIZE = 100000; private Random random = new Random(); @@ -358,7 +370,19 @@ private void saveExecutionResultInHistory(ExecutionResult result, String path, R values.put(ATTR_RUN_STATE, result.getState().name()); values.put(ATTR_PATH, result.getPath()); if (StringUtils.isNotBlank(result.getOutput())) { - values.put(ATTR_RUN_OUTPUT, result.getOutput()); + if (result.getOutput().getBytes(StandardCharsets.UTF_8).length < MAXIMUN_PROPERTY_SIZE) { + values.put(ATTR_RUN_OUTPUT, result.getOutput()); + } else { + try { + ValueFactory factory = resolver.adaptTo(Session.class).getValueFactory(); + InputStream is = new ByteArrayInputStream(result.getOutput().getBytes()); + Binary binary = factory.createBinary(is); + Value value = factory.createValue(binary); + values.put(ATTR_RUN_OUTPUT, value); + } catch (RepositoryException e) { + LOG.error("Not able to save the output of the script as binary on the History node [{}]", entry.getPath()); + } + } } if (StringUtils.isNotBlank(result.getResult())) { values.put(ATTR_RUN_RESULT, result.getResult()); From 78a91cbb9bb5c937852b912742a4e98ce9258aeb Mon Sep 17 00:00:00 2001 From: Pablo Castelo Date: Wed, 29 May 2024 21:42:11 +0200 Subject: [PATCH 08/13] Store the value as binary when the size is too big --- .../java/de/valtech/aecu/core/history/HistoryUtil.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java b/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java index 69d9c8bd..b62ac812 100644 --- a/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java +++ b/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java @@ -54,9 +54,9 @@ import de.valtech.aecu.core.service.HistoryEntryImpl; import javax.jcr.Binary; +import javax.jcr.Node; import javax.jcr.RepositoryException; import javax.jcr.Session; -import javax.jcr.Value; import javax.jcr.ValueFactory; /** @@ -374,11 +374,13 @@ private void saveExecutionResultInHistory(ExecutionResult result, String path, R values.put(ATTR_RUN_OUTPUT, result.getOutput()); } else { try { - ValueFactory factory = resolver.adaptTo(Session.class).getValueFactory(); + Node node = entry.adaptTo(Node.class); + Session session = node.getSession(); + ValueFactory factory = session.getValueFactory(); InputStream is = new ByteArrayInputStream(result.getOutput().getBytes()); Binary binary = factory.createBinary(is); - Value value = factory.createValue(binary); - values.put(ATTR_RUN_OUTPUT, value); + node.setProperty(ATTR_RUN_OUTPUT, binary); + session.save(); } catch (RepositoryException e) { LOG.error("Not able to save the output of the script as binary on the History node [{}]", entry.getPath()); } From 4456f1cb75c6d5016a5897777daae12ffbaaf4d1 Mon Sep 17 00:00:00 2001 From: Pablo Castelo Date: Wed, 29 May 2024 21:43:48 +0200 Subject: [PATCH 09/13] Fix typo --- .../src/main/java/de/valtech/aecu/core/history/HistoryUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java b/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java index b62ac812..86320db7 100644 --- a/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java +++ b/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java @@ -87,7 +87,7 @@ public class HistoryUtil { protected static final String ATTR_END = "end"; private static final String NAME_INDEX = "oak:index"; // This size is limited by the LuceneDocumentMaker to be able to read the property and create the new index - // The limit is 102400 but just to be in the safe size, is set to a bit lower number + // The limit is 102400 but just to be in the safe side, is set to a bit lower number private static final int MAXIMUN_PROPERTY_SIZE = 100000; private Random random = new Random(); From 0e5cb32af29095454eae1a5ab4a43c1959d54df5 Mon Sep 17 00:00:00 2001 From: Pablo Castelo Date: Wed, 29 May 2024 23:29:58 +0200 Subject: [PATCH 10/13] Fix typo, store binary in a different property --- .../java/de/valtech/aecu/core/history/HistoryUtil.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java b/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java index 86320db7..57a9978e 100644 --- a/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java +++ b/core/src/main/java/de/valtech/aecu/core/history/HistoryUtil.java @@ -78,6 +78,7 @@ public class HistoryUtil { public static final String ATTR_PATH = "path"; protected static final String ATTR_RUN_OUTPUT = "runOutput"; + protected static final String ATTR_RUN_OUTPUT_FULL = "runOutputFull"; protected static final String ATTR_RUN_STATE = "runState"; protected static final String ATTR_RUN_RESULT = "runResult"; protected static final String ATTR_RUN_TIME = "runTime"; @@ -88,7 +89,7 @@ public class HistoryUtil { private static final String NAME_INDEX = "oak:index"; // This size is limited by the LuceneDocumentMaker to be able to read the property and create the new index // The limit is 102400 but just to be in the safe side, is set to a bit lower number - private static final int MAXIMUN_PROPERTY_SIZE = 100000; + private static final int MAXIMUM_PROPERTY_SIZE = 100000; private Random random = new Random(); @@ -370,16 +371,18 @@ private void saveExecutionResultInHistory(ExecutionResult result, String path, R values.put(ATTR_RUN_STATE, result.getState().name()); values.put(ATTR_PATH, result.getPath()); if (StringUtils.isNotBlank(result.getOutput())) { - if (result.getOutput().getBytes(StandardCharsets.UTF_8).length < MAXIMUN_PROPERTY_SIZE) { + if (result.getOutput().getBytes(StandardCharsets.UTF_8).length < MAXIMUM_PROPERTY_SIZE) { values.put(ATTR_RUN_OUTPUT, result.getOutput()); } else { + values.put(ATTR_RUN_OUTPUT, "Output data too big, full data is stored as a binary in runOutputFull"); + LOG.info("Script result is bigger than 100 000 bytes. Full data can be found as a binary in property runOutputFull for path {}", path ); try { Node node = entry.adaptTo(Node.class); Session session = node.getSession(); ValueFactory factory = session.getValueFactory(); InputStream is = new ByteArrayInputStream(result.getOutput().getBytes()); Binary binary = factory.createBinary(is); - node.setProperty(ATTR_RUN_OUTPUT, binary); + node.setProperty(ATTR_RUN_OUTPUT_FULL, binary); session.save(); } catch (RepositoryException e) { LOG.error("Not able to save the output of the script as binary on the History node [{}]", entry.getPath()); From 7bddc174617d734ae969869091facf987798ce54 Mon Sep 17 00:00:00 2001 From: "nicolas.hirrle" Date: Thu, 30 May 2024 19:51:11 +0200 Subject: [PATCH 11/13] documentation updates --- HISTORY | 8 +++++++- docs/developers.md | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/HISTORY b/HISTORY index d225737b..69b05a9c 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,12 @@ +2024-30-05 6.5.1 + - Store result output data in binary property in case data is too big for string property (#233) + - Remove reindex=true property in index definition as it is not allowed (#230) + - Documentation updates on logging + - Documentation update on upgrade for index move + 2023-12-07 6.5.0 - Move of aecu.ui.content to /apps/settings to avoid overwrite of the configured weekly operations window (#225) - - New filter method: filterByPropertyIsMultiple() (# + - New filter method: filterByPropertyIsMultiple() - Documentation update for filter concatenation semantics with regards of AND/OR (#212) - Documentation update for re-execute logic of groovy scripts installed through InstallHook - Documentation update for filterWith diff --git a/docs/developers.md b/docs/developers.md index 68374081..1f34ef93 100644 --- a/docs/developers.md +++ b/docs/developers.md @@ -1,12 +1,12 @@ # AEM Server Setup -By default AEM is expected to listen on localhost on port 5702. This setting can be overridden by adding parameters: +By default AEM is expected to listen on localhost on port 4502. This setting can be overridden by adding parameters: * -Daem.port=5702 * -Daem.host=localhost * -Daem.publish.port=5703 * -Daem.publish.host=localhost -You need AEM 6.3 with service pack 2 or AEM 6.4. +You need AEM 6.5 with Servicepack 13 or AEM Cloud SDK. # Build and Deploy From 122438722fe0b94ccb9a96503619ea64e88b14ec Mon Sep 17 00:00:00 2001 From: "nicolas.hirrle" Date: Thu, 30 May 2024 19:54:09 +0200 Subject: [PATCH 12/13] updating poms for 6.5.1 branch with snapshot versions --- api/pom.xml | 2 +- cloud.startup.hook/pom.xml | 2 +- complete-cloud/pom.xml | 2 +- complete/pom.xml | 2 +- core/pom.xml | 2 +- examples-cloud/pom.xml | 2 +- examples/pom.xml | 2 +- oak.index/pom.xml | 2 +- pom.xml | 2 +- ui.apps/pom.xml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index 6efa9bf8..b6a7a173 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.1-rc-SNAPSHOT aecu.api diff --git a/cloud.startup.hook/pom.xml b/cloud.startup.hook/pom.xml index e04fa7d0..ff2d088b 100644 --- a/cloud.startup.hook/pom.xml +++ b/cloud.startup.hook/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.1-rc-SNAPSHOT aecu.cloud.startup.hook diff --git a/complete-cloud/pom.xml b/complete-cloud/pom.xml index fbd6d88a..9b82a38d 100644 --- a/complete-cloud/pom.xml +++ b/complete-cloud/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.1-rc-SNAPSHOT aecu.complete.cloud diff --git a/complete/pom.xml b/complete/pom.xml index aa5af5ca..307aabc0 100644 --- a/complete/pom.xml +++ b/complete/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.1-rc-SNAPSHOT aecu.complete diff --git a/core/pom.xml b/core/pom.xml index a83859e7..b22a62af 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.1-rc-SNAPSHOT aecu.core diff --git a/examples-cloud/pom.xml b/examples-cloud/pom.xml index 79cfa832..adab3717 100644 --- a/examples-cloud/pom.xml +++ b/examples-cloud/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.1-rc-SNAPSHOT aecu.examples-cloud diff --git a/examples/pom.xml b/examples/pom.xml index ccdbde05..ef8650ee 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.1-rc-SNAPSHOT aecu.examples diff --git a/oak.index/pom.xml b/oak.index/pom.xml index d1943c0e..29254962 100644 --- a/oak.index/pom.xml +++ b/oak.index/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.1-rc-SNAPSHOT aecu.oak.index diff --git a/pom.xml b/pom.xml index 6ab06f31..265cb170 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu pom - 6.5.1-SNAPSHOT + 6.5.1-rc-SNAPSHOT AECU AEM Easy Content Upgrade https://github.com/valtech/aem-easy-content-upgrade diff --git a/ui.apps/pom.xml b/ui.apps/pom.xml index 51e8a609..bb09c6ef 100644 --- a/ui.apps/pom.xml +++ b/ui.apps/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-SNAPSHOT + 6.5.1-rc-SNAPSHOT aecu.ui.apps From b9e6fae14c697f12ddf4e99cc8561bc0a4a10624 Mon Sep 17 00:00:00 2001 From: "nicolas.hirrle" Date: Thu, 30 May 2024 19:55:09 +0200 Subject: [PATCH 13/13] updating poms for branch'release/6.5.1' with non-snapshot versions --- api/pom.xml | 2 +- cloud.startup.hook/pom.xml | 2 +- complete-cloud/pom.xml | 2 +- complete/pom.xml | 2 +- core/pom.xml | 2 +- examples-cloud/pom.xml | 2 +- examples/pom.xml | 2 +- oak.index/pom.xml | 2 +- pom.xml | 2 +- ui.apps/pom.xml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index b6a7a173..ebabad91 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu - 6.5.1-rc-SNAPSHOT + 6.5.1 aecu.api diff --git a/cloud.startup.hook/pom.xml b/cloud.startup.hook/pom.xml index ff2d088b..b05dfaf1 100644 --- a/cloud.startup.hook/pom.xml +++ b/cloud.startup.hook/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu - 6.5.1-rc-SNAPSHOT + 6.5.1 aecu.cloud.startup.hook diff --git a/complete-cloud/pom.xml b/complete-cloud/pom.xml index 9b82a38d..d2efb744 100644 --- a/complete-cloud/pom.xml +++ b/complete-cloud/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-rc-SNAPSHOT + 6.5.1 aecu.complete.cloud diff --git a/complete/pom.xml b/complete/pom.xml index 307aabc0..0e195709 100644 --- a/complete/pom.xml +++ b/complete/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-rc-SNAPSHOT + 6.5.1 aecu.complete diff --git a/core/pom.xml b/core/pom.xml index b22a62af..f5e6facc 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu - 6.5.1-rc-SNAPSHOT + 6.5.1 aecu.core diff --git a/examples-cloud/pom.xml b/examples-cloud/pom.xml index adab3717..30a74d0a 100644 --- a/examples-cloud/pom.xml +++ b/examples-cloud/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-rc-SNAPSHOT + 6.5.1 aecu.examples-cloud diff --git a/examples/pom.xml b/examples/pom.xml index ef8650ee..9966982b 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-rc-SNAPSHOT + 6.5.1 aecu.examples diff --git a/oak.index/pom.xml b/oak.index/pom.xml index 29254962..a49ae64c 100644 --- a/oak.index/pom.xml +++ b/oak.index/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-rc-SNAPSHOT + 6.5.1 aecu.oak.index diff --git a/pom.xml b/pom.xml index 265cb170..b5082db8 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ de.valtech.aecu aecu pom - 6.5.1-rc-SNAPSHOT + 6.5.1 AECU AEM Easy Content Upgrade https://github.com/valtech/aem-easy-content-upgrade diff --git a/ui.apps/pom.xml b/ui.apps/pom.xml index bb09c6ef..d6fc64d2 100644 --- a/ui.apps/pom.xml +++ b/ui.apps/pom.xml @@ -5,7 +5,7 @@ de.valtech.aecu aecu - 6.5.1-rc-SNAPSHOT + 6.5.1 aecu.ui.apps