diff --git a/.github/workflows/ga-publication.yml b/.github/workflows/ga-publication.yml
index fb7e7f5a4d..4f266b64bb 100755
--- a/.github/workflows/ga-publication.yml
+++ b/.github/workflows/ga-publication.yml
@@ -46,7 +46,7 @@ jobs:
- name: "Configure GA Repository"
uses: actions/setup-java@v1
with:
- java-version: 11
+ java-version: 17
server-id: maven-central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index e782e3fc85..7642c0021a 100755
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -72,10 +72,10 @@ jobs:
--token "$ENTANDO_BOT_TOKEN" \
;
#~ JDK
- - name: "Set up JDK 11"
+ - name: "Set up JDK 17"
uses: actions/setup-java@v1
with:
- java-version: 11
+ java-version: 17
#~ MAVEN CACHE
- name: "Cache Maven packages"
uses: actions/cache@v2
@@ -119,10 +119,10 @@ jobs:
# ${{ secrets.ENTANDO_OPT_PPL_INSTALL_CMD }}
# ~/ppl-run checkout-branch pr --lcd "$LOCAL_CLONE_DIR"
# #~ JDK
-# - name: "Set up JDK 11"
+# - name: "Set up JDK 17"
# uses: actions/setup-java@v1
# with:
-# java-version: 11
+# java-version: 17
# #~ MAVEN CACHE
# - name: "Cache Maven packages"
# id: maven-cache
diff --git a/.github/workflows/publication.yml b/.github/workflows/publication.yml
index bcbc107a53..80b9409e98 100755
--- a/.github/workflows/publication.yml
+++ b/.github/workflows/publication.yml
@@ -10,15 +10,15 @@ env:
ENTANDO_BOT_TOKEN: ${{ secrets.ENTANDO_BOT_TOKEN }}
PR_CHECKER_PATH: ".github/pr-title-checker-config.json"
- JDK_VERSION: 11
+ JDK_VERSION: 17
BUILD_COMMANDS: mvn clean install;
- DOCKER_EAP_IMAGE_BASE_NAME: entando/entando-de-app-eap
+# DOCKER_EAP_IMAGE_BASE_NAME: entando/entando-de-app-eap
DOCKER_TOMCAT_IMAGE_BASE_NAME: entando/entando-de-app-tomcat
- DOCKER_WILDFLY_IMAGE_BASE_NAME: entando/entando-de-app-wildfly
+# DOCKER_WILDFLY_IMAGE_BASE_NAME: entando/entando-de-app-wildfly
DOCKER_EAP-WILDFLY_IMAGE_ARCHITECTURE: linux/amd64
DOCKER_TOMCAT_IMAGE_ARCHITECTURE: linux/amd64,linux/arm64
DOCKER_IMAGE_CONTEXT: .
- DOCKER_EAP_IMAGE_FILE: Dockerfile.eap
+# DOCKER_EAP_IMAGE_FILE: Dockerfile.eap
DOCKER_TOMCAT_IMAGE_FILE: Dockerfile.tomcat
DOCKER_WILDFLY_IMAGE_FILE: Dockerfile.wildfly
DOCKER_IMAGE_PUSH: true
@@ -58,22 +58,22 @@ jobs:
- name: Build with Maven
run: ${{ env.BUILD_COMMANDS }}
- - name: Docker meta-eap
- id: meta-eap
- uses: docker/metadata-action@v4
- with:
- images: |
- ${{ env.DOCKER_EAP_IMAGE_BASE_NAME }}
- tags: |
- type=schedule
- type=ref,event=branch
- type=ref,event=pr,value={{base_ref}}
- type=ref,event=tag
- type=semver,pattern={{version}}
- type=semver,pattern={{major}}.{{minor}}
- type=semver,pattern={{major}}
- type=sha
- type=raw,event=pr,value={{base_ref}}
+# - name: Docker meta-eap
+# id: meta-eap
+# uses: docker/metadata-action@v4
+# with:
+# images: |
+# ${{ env.DOCKER_EAP_IMAGE_BASE_NAME }}
+# tags: |
+# type=schedule
+# type=ref,event=branch
+# type=ref,event=pr,value={{base_ref}}
+# type=ref,event=tag
+# type=semver,pattern={{version}}
+# type=semver,pattern={{major}}.{{minor}}
+# type=semver,pattern={{major}}
+# type=sha
+# type=raw,event=pr,value={{base_ref}}
- name: Docker meta-tomcat
id: meta-tomcat
@@ -92,22 +92,22 @@ jobs:
type=sha
type=raw,event=pr,value={{base_ref}}
- - name: Docker meta-wildfly
- id: meta-wildfly
- uses: docker/metadata-action@v4
- with:
- images: |
- ${{ env.DOCKER_WILDFLY_IMAGE_BASE_NAME }}
- tags: |
- type=schedule
- type=ref,event=branch
- type=ref,event=pr,value={{base_ref}}
- type=ref,event=tag
- type=semver,pattern={{version}}
- type=semver,pattern={{major}}.{{minor}}
- type=semver,pattern={{major}}
- type=sha
- type=raw,event=pr,value={{base_ref}}
+# - name: Docker meta-wildfly
+# id: meta-wildfly
+# uses: docker/metadata-action@v4
+# with:
+# images: |
+# ${{ env.DOCKER_WILDFLY_IMAGE_BASE_NAME }}
+# tags: |
+# type=schedule
+# type=ref,event=branch
+# type=ref,event=pr,value={{base_ref}}
+# type=ref,event=tag
+# type=semver,pattern={{version}}
+# type=semver,pattern={{major}}.{{minor}}
+# type=semver,pattern={{major}}
+# type=sha
+# type=raw,event=pr,value={{base_ref}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
@@ -130,15 +130,15 @@ jobs:
username: ${{ secrets.ENTANDO_RHT_DOCKER_USERNAME }}
password: ${{ secrets.ENTANDO_RHT_DOCKER_PASSWORD }}
- - name: Build and push eap Docker image
- uses: docker/build-push-action@v4
- with:
- context: ${{ env.DOCKER_IMAGE_CONTEXT }}
- file: ${{ env.DOCKER_EAP_IMAGE_FILE }}
- push: ${{ env.DOCKER_IMAGE_PUSH }}
- tags: ${{ steps.meta-eap.outputs.tags }}
- labels: ${{ steps.meta-eap.outputs.labels }}
- platforms: ${{ env.DOCKER_EAP-WILDFLY_IMAGE_ARCHITECTURE }}
+# - name: Build and push eap Docker image
+# uses: docker/build-push-action@v4
+# with:
+# context: ${{ env.DOCKER_IMAGE_CONTEXT }}
+# file: ${{ env.DOCKER_EAP_IMAGE_FILE }}
+# push: ${{ env.DOCKER_IMAGE_PUSH }}
+# tags: ${{ steps.meta-eap.outputs.tags }}
+# labels: ${{ steps.meta-eap.outputs.labels }}
+# platforms: ${{ env.DOCKER_EAP-WILDFLY_IMAGE_ARCHITECTURE }}
- name: Build tomcat Docker image for amd64
uses: docker/build-push-action@v4
@@ -170,12 +170,12 @@ jobs:
labels: ${{ steps.meta-tomcat.outputs.labels }}
platforms: ${{ env.DOCKER_TOMCAT_IMAGE_ARCHITECTURE }}
- - name: Build and push wildfly Docker image
- uses: docker/build-push-action@v4
- with:
- context: ${{ env.DOCKER_IMAGE_CONTEXT }}
- file: ${{ env.DOCKER_WILDFLY_IMAGE_FILE }}
- push: ${{ env.DOCKER_IMAGE_PUSH }}
- tags: ${{ steps.meta-wildfly.outputs.tags }}
- labels: ${{ steps.meta-wildfly.outputs.labels }}
- platforms: ${{ env.DOCKER_EAP-WILDFLY_IMAGE_ARCHITECTURE }}
\ No newline at end of file
+# - name: Build and push wildfly Docker image
+# uses: docker/build-push-action@v4
+# with:
+# context: ${{ env.DOCKER_IMAGE_CONTEXT }}
+# file: ${{ env.DOCKER_WILDFLY_IMAGE_FILE }}
+# push: ${{ env.DOCKER_IMAGE_PUSH }}
+# tags: ${{ steps.meta-wildfly.outputs.tags }}
+# labels: ${{ steps.meta-wildfly.outputs.labels }}
+# platforms: ${{ env.DOCKER_EAP-WILDFLY_IMAGE_ARCHITECTURE }}
\ No newline at end of file
diff --git a/Dockerfile.eap b/Dockerfile.eap
index 7faa00a595..ff8b368929 100644
--- a/Dockerfile.eap
+++ b/Dockerfile.eap
@@ -1,4 +1,4 @@
-FROM registry.hub.docker.com/entando/entando-eap73-clustered-base:7.2.0
+FROM registry.hub.docker.com/entando/entando-eap73-clustered-base:7.4.0-ENG-5316-PR-28
ARG VERSION
### Required OpenShift Labels
@@ -6,7 +6,7 @@ LABEL name="Entando App" \
maintainer="dev@entando.com" \
vendor="Entando Inc." \
version="${VERSION}" \
- release="7.0.0" \
+ release="7.4.0" \
summary="Entando Application" \
description="This Entando app engine application provides APIs and composition for Entando applications"
diff --git a/Dockerfile.tomcat b/Dockerfile.tomcat
index 32ef7b0ede..322a956e78 100644
--- a/Dockerfile.tomcat
+++ b/Dockerfile.tomcat
@@ -1,4 +1,4 @@
-FROM registry.hub.docker.com/entando/entando-tomcat-base:7.2.0-IT-410-PR-26
+FROM registry.hub.docker.com/entando/entando-tomcat-base:7.4.0-ENG-5316-PR-28
ARG VERSION
### Required OpenShift Labels
@@ -6,7 +6,7 @@ LABEL name="Entando App" \
maintainer="dev@entando.com" \
vendor="Entando Inc." \
version="${VERSION}" \
- release="7.0.0" \
+ release="7.4.0" \
summary="Entando Application" \
description="This Entando app engine application provides APIs and composition for Entando applications"
diff --git a/Dockerfile.wildfly b/Dockerfile.wildfly
index ea66661a3b..fe69d61ec2 100644
--- a/Dockerfile.wildfly
+++ b/Dockerfile.wildfly
@@ -1,4 +1,4 @@
-FROM registry.hub.docker.com/entando/entando-wildfly17-base:7.2.0
+FROM registry.hub.docker.com/entando/entando-wildfly17-base:7.4.0-ENG-5316-PR-28
ARG VERSION
@@ -7,7 +7,7 @@ LABEL name="Entando App" \
maintainer="dev@entando.com" \
vendor="Entando Inc." \
version="${VERSION}" \
- release="7.0.0" \
+ release="7.4.0" \
summary="Entando Application" \
description="This Entando app engine application provides APIs and composition for Entando applications"
diff --git a/admin-console/pom.xml b/admin-console/pom.xml
index 8f81c155b5..16bc12f476 100644
--- a/admin-console/pom.xml
+++ b/admin-console/pom.xml
@@ -4,7 +4,7 @@
org.entando
app-engine
- 7.3.0-SNAPSHOT
+ 7.4.0-SNAPSHOT
org.entando.entando
entando-admin-console
diff --git a/admin-console/src/main/java/com/agiletec/apsadmin/system/BaseAction.java b/admin-console/src/main/java/com/agiletec/apsadmin/system/BaseAction.java
index 8bbabcd0f7..786ed9c135 100644
--- a/admin-console/src/main/java/com/agiletec/apsadmin/system/BaseAction.java
+++ b/admin-console/src/main/java/com/agiletec/apsadmin/system/BaseAction.java
@@ -219,7 +219,7 @@ protected ITreeNodeManager getTreeNodeManager(ITreeNode treeNode) {
}
public TenantConfig getCurrentTenantConfig() {
- return ApsTenantApplicationUtils.getTenant().flatMap(getTenantManager()::getConfig).orElse(null);
+ return ApsTenantApplicationUtils.getTenant().flatMap(getTenantManager()::getConfigOfReadyTenant).orElse(null);
}
@Override
diff --git a/admin-console/src/main/webapp/WEB-INF/apsadmin/jsp/common/inc/pagerInfo.jsp b/admin-console/src/main/webapp/WEB-INF/apsadmin/jsp/common/inc/pagerInfo.jsp
index 6318ea6df2..53653dccb8 100644
--- a/admin-console/src/main/webapp/WEB-INF/apsadmin/jsp/common/inc/pagerInfo.jsp
+++ b/admin-console/src/main/webapp/WEB-INF/apsadmin/jsp/common/inc/pagerInfo.jsp
@@ -1,4 +1,4 @@
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="wp" uri="/aps-core" %>
|
- -
\ No newline at end of file
+ -
\ No newline at end of file
diff --git a/admin-console/src/main/webapp/WEB-INF/apsadmin/jsp/common/tiles-inserts/header.jsp b/admin-console/src/main/webapp/WEB-INF/apsadmin/jsp/common/tiles-inserts/header.jsp
index d20c0c351a..c16d5e03b6 100644
--- a/admin-console/src/main/webapp/WEB-INF/apsadmin/jsp/common/tiles-inserts/header.jsp
+++ b/admin-console/src/main/webapp/WEB-INF/apsadmin/jsp/common/tiles-inserts/header.jsp
@@ -17,6 +17,17 @@
diff --git a/admin-console/src/test/java/com/agiletec/apsadmin/system/BaseActionTest.java b/admin-console/src/test/java/com/agiletec/apsadmin/system/BaseActionTest.java
index c46451df27..6d8d4447a5 100644
--- a/admin-console/src/test/java/com/agiletec/apsadmin/system/BaseActionTest.java
+++ b/admin-console/src/test/java/com/agiletec/apsadmin/system/BaseActionTest.java
@@ -47,19 +47,19 @@ void shouldCurrentTenantWorkFine() {
apsTenantApplicationUtils.reset();
Mockito.reset(tenantManager);
apsTenantApplicationUtils.when(() -> ApsTenantApplicationUtils.getTenant()).thenReturn(Optional.of("tenantx"));
- Mockito.when(tenantManager.getConfig("tenantx")).thenReturn(Optional.empty());
+ Mockito.when(tenantManager.getConfigOfReadyTenant("tenantx")).thenReturn(Optional.empty());
config = this.baseAction.getCurrentTenantConfig();
Assertions.assertNull(config);
- Mockito.verify(tenantManager, Mockito.times(1)).getConfig("tenantx");
+ Mockito.verify(tenantManager, Mockito.times(1)).getConfigOfReadyTenant("tenantx");
apsTenantApplicationUtils.reset();
Mockito.reset(tenantManager);
apsTenantApplicationUtils.when(() -> ApsTenantApplicationUtils.getTenant()).thenReturn(Optional.of("tenanty"));
TenantConfig tc = new TenantConfig(Map.of("tenantCode","tenanty"));
- Mockito.when(tenantManager.getConfig("tenanty")).thenReturn(Optional.of(tc));
+ Mockito.when(tenantManager.getConfigOfReadyTenant("tenanty")).thenReturn(Optional.of(tc));
config = this.baseAction.getCurrentTenantConfig();
Assertions.assertNotNull(config);
- Mockito.verify(tenantManager, Mockito.times(1)).getConfig("tenanty");
+ Mockito.verify(tenantManager, Mockito.times(1)).getConfigOfReadyTenant("tenanty");
}
}
diff --git a/cds-plugin/pom.xml b/cds-plugin/pom.xml
index df0a26dd15..1ea086d684 100644
--- a/cds-plugin/pom.xml
+++ b/cds-plugin/pom.xml
@@ -5,7 +5,7 @@
org.entando
app-engine
- 7.3.0-SNAPSHOT
+ 7.4.0-SNAPSHOT
entando-plugin-jpcds
org.entando.entando.plugins
diff --git a/cds-plugin/src/main/java/org/entando/entando/plugins/jpcds/aps/system/storage/CdsStorageManager.java b/cds-plugin/src/main/java/org/entando/entando/plugins/jpcds/aps/system/storage/CdsStorageManager.java
index dd255c3ade..9cb0c81c2b 100644
--- a/cds-plugin/src/main/java/org/entando/entando/plugins/jpcds/aps/system/storage/CdsStorageManager.java
+++ b/cds-plugin/src/main/java/org/entando/entando/plugins/jpcds/aps/system/storage/CdsStorageManager.java
@@ -33,6 +33,7 @@
import org.entando.entando.aps.system.services.tenants.TenantConfig;
import org.entando.entando.aps.util.UrlUtils.EntUrlBuilder;
import org.entando.entando.ent.exception.EntException;
+import org.entando.entando.ent.exception.EntResourceNotFoundException;
import org.entando.entando.ent.exception.EntRuntimeException;
import org.entando.entando.plugins.jpcds.aps.system.storage.CdsUrlUtils.EntSubPath;
import org.springframework.beans.factory.annotation.Autowired;
@@ -159,9 +160,9 @@ public InputStream getStream(String subPath, boolean isProtectedResource) throws
log.info("File Not found - uri {}", url);
return null;
}
- throw new EntException(ERROR_EXTRACTING_FILE, e);
+ throw new EntResourceNotFoundException(ERROR_EXTRACTING_FILE, e);
} catch (Exception e) {
- throw new EntException(ERROR_EXTRACTING_FILE, e);
+ throw new EntResourceNotFoundException(ERROR_EXTRACTING_FILE, e);
}
}
diff --git a/cms-plugin/pom.xml b/cms-plugin/pom.xml
index 51d5e924bd..ed0f1b1684 100644
--- a/cms-plugin/pom.xml
+++ b/cms-plugin/pom.xml
@@ -5,7 +5,7 @@
org.entando
app-engine
- 7.3.0-SNAPSHOT
+ 7.4.0-SNAPSHOT
org.entando.entando.plugins
entando-plugin-jacms
diff --git a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/ContentManager.java b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/ContentManager.java
index b85fd127c4..1ec8ee3738 100644
--- a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/ContentManager.java
+++ b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/ContentManager.java
@@ -14,7 +14,6 @@
package com.agiletec.plugins.jacms.aps.system.services.content;
import com.agiletec.aps.system.ApsSystemUtils;
-import com.agiletec.aps.system.SystemConstants;
import com.agiletec.aps.system.common.entity.ApsEntityManager;
import com.agiletec.aps.system.common.entity.IEntityDAO;
import com.agiletec.aps.system.common.entity.IEntitySearcherDAO;
@@ -53,8 +52,9 @@
* Contents manager. This implements all the methods needed to create and manage
* the contents.
*/
-public class ContentManager extends ApsEntityManager
- implements IContentManager, GroupUtilizer, PageUtilizer, ContentUtilizer, ResourceUtilizer, CategoryUtilizer {
+public class ContentManager extends ApsEntityManager
+ implements IContentManager, GroupUtilizer, PageUtilizer,
+ ContentUtilizer, ResourceUtilizer, CategoryUtilizer {
private static final EntLogger logger = EntLogFactory.getSanitizedLogger(ContentManager.class);
@@ -615,7 +615,7 @@ public List getPageUtilizers(String pageCode) throws EntException {
}
@Override
- public List getContentUtilizers(String contentId) throws EntException {
+ public List getContentUtilizers(String contentId) throws EntException {
try {
return this.getContentDAO().getContentUtilizers(contentId);
} catch (Throwable t) {
@@ -633,7 +633,7 @@ public List getGroupUtilizers(String groupName) throws EntException {
}
@Override
- public List getResourceUtilizers(String resourceId) throws EntException {
+ public List getResourceUtilizers(String resourceId) throws EntException {
try {
return this.getContentDAO().getResourceUtilizers(resourceId);
} catch (Throwable t) {
@@ -642,7 +642,7 @@ public List getResourceUtilizers(String resourceId) throws EntException {
}
@Override
- public List getCategoryUtilizers(String resourceId) throws EntException {
+ public List getCategoryUtilizers(String resourceId) throws EntException {
try {
return this.getContentDAO().getCategoryUtilizers(resourceId);
} catch (Throwable t) {
@@ -661,7 +661,7 @@ public void reloadCategoryReferences(String categoryCode) {
@SuppressWarnings("rawtypes")
@Override
- public List getCategoryUtilizersForReloadReferences(String categoryCode) {
+ public List getCategoryUtilizersForReloadReferences(String categoryCode) {
List contentIdToReload = new ArrayList<>();
try {
Set contents = this.getContentUpdaterService().getContentsId(categoryCode);
diff --git a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/ContentUtilizer.java b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/ContentUtilizer.java
index 79528b0801..6b6faf7810 100644
--- a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/ContentUtilizer.java
+++ b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/ContentUtilizer.java
@@ -20,8 +20,9 @@
/**
* Basic interface for the services whose handled elements may have references to contents.
* @author E.Santoboni
+ * @param
*/
-public interface ContentUtilizer {
+public interface ContentUtilizer {
/**
* Return the ID of the utilizer service.
@@ -35,6 +36,6 @@ public interface ContentUtilizer {
* @return the list of the objects which reference the content.
* @throws EntException in case of error.
*/
- public List getContentUtilizers(String contentId) throws EntException;
+ public List getContentUtilizers(String contentId) throws EntException;
}
diff --git a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/model/ContentDto.java b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/model/ContentDto.java
index 67413eca75..9947eb0e2e 100644
--- a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/model/ContentDto.java
+++ b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/model/ContentDto.java
@@ -294,6 +294,7 @@ private void fillAbstractResourceAttribute(AttributeInterface attribute, EntityA
if (AbstractResourceAttribute.class.isAssignableFrom(attribute.getClass())) {
AbstractResourceAttribute resourceAttribute = (AbstractResourceAttribute) attribute;
for (Entry resourceEntry : attributeDto.getValues().entrySet()) {
+ @SuppressWarnings("unchecked")
Map resourceMap = (Map) resourceEntry.getValue();
this.setResourceAttribute(resourceAttribute, resourceMap, resourceEntry.getKey());
}
@@ -312,6 +313,7 @@ private void setResourceAttribute(AbstractResourceAttribute resourceAttribute, M
resourceInterface.setId(resourceId);
resourceInterface.setCorrelationCode(correlationCode);
resourceAttribute.setResource(resourceInterface, langCode);
+ @SuppressWarnings("unchecked")
Map values = (Map) resource.get("metadata");
if (values != null) {
Map metadata = values.entrySet().stream()
diff --git a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/widget/UserFilterOptionBean.java b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/widget/UserFilterOptionBean.java
index fbc772a0fb..065be8a49b 100644
--- a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/widget/UserFilterOptionBean.java
+++ b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/content/widget/UserFilterOptionBean.java
@@ -243,7 +243,7 @@ public EntitySearchFilter getEntityFilter() throws EntException {
AttributeInterface attribute = this.getAttribute();
if (attribute instanceof ITextAttribute) {
String text = this.getFormFieldValues().get(this.getFormFieldNames()[0]);
- filter = new EntitySearchFilter(attribute.getName(), true, text, true);
+ filter = new EntitySearchFilter(attribute.getName(), true, text, true);
if (attribute.isMultilingual()) {
filter.setLangCode(this.getCurrentLang().getCode());
}
@@ -252,7 +252,7 @@ public EntitySearchFilter getEntityFilter() throws EntException {
String end = this.getFormFieldValues().get(this.getFormFieldNames()[1]);
Date startDate = DateConverter.parseDate(start, this.getDateFormat());
Date endDate = DateConverter.parseDate(end, this.getDateFormat());
- filter = new EntitySearchFilter(attribute.getName(), true, startDate, endDate);
+ filter = new EntitySearchFilter(attribute.getName(), true, startDate, endDate);
} else if (attribute instanceof BooleanAttribute) {
String value = this.getFormFieldValues().get(this.getFormFieldNames()[0]);
String ignore = this.getFormFieldValues().get(this.getFormFieldNames()[1]);
@@ -263,7 +263,7 @@ public EntitySearchFilter getEntityFilter() throws EntException {
filter = new EntitySearchFilter(attribute.getName(), true);
filter.setNullOption(true);
} else {
- filter = new EntitySearchFilter(attribute.getName(), true, value, false);
+ filter = new EntitySearchFilter(attribute.getName(), true, value, false);
}
} else if (attribute instanceof NumberAttribute) {
String start = this.getFormFieldValues().get(this.getFormFieldNames()[0]);
@@ -278,7 +278,7 @@ public EntitySearchFilter getEntityFilter() throws EntException {
Integer endNumberInt = Integer.parseInt(end);
endNumber = new BigDecimal(endNumberInt);
} catch (Throwable t) {}
- filter = new EntitySearchFilter(attribute.getName(), true, startNumber, endNumber);
+ filter = new EntitySearchFilter(attribute.getName(), true, startNumber, endNumber);
}
} catch (Throwable t) {
_logger.error("Error extracting entity search filters", t);
@@ -308,45 +308,31 @@ public SearchEngineFilter extractFilter() {
if (!this.isAttributeFilter()) {
if (this.getKey().equals(KEY_FULLTEXT) && !StringUtils.isEmpty(value0)) {
//String[] fieldsSuffix = {"", "_option"};
- filter = new SearchEngineFilter(this.getCurrentLang().getCode(), value0, this.getOption(value1));
+ filter = new SearchEngineFilter<>(this.getCurrentLang().getCode(), value0, this.getOption(value1));
} else if (this.getKey().equals(KEY_CATEGORY) && !StringUtils.isEmpty(value0)) {
- filter = new SearchEngineFilter(IIndexerDAO.CONTENT_CATEGORY_FIELD_NAME, value0, SearchEngineFilter.TextSearchOption.EXACT);
+ filter = new SearchEngineFilter<>(IIndexerDAO.CONTENT_CATEGORY_FIELD_NAME, value0, SearchEngineFilter.TextSearchOption.EXACT);
}
} else {
AttributeInterface attribute = this.getAttribute();
if (attribute instanceof ITextAttribute && !StringUtils.isEmpty(value0)) {
- filter = new SearchEngineFilter(this.getIndexFieldName(), value0, SearchEngineFilter.TextSearchOption.EXACT);
+ filter = new SearchEngineFilter<>(this.getIndexFieldName(), value0, SearchEngineFilter.TextSearchOption.EXACT);
//String[] fieldsSuffix = {"_textFieldName"};
} else if (attribute instanceof DateAttribute &&
(!StringUtils.isEmpty(value0) || !StringUtils.isEmpty(value1))) {
- Date big0 = null;
- try {
- big0 = DateConverter.parseDate(value0, this.getDateFormat());
- } catch (Exception e) {}
- Date big1 = null;
- try {
- big1 = DateConverter.parseDate(value1, this.getDateFormat());
- } catch (Exception e) {}
+ Date big0 = DateConverter.parseDate(value0, this.getDateFormat());
+ Date big1 = DateConverter.parseDate(value1, this.getDateFormat());
//String[] fieldsSuffix = {"_dateStartFieldName", "_dateEndFieldName"};
- filter = new SearchEngineFilter(this.getIndexFieldName(), big0, big1);
+ filter = new SearchEngineFilter<>(this.getIndexFieldName(), big0, big1);
} else if (attribute instanceof BooleanAttribute &&
(!StringUtils.isEmpty(value0) && !StringUtils.isEmpty(value1))) {
- filter = new SearchEngineFilter(this.getIndexFieldName(), value0, SearchEngineFilter.TextSearchOption.EXACT);
+ filter = new SearchEngineFilter<>(this.getIndexFieldName(), value0, SearchEngineFilter.TextSearchOption.EXACT);
//String[] fieldsSuffix = {"_booleanFieldName", "_booleanFieldName_ignore", "_booleanFieldName_control"};
} else if (attribute instanceof NumberAttribute &&
(!StringUtils.isEmpty(value0) || !StringUtils.isEmpty(value1))) {
//String[] fieldsSuffix = {"_numberStartFieldName", "_numberEndFieldName"};
- BigDecimal big0 = null;
- try {
- big0 = new BigDecimal(value0);
- } catch (Exception e) {
- }
- BigDecimal big1 = null;
- try {
- big1 = new BigDecimal(value1);
- } catch (Exception e) {
- }
- filter = new SearchEngineFilter(this.getIndexFieldName(), big0, big1);
+ BigDecimal big0 = new BigDecimal(value0);
+ BigDecimal big1 = new BigDecimal(value1);
+ filter = new SearchEngineFilter<>(this.getIndexFieldName(), big0, big1);
}
}
return filter;
diff --git a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/ResourceManager.java b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/ResourceManager.java
index da3d4da41f..4e80457f7d 100644
--- a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/ResourceManager.java
+++ b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/ResourceManager.java
@@ -59,8 +59,8 @@
*
* @author W.Ambu - E.Santoboni
*/
-public class ResourceManager extends AbstractService implements IResourceManager, GroupUtilizer, CategoryUtilizer,
- RefreshableBeanTenantAware {
+public class ResourceManager extends AbstractService
+ implements IResourceManager, GroupUtilizer, CategoryUtilizer, RefreshableBeanTenantAware {
private final EntLogger logger = EntLogFactory.getSanitizedLogger(getClass());
@@ -603,7 +603,7 @@ public List getGroupUtilizers(String groupName) throws EntException {
}
@Override
- public List getCategoryUtilizers(String categoryCode) throws EntException {
+ public List getCategoryUtilizers(String categoryCode) throws EntException {
List resourcesId = null;
try {
resourcesId = this.getResourceDAO().searchResourcesId(null, null, null, categoryCode, null);
@@ -643,7 +643,7 @@ public void reloadCategoryReferences(String categoryCode) throws EntException {
}
@Override
- public List getCategoryUtilizersForReloadReferences(String categoryCode) throws EntException {
+ public List getCategoryUtilizersForReloadReferences(String categoryCode) throws EntException {
List resourcesId = null;
try {
resourcesId = this.getCategoryUtilizers(categoryCode);
diff --git a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/ResourceUtilizer.java b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/ResourceUtilizer.java
index 1c9d97a74d..d606c83a50 100644
--- a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/ResourceUtilizer.java
+++ b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/ResourceUtilizer.java
@@ -21,8 +21,9 @@
* Interfaccia base per i servizi, i cui elementi gestiti,
* possono presentare delle referenziazione con delle risorse.
* @author E.Santoboni
+ * @param
*/
-public interface ResourceUtilizer {
+public interface ResourceUtilizer {
/**
* Restituisce l'identificativo del servizio utilizzatore.
@@ -37,6 +38,6 @@ public interface ResourceUtilizer {
* @return La lista degli oggetti referenzianti la risorsa.
* @throws EntException in caso di errore.
*/
- public List getResourceUtilizers(String resourceId) throws EntException;
+ public List getResourceUtilizers(String resourceId) throws EntException;
}
diff --git a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/model/AbstractMonoInstanceResource.java b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/model/AbstractMonoInstanceResource.java
index 6aa9d8b809..b5b1ffca2d 100644
--- a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/model/AbstractMonoInstanceResource.java
+++ b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/model/AbstractMonoInstanceResource.java
@@ -19,6 +19,9 @@
import org.apache.commons.lang.StringUtils;
import java.io.InputStream;
+import org.entando.entando.ent.exception.EntResourceNotFoundException;
+import org.entando.entando.ent.exception.EntResourceNotFoundRuntimeException;
+import org.entando.entando.ent.exception.EntRuntimeException;
import org.entando.entando.ent.util.EntLogging.EntLogFactory;
import org.entando.entando.ent.util.EntLogging.EntLogger;
@@ -28,6 +31,7 @@
public abstract class AbstractMonoInstanceResource extends AbstractResource {
private static final EntLogger logger = EntLogFactory.getSanitizedLogger(AbstractMonoInstanceResource.class);
+ public static final String ERROR_ON_EXTRACTING_RESOURCE_STREAM = "Error on extracting resource Stream";
private ResourceInstance instance;
@@ -46,16 +50,18 @@ public boolean isMultiInstance() {
public InputStream getResourceStream(int size, String langCode) {
return this.getResourceStream();
}
-
+
@Override
public InputStream getResourceStream() {
ResourceInstance resourceInstance = instance;
String subPath = super.getDiskSubFolder() + resourceInstance.getFileName();
try {
return this.getStorageManager().getStream(subPath, this.isProtectedResource());
+ } catch (EntResourceNotFoundException e) {
+ throw new EntResourceNotFoundRuntimeException(ERROR_ON_EXTRACTING_RESOURCE_STREAM, e);
} catch (Throwable t) {
- logger.error("Error on extracting resource Stream", t);
- throw new RuntimeException("Error on extracting resource Stream", t);
+ logger.error(ERROR_ON_EXTRACTING_RESOURCE_STREAM, t);
+ throw new EntRuntimeException(ERROR_ON_EXTRACTING_RESOURCE_STREAM, t);
}
}
diff --git a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/model/ImageResource.java b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/model/ImageResource.java
index 9d33f00b3c..db308e390a 100644
--- a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/model/ImageResource.java
+++ b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/model/ImageResource.java
@@ -34,6 +34,9 @@
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.entando.entando.ent.exception.EntException;
+import org.entando.entando.ent.exception.EntResourceNotFoundException;
+import org.entando.entando.ent.exception.EntResourceNotFoundRuntimeException;
+import org.entando.entando.ent.exception.EntRuntimeException;
import org.entando.entando.ent.util.EntLogging.EntLogFactory;
import org.entando.entando.ent.util.EntLogging.EntLogger;
import org.im4java.core.ConvertCmd;
@@ -42,6 +45,7 @@
public class ImageResource extends AbstractMultiInstanceResource {
private static final String FAILED_TO_DELETE_TEMP_FILE = "Failed to delete temp file {}";
+ public static final String ERROR_ON_EXTRACTING_FILE = "Error on extracting file";
private IImageDimensionReader imageDimensionReader;
private Map imageResizerClasses;
private boolean imageMagickEnabled;
@@ -74,9 +78,11 @@ public InputStream getResourceStream(int size, String langCode) {
String subPath = super.getDiskSubFolder() + instance.getFileName();
try {
return this.getStorageManager().getStream(subPath, this.isProtectedResource());
+ } catch (EntResourceNotFoundException e) {
+ throw new EntResourceNotFoundRuntimeException(ERROR_ON_EXTRACTING_FILE, e);
} catch (Throwable t) {
- logger.error("Error on extracting file", t);
- throw new RuntimeException("Error on extracting file", t);
+ logger.error(ERROR_ON_EXTRACTING_FILE, t);
+ throw new EntRuntimeException(ERROR_ON_EXTRACTING_FILE, t);
}
}
diff --git a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/model/ResourceDataBean.java b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/model/ResourceDataBean.java
index 010e6d9225..23d571b89c 100644
--- a/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/model/ResourceDataBean.java
+++ b/cms-plugin/src/main/java/com/agiletec/plugins/jacms/aps/system/services/resource/model/ResourceDataBean.java
@@ -108,7 +108,7 @@ public interface ResourceDataBean {
*
* @return La lista dei metadati della risorsa.
*/
- public Map getMetadata();
+ public Map getMetadata();
public void setMetadata(Map metadata);
diff --git a/cms-plugin/src/main/java/org/entando/entando/plugins/jacms/aps/system/services/content/ContentService.java b/cms-plugin/src/main/java/org/entando/entando/plugins/jacms/aps/system/services/content/ContentService.java
index 2eae9592f4..a582f2f6fc 100644
--- a/cms-plugin/src/main/java/org/entando/entando/plugins/jacms/aps/system/services/content/ContentService.java
+++ b/cms-plugin/src/main/java/org/entando/entando/plugins/jacms/aps/system/services/content/ContentService.java
@@ -109,13 +109,13 @@
public class ContentService extends AbstractEntityService
implements IContentService,
GroupServiceUtilizer, CategoryServiceUtilizer,
- PageServiceUtilizer, ContentServiceUtilizer,
- ResourceServiceUtilizer,
- IComponentExistsService, IComponentUsageService,
+ PageServiceUtilizer, ContentServiceUtilizer,
+ ResourceServiceUtilizer,
+ IComponentExistsService, IComponentUsageService,
ApplicationContextAware {
private final EntLogger logger = EntLogFactory.getSanitizedLogger(getClass());
-
+
private ICategoryManager categoryManager;
private IContentManager contentManager;
private IContentModelManager contentModelManager;
@@ -326,7 +326,8 @@ protected void fillEntity(EntityDto request, Content entity, BindingResult bindi
@Override
public List getGroupUtilizer(String groupCode) {
try {
- List contentIds = ((GroupUtilizer) this.getContentManager()).getGroupUtilizers(groupCode);
+ @SuppressWarnings("unchecked")
+ List contentIds = ((GroupUtilizer) this.getContentManager()).getGroupUtilizers(groupCode);
return this.buildDtoList(contentIds);
} catch (EntException ex) {
logger.error("Error loading content references for group {}", groupCode, ex);
@@ -337,6 +338,7 @@ public List getGroupUtilizer(String groupCode) {
@Override
public List getCategoryUtilizer(String categoryCode) {
try {
+ @SuppressWarnings("unchecked")
List contentIds = ((CategoryUtilizer) this.getContentManager()).getCategoryUtilizers(categoryCode);
return this.buildDtoList(contentIds);
} catch (EntException ex) {
@@ -348,6 +350,7 @@ public List getCategoryUtilizer(String categoryCode) {
@Override
public List getPageUtilizer(String pageCode) {
try {
+ @SuppressWarnings("unchecked")
List contentIds = ((PageUtilizer) this.getContentManager()).getPageUtilizers(pageCode);
return this.buildDtoList(contentIds);
} catch (EntException ex) {
@@ -359,6 +362,7 @@ public List getPageUtilizer(String pageCode) {
@Override
public List getContentUtilizer(String contentId) {
try {
+ @SuppressWarnings("unchecked")
List contentIds = ((ContentUtilizer) this.getContentManager()).getContentUtilizers(contentId);
return this.buildDtoList(contentIds);
} catch (EntException ex) {
@@ -370,6 +374,7 @@ public List getContentUtilizer(String contentId) {
@Override
public List getResourceUtilizer(String resourceId) {
try {
+ @SuppressWarnings("unchecked")
List contentIds = ((ResourceUtilizer) this.getContentManager()).getResourceUtilizers(resourceId);
return this.buildDtoList(contentIds);
} catch (EntException ex) {
@@ -561,11 +566,9 @@ private PagedMetadata toPagedMetadata(RestContentListRequest request
public Integer countContentsByType(String contentType) {
try {
EntitySearchFilter[] filters = new EntitySearchFilter[]{
- new EntitySearchFilter("typeCode", false, contentType, false)
+ new EntitySearchFilter<>("typeCode", false, contentType, false)
};
-
List userGroupCodes = Collections.singletonList("administrators");
-
return getContentManager().countWorkContents(null, false, filters, userGroupCodes);
} catch (Exception t) {
logger.error("error in contents count by type", t);
@@ -714,13 +717,13 @@ public ContentDto updateContent(ContentDto request, UserDetails user, BindingRes
request.setRestriction(ContentRestriction.getRestrictionValue(request.getMainGroup()));
return super.updateEntity(JacmsSystemConstants.CONTENT_MANAGER, request, bindingResult);
}
-
+
@Override
public void deleteContent(String code, UserDetails user) {
this.checkContentAuthorization(user, code, false, true, null);
this.deleteContent(code);
}
-
+
private void deleteContent(String code) {
try {
Content content = this.getContentManager().loadContent(code, false);
@@ -749,7 +752,7 @@ public ContentDto updateContentStatus(String code, String status, UserDetails us
return updateContentStatus(code, status, user, bindingResult, false);
}
- private ContentDto updateContentStatus(String code, String status,
+ private ContentDto updateContentStatus(String code, String status,
UserDetails user, BeanPropertyBindingResult bindingResult, boolean forceUnpublish) {
try {
this.checkContentExists(code);
@@ -841,16 +844,16 @@ public PagedMetadata> getContentReferences(String code, String managerName, Us
logger.warn("no content found with code {}", code);
throw new ResourceNotFoundException(ERRCODE_CONTENT_NOT_FOUND, ComponentUsageEntity.TYPE_CONTENT, code);
}
- ContentServiceUtilizer> utilizer = this.getContentServiceUtilizer(managerName);
+ ContentServiceUtilizer utilizer = this.getContentServiceUtilizer(managerName);
if (null == utilizer) {
logger.warn("no references found for {}", managerName);
throw new ResourceNotFoundException(ERRCODE_CONTENT_REFERENCES, "reference", managerName);
}
- List> dtoList = utilizer.getContentUtilizer(code);
- List> subList = requestList.getSublist(dtoList);
- SearcherDaoPaginatedResult> pagedResult = new SearcherDaoPaginatedResult(dtoList.size(), subList);
- PagedMetadata