Skip to content
Merged
4 changes: 2 additions & 2 deletions .github/workflows/ga-publication.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
--id "CHECKOUT FOR GA PUBLICATION" \
--lcd "$LOCAL_CLONE_DIR"
- name: "Cache Maven packages"
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand All @@ -63,4 +63,4 @@ jobs:
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
12 changes: 6 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,21 @@ jobs:
java-version: 11
#~ MAVEN CACHE
- name: "Cache Maven packages"
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2
restore-keys: ${{ runner.os }}-m2
#~ BUILD CACHE
- name: "Cache Build Dir"
id: build-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: "${{ env.LOCAL_CLONE_DIR }}/target/"
key: ${{ runner.os }}-build-${{ env.BUILD_CACHE_KEY }}
#~ SONAR CACHE
- name: Cache SonarCloud packages
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
#~ MAVEN CACHE
- name: "Cache Maven packages"
id: maven-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-matrix-${{ matrix.scan-type }}
Expand All @@ -162,7 +162,7 @@ jobs:
#~ BUILD CACHE
- name: "Cache Build Dir"
id: build-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: "${{ env.LOCAL_CLONE_DIR}}/target/"
key: ${{ runner.os }}-build-${{ env.BUILD_CACHE_KEY }}
Expand All @@ -188,4 +188,4 @@ jobs:
export ENTANDO_OPT_TEST_TLS_KEY="${{ secrets.ENTANDO_OPT_TEST_TLS_KEY }}"
;;
esac
~/ppl-run generic "$SCAN_TYPE" mvn --id "$SCAN_TYPE" --lcd "$LOCAL_CLONE_DIR"
~/ppl-run generic "$SCAN_TYPE" mvn --id "$SCAN_TYPE" --lcd "$LOCAL_CLONE_DIR"
14 changes: 7 additions & 7 deletions .github/workflows/publication.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ jobs:
java-version: 11
#~ MAVEN CACHE
- name: "Cache Maven packages"
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2
restore-keys: ${{ runner.os }}-m2
#~ BUILD CACHE
- name: "Cache Build Dir"
id: build-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: "${{ env.LOCAL_CLONE_DIR }}/target/"
key: ${{ runner.os }}-build-${{ env.BUILD_CACHE_KEY }}
Expand Down Expand Up @@ -131,15 +131,15 @@ jobs:
java-version: 11
#~ MAVEN CACHE
- name: "Cache Maven packages"
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2
restore-keys: ${{ runner.os }}-m2
#~ BUILD CACHE
- name: "Cache Build Dir"
id: build-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: "${{ env.LOCAL_CLONE_DIR }}/target/"
key: ${{ runner.os }}-build-${{ env.BUILD_CACHE_KEY }}
Expand Down Expand Up @@ -177,15 +177,15 @@ jobs:
java-version: 11
#~ MAVEN CACHE
- name: "Cache Maven packages"
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2
restore-keys: ${{ runner.os }}-m2
#~ BUILD CACHE
- name: "Cache Build Dir"
id: build-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: "${{ env.LOCAL_CLONE_DIR }}/target/"
key: ${{ runner.os }}-build-${{ env.BUILD_CACHE_KEY }}
Expand All @@ -200,4 +200,4 @@ jobs:
export ENTANDO_OPT_TEST_TLS_CRT="${{ secrets.ENTANDO_OPT_TEST_TLS_CRT }}"
export ENTANDO_OPT_TEST_TLS_KEY="${{ secrets.ENTANDO_OPT_TEST_TLS_KEY }}"

~/ppl-run generic "POST-DEP-TESTS" --id "POST_DEP_TESTS" --lcd "$LOCAL_CLONE_DIR"
~/ppl-run generic "POST-DEP-TESTS" --id "POST_DEP_TESTS" --lcd "$LOCAL_CLONE_DIR"
19 changes: 15 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<parent>
<groupId>org.entando</groupId>
<artifactId>entando-core-parent</artifactId>
<version>6.5.0-ENG-5128-PR-156</version>
<version>6.5.0</version>
</parent>
<artifactId>entando-plugin-jpversioning</artifactId>
<groupId>org.entando.entando.plugins</groupId>
<packaging>war</packaging>
<version>6.5.1</version>
<version>6.5.2</version>
<name>Entando Plugin: Content Versioning</name>
<description>Manages the versioning of portal content, storing the history of performed operations</description>
<developers>
Expand Down Expand Up @@ -99,7 +99,7 @@
<dependency>
<groupId>org.entando</groupId>
<artifactId>entando-core-bom</artifactId>
<version>6.5.0-ENG-5128</version>
<version>6.5.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -111,6 +111,7 @@
<groupId>org.entando.entando.plugins</groupId>
<artifactId>entando-plugin-jacms</artifactId>
<classifier>classes</classifier>
<version>6.5.4-ESB-827-PR-240</version>
</dependency>
<dependency>
<groupId>org.entando.entando</groupId>
Expand Down Expand Up @@ -146,6 +147,7 @@
<groupId>org.entando.entando.plugins</groupId>
<artifactId>entando-plugin-jacms</artifactId>
<type>test-jar</type>
<version>6.5.4-ESB-827-PR-240</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand All @@ -163,6 +165,16 @@
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
Expand Down Expand Up @@ -201,6 +213,5 @@
<version>2.14.1</version>
<type>jar</type>
</dependency>

</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.agiletec.plugins.jpversioning.aps.system.services.versioning;

import com.agiletec.aps.system.ApsSystemUtils.ApsDeepDebug;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.function.Supplier;
import org.entando.entando.aps.system.services.IFeatureFlag;

public interface IFDeferredVersioning extends IFeatureFlag {
boolean DEFERRED_VERSIONING_ENABLED = checkEnabled();

default boolean isEnabled() {
return DEFERRED_VERSIONING_ENABLED;
}

static boolean checkEnabled() {
return IFeatureFlag.readEnablementStatus("DEFERRED_VERSIONING");
}

static CompletableFuture<Void> possiblyDeferred(Executor executor, Supplier<String> action, String method) {
if (checkEnabled()) {
ApsDeepDebug.print("deferred-versioning", "running versioning task in a separate thread: " + method);

return CompletableFuture.runAsync(() -> action.get(), executor);
} else {
try {
action.get();
return CompletableFuture.completedFuture(null);
} catch (Exception e) {
CompletableFuture<Void> failed = new CompletableFuture<>();
failed.completeExceptionally(e);
return failed;
}
}
}

}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questo non l'ho capito

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risolto, in effetti non c'era nessuno a raccogliere l'eccezione asincrona

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import com.agiletec.aps.system.common.entity.IEntityManager;
import java.util.List;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import org.entando.entando.ent.exception.EntException;
import com.agiletec.plugins.jacms.aps.system.services.content.model.Content;

Expand All @@ -47,13 +49,13 @@ public interface IVersioningManager {
public ContentVersion getVersion(long id) throws EntException;

public ContentVersion getLastVersion(String contentId) throws EntException;
public void saveContentVersion(String contentId) throws EntException;

public void saveContentVersion(String contentId) throws EntException;

public void deleteVersion(long versionid) throws EntException;

public void deleteWorkVersions(String contentId, int onlineVersion) throws EntException;

public Content getContent(ContentVersion contentVersion) throws EntException;

}
}
Loading
Loading