From b5c82404da22e0b6f511e61b3c4a72b690c526b1 Mon Sep 17 00:00:00 2001 From: Quentin Tixier Date: Mon, 5 Jun 2023 16:36:32 +0200 Subject: [PATCH 1/8] front, entity and liquibase patch --- .../repositories/gitRepositoryDetail.xhtml | 16 ++++++++++++++++ .../changelog/releases/7.1-structure.xml | 7 +++++-- .../java/org/meveo/model/git/GitRepository.java | 12 ++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml b/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml index 8284ca3b6..3ec281fd3 100644 --- a/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml +++ b/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml @@ -43,6 +43,22 @@ autocompleteMethod="getBranchList" field="defaultBranch" /> +<<<<<<< Updated upstream:meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml +======= + + + + + + + + + + + + + +>>>>>>> Stashed changes:meveo-admin-web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml id = 247 - - + + + + + diff --git a/meveo-model/src/main/java/org/meveo/model/git/GitRepository.java b/meveo-model/src/main/java/org/meveo/model/git/GitRepository.java index 984c37b05..537a8c13b 100644 --- a/meveo-model/src/main/java/org/meveo/model/git/GitRepository.java +++ b/meveo-model/src/main/java/org/meveo/model/git/GitRepository.java @@ -107,6 +107,10 @@ public class GitRepository extends BusinessEntity { @Column(name = "is_locked") @Type(type = "numeric_boolean") private boolean locked; + + @Column(name = "disable_type_check") + @Type(type = "numeric_boolean") + private boolean disableTypeCheck; @Transient private String currentBranch; @@ -227,4 +231,12 @@ public boolean isLocked() { public void setLocked(boolean locked) { this.locked = locked; } + + public boolean isDisableTypeCheck() { + return disableTypeCheck; + } + + public void setDisableTypeCheck(boolean disableTypeCheck) { + this.disableTypeCheck = disableTypeCheck; + } } From 42d06ccc98258bc197e86e2589bd0c3d324f6d01 Mon Sep 17 00:00:00 2001 From: Quentin Tixier Date: Mon, 5 Jun 2023 16:37:54 +0200 Subject: [PATCH 2/8] fix xhtml --- .../repositories/gitRepositoryDetail.xhtml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml b/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml index 3ec281fd3..bb19e0f9f 100644 --- a/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml +++ b/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml @@ -43,22 +43,7 @@ autocompleteMethod="getBranchList" field="defaultBranch" /> -<<<<<<< Updated upstream:meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml -======= - - - - - - - - - - - - ->>>>>>> Stashed changes:meveo-admin-web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml Date: Mon, 5 Jun 2023 17:57:32 +0200 Subject: [PATCH 3/8] Revert "fix xhtml" This reverts commit 42d06ccc98258bc197e86e2589bd0c3d324f6d01. --- .../repositories/gitRepositoryDetail.xhtml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml b/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml index bb19e0f9f..3ec281fd3 100644 --- a/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml +++ b/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml @@ -43,7 +43,22 @@ autocompleteMethod="getBranchList" field="defaultBranch" /> +<<<<<<< Updated upstream:meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml +======= + + + + + + + + + + + + +>>>>>>> Stashed changes:meveo-admin-web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml Date: Mon, 5 Jun 2023 17:57:39 +0200 Subject: [PATCH 4/8] Revert "front, entity and liquibase patch" This reverts commit b5c82404da22e0b6f511e61b3c4a72b690c526b1. --- .../repositories/gitRepositoryDetail.xhtml | 16 ---------------- .../changelog/releases/7.1-structure.xml | 7 ++----- .../java/org/meveo/model/git/GitRepository.java | 12 ------------ 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml b/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml index 3ec281fd3..8284ca3b6 100644 --- a/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml +++ b/meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml @@ -43,22 +43,6 @@ autocompleteMethod="getBranchList" field="defaultBranch" /> -<<<<<<< Updated upstream:meveo-admin/web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml -======= - - - - - - - - - - - - - ->>>>>>> Stashed changes:meveo-admin-web/src/main/webapp/pages/admin/storages/repositories/gitRepositoryDetail.xhtml id = 247 - - - - - + + diff --git a/meveo-model/src/main/java/org/meveo/model/git/GitRepository.java b/meveo-model/src/main/java/org/meveo/model/git/GitRepository.java index 537a8c13b..984c37b05 100644 --- a/meveo-model/src/main/java/org/meveo/model/git/GitRepository.java +++ b/meveo-model/src/main/java/org/meveo/model/git/GitRepository.java @@ -107,10 +107,6 @@ public class GitRepository extends BusinessEntity { @Column(name = "is_locked") @Type(type = "numeric_boolean") private boolean locked; - - @Column(name = "disable_type_check") - @Type(type = "numeric_boolean") - private boolean disableTypeCheck; @Transient private String currentBranch; @@ -231,12 +227,4 @@ public boolean isLocked() { public void setLocked(boolean locked) { this.locked = locked; } - - public boolean isDisableTypeCheck() { - return disableTypeCheck; - } - - public void setDisableTypeCheck(boolean disableTypeCheck) { - this.disableTypeCheck = disableTypeCheck; - } } From d8ee85ad838bed7bd7ce1ff856104c469b0a6c81 Mon Sep 17 00:00:00 2001 From: Quentin Tixier Date: Mon, 5 Jun 2023 18:00:36 +0200 Subject: [PATCH 5/8] use a new parambean attribute to check if cft type matches --- .../org/meveo/commons/utils/ParamBean.java | 13 ++++++++++ .../custom/CustomTableCreatorService.java | 25 +++++++++++-------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/meveo-admin/ejbs/src/main/java/org/meveo/commons/utils/ParamBean.java b/meveo-admin/ejbs/src/main/java/org/meveo/commons/utils/ParamBean.java index fc5635656..b57e33343 100644 --- a/meveo-admin/ejbs/src/main/java/org/meveo/commons/utils/ParamBean.java +++ b/meveo-admin/ejbs/src/main/java/org/meveo/commons/utils/ParamBean.java @@ -97,6 +97,11 @@ public class ParamBean { * Reload application configuration properties file. */ private static boolean reload = false; + + /** + * Whether to check if the CFT type matche the column type in database (if table of a CET already exists) + */ + private static Boolean checkCftTypeOnModuleInstall; public ParamBean() { @@ -658,4 +663,12 @@ public void setListProperty(String key, List value) { } properties.setProperty(key, result); } + + public static Boolean getCheckCftTypeOnModuleInstall() { + return checkCftTypeOnModuleInstall; + } + + public static void setCheckCftTypeOnModuleInstall(Boolean checkCftTypeOnModuleInstall) { + ParamBean.checkCftTypeOnModuleInstall = checkCftTypeOnModuleInstall; + } } \ No newline at end of file diff --git a/meveo-admin/ejbs/src/main/java/org/meveo/service/custom/CustomTableCreatorService.java b/meveo-admin/ejbs/src/main/java/org/meveo/service/custom/CustomTableCreatorService.java index 9592756d9..dcfe80a68 100644 --- a/meveo-admin/ejbs/src/main/java/org/meveo/service/custom/CustomTableCreatorService.java +++ b/meveo-admin/ejbs/src/main/java/org/meveo/service/custom/CustomTableCreatorService.java @@ -35,6 +35,7 @@ import org.hibernate.Session; import org.meveo.admin.exception.BusinessException; import org.meveo.cache.CustomFieldsCacheContainerProvider; +import org.meveo.commons.utils.ParamBean; import org.meveo.commons.utils.StringUtils; import org.meveo.jpa.EntityManagerProvider; import org.meveo.model.crm.CustomFieldTemplate; @@ -707,8 +708,9 @@ public void addField(String sqlConnectionCode, String dbTableName, CustomFieldTe * @throws BusinessException if the computed type and the actual type doesn't match */ private void checkTypeMatches(String dbTableName, CustomFieldTemplate cft, AddColumnConfig column, String typeName, int typeSize) throws BusinessException { - String type = typeName; - switch (type) { + if(ParamBean.getCheckCftTypeOnModuleInstall()) { + String type = typeName; + switch (type) { case "int8" : type = "bigint"; break; @@ -726,15 +728,16 @@ private void checkTypeMatches(String dbTableName, CustomFieldTemplate cft, AddCo if(typeSize != 0) { type += "(" + typeSize + ")"; } - } - - if (column.getType().toLowerCase().contains(type)) { - return; - } - - // Field definition must match the existing field - if(!column.getType().toLowerCase().equals(type)) { - throw new BusinessException("Field defintion for " + cft + " (" + column.getType().toLowerCase() + ") does not match existing column in table " + dbTableName + " (" + type + ")"); + } + + if (column.getType().toLowerCase().contains(type)) { + return; + } + + // Field definition must match the existing field + if(!column.getType().toLowerCase().equals(type)) { + throw new BusinessException("Field defintion for " + cft + " (" + column.getType().toLowerCase() + ") does not match existing column in table " + dbTableName + " (" + type + ")"); + } } } From 40e157a9a3966ce668384ae573b1e0b585972866 Mon Sep 17 00:00:00 2001 From: Quentin Tixier Date: Tue, 6 Jun 2023 10:10:22 +0200 Subject: [PATCH 6/8] Revert "use a new parambean attribute to check if cft type matches" This reverts commit d8ee85ad838bed7bd7ce1ff856104c469b0a6c81. --- .../org/meveo/commons/utils/ParamBean.java | 13 ---------- .../custom/CustomTableCreatorService.java | 25 ++++++++----------- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/meveo-admin/ejbs/src/main/java/org/meveo/commons/utils/ParamBean.java b/meveo-admin/ejbs/src/main/java/org/meveo/commons/utils/ParamBean.java index b57e33343..fc5635656 100644 --- a/meveo-admin/ejbs/src/main/java/org/meveo/commons/utils/ParamBean.java +++ b/meveo-admin/ejbs/src/main/java/org/meveo/commons/utils/ParamBean.java @@ -97,11 +97,6 @@ public class ParamBean { * Reload application configuration properties file. */ private static boolean reload = false; - - /** - * Whether to check if the CFT type matche the column type in database (if table of a CET already exists) - */ - private static Boolean checkCftTypeOnModuleInstall; public ParamBean() { @@ -663,12 +658,4 @@ public void setListProperty(String key, List value) { } properties.setProperty(key, result); } - - public static Boolean getCheckCftTypeOnModuleInstall() { - return checkCftTypeOnModuleInstall; - } - - public static void setCheckCftTypeOnModuleInstall(Boolean checkCftTypeOnModuleInstall) { - ParamBean.checkCftTypeOnModuleInstall = checkCftTypeOnModuleInstall; - } } \ No newline at end of file diff --git a/meveo-admin/ejbs/src/main/java/org/meveo/service/custom/CustomTableCreatorService.java b/meveo-admin/ejbs/src/main/java/org/meveo/service/custom/CustomTableCreatorService.java index dcfe80a68..9592756d9 100644 --- a/meveo-admin/ejbs/src/main/java/org/meveo/service/custom/CustomTableCreatorService.java +++ b/meveo-admin/ejbs/src/main/java/org/meveo/service/custom/CustomTableCreatorService.java @@ -35,7 +35,6 @@ import org.hibernate.Session; import org.meveo.admin.exception.BusinessException; import org.meveo.cache.CustomFieldsCacheContainerProvider; -import org.meveo.commons.utils.ParamBean; import org.meveo.commons.utils.StringUtils; import org.meveo.jpa.EntityManagerProvider; import org.meveo.model.crm.CustomFieldTemplate; @@ -708,9 +707,8 @@ public void addField(String sqlConnectionCode, String dbTableName, CustomFieldTe * @throws BusinessException if the computed type and the actual type doesn't match */ private void checkTypeMatches(String dbTableName, CustomFieldTemplate cft, AddColumnConfig column, String typeName, int typeSize) throws BusinessException { - if(ParamBean.getCheckCftTypeOnModuleInstall()) { - String type = typeName; - switch (type) { + String type = typeName; + switch (type) { case "int8" : type = "bigint"; break; @@ -728,16 +726,15 @@ private void checkTypeMatches(String dbTableName, CustomFieldTemplate cft, AddCo if(typeSize != 0) { type += "(" + typeSize + ")"; } - } - - if (column.getType().toLowerCase().contains(type)) { - return; - } - - // Field definition must match the existing field - if(!column.getType().toLowerCase().equals(type)) { - throw new BusinessException("Field defintion for " + cft + " (" + column.getType().toLowerCase() + ") does not match existing column in table " + dbTableName + " (" + type + ")"); - } + } + + if (column.getType().toLowerCase().contains(type)) { + return; + } + + // Field definition must match the existing field + if(!column.getType().toLowerCase().equals(type)) { + throw new BusinessException("Field defintion for " + cft + " (" + column.getType().toLowerCase() + ") does not match existing column in table " + dbTableName + " (" + type + ")"); } } From ea132eff7c676d095e55786fc7ee2d4c89bf953c Mon Sep 17 00:00:00 2001 From: Quentin Tixier Date: Tue, 6 Jun 2023 11:36:51 +0200 Subject: [PATCH 7/8] skip column type check if new system prop is false --- .../custom/CustomTableCreatorService.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/meveo-admin/ejbs/src/main/java/org/meveo/service/custom/CustomTableCreatorService.java b/meveo-admin/ejbs/src/main/java/org/meveo/service/custom/CustomTableCreatorService.java index 9592756d9..724af61e7 100644 --- a/meveo-admin/ejbs/src/main/java/org/meveo/service/custom/CustomTableCreatorService.java +++ b/meveo-admin/ejbs/src/main/java/org/meveo/service/custom/CustomTableCreatorService.java @@ -35,6 +35,7 @@ import org.hibernate.Session; import org.meveo.admin.exception.BusinessException; import org.meveo.cache.CustomFieldsCacheContainerProvider; +import org.meveo.commons.utils.ParamBean; import org.meveo.commons.utils.StringUtils; import org.meveo.jpa.EntityManagerProvider; import org.meveo.model.crm.CustomFieldTemplate; @@ -707,8 +708,9 @@ public void addField(String sqlConnectionCode, String dbTableName, CustomFieldTe * @throws BusinessException if the computed type and the actual type doesn't match */ private void checkTypeMatches(String dbTableName, CustomFieldTemplate cft, AddColumnConfig column, String typeName, int typeSize) throws BusinessException { - String type = typeName; - switch (type) { + if(Boolean.parseBoolean(ParamBean.getInstance().getProperty("meveo.sql.check_column_type", "true"))) { + String type = typeName; + switch (type) { case "int8" : type = "bigint"; break; @@ -726,15 +728,16 @@ private void checkTypeMatches(String dbTableName, CustomFieldTemplate cft, AddCo if(typeSize != 0) { type += "(" + typeSize + ")"; } - } - - if (column.getType().toLowerCase().contains(type)) { - return; - } - - // Field definition must match the existing field - if(!column.getType().toLowerCase().equals(type)) { - throw new BusinessException("Field defintion for " + cft + " (" + column.getType().toLowerCase() + ") does not match existing column in table " + dbTableName + " (" + type + ")"); + } + + if (column.getType().toLowerCase().contains(type)) { + return; + } + + // Field definition must match the existing field + if(!column.getType().toLowerCase().equals(type)) { + throw new BusinessException("Field defintion for " + cft + " (" + column.getType().toLowerCase() + ") does not match existing column in table " + dbTableName + " (" + type + ")"); + } } } From d416a6cc0e409c3c842eb74c20ad8e438a84835c Mon Sep 17 00:00:00 2001 From: Quentin Tixier Date: Tue, 6 Jun 2023 11:37:16 +0200 Subject: [PATCH 8/8] v7.1.5 --- jmeter.sampler/pom.xml | 2 +- meveo-admin/ejbs/pom.xml | 2 +- meveo-admin/pom.xml | 2 +- meveo-admin/web/pom.xml | 2 +- meveo-api-dto/pom.xml | 2 +- meveo-api/pom.xml | 2 +- meveo-el-resolver/pom.xml | 2 +- meveo-json-schema/pom.xml | 2 +- meveo-model/pom.xml | 2 +- meveo-reporting/pom.xml | 2 +- meveo-security/pom.xml | 2 +- meveo-ws/pom.xml | 2 +- pom.xml | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/jmeter.sampler/pom.xml b/jmeter.sampler/pom.xml index 095660d31..7f15a7b58 100644 --- a/jmeter.sampler/pom.xml +++ b/jmeter.sampler/pom.xml @@ -19,7 +19,7 @@ meveo org.meveo - 7.1.4 + 7.1.5 diff --git a/meveo-admin/ejbs/pom.xml b/meveo-admin/ejbs/pom.xml index a570339b8..44234316a 100644 --- a/meveo-admin/ejbs/pom.xml +++ b/meveo-admin/ejbs/pom.xml @@ -4,7 +4,7 @@ meveo-admin org.meveo - 7.1.4 + 7.1.5 ../pom.xml meveo-admin-ejbs diff --git a/meveo-admin/pom.xml b/meveo-admin/pom.xml index 49dd3fe55..d3938a6c4 100644 --- a/meveo-admin/pom.xml +++ b/meveo-admin/pom.xml @@ -6,7 +6,7 @@ org.meveo meveo ../pom.xml - 7.1.4 + 7.1.5 meveo-admin diff --git a/meveo-admin/web/pom.xml b/meveo-admin/web/pom.xml index bceaa57c6..5f38ee36e 100644 --- a/meveo-admin/web/pom.xml +++ b/meveo-admin/web/pom.xml @@ -4,7 +4,7 @@ meveo-admin org.meveo ../pom.xml - 7.1.4 + 7.1.5 meveo-admin-web Meveo Admin Web Application - Web Module diff --git a/meveo-api-dto/pom.xml b/meveo-api-dto/pom.xml index eb51e421c..504bd2fa2 100644 --- a/meveo-api-dto/pom.xml +++ b/meveo-api-dto/pom.xml @@ -6,7 +6,7 @@ org.meveo meveo ../pom.xml - 7.1.4 + 7.1.5 meveo-api-dto Meveo API DTO diff --git a/meveo-api/pom.xml b/meveo-api/pom.xml index eff383c4c..5eaf056c9 100644 --- a/meveo-api/pom.xml +++ b/meveo-api/pom.xml @@ -5,7 +5,7 @@ org.meveo meveo ../pom.xml - 7.1.4 + 7.1.5 meveo-api Meveo API diff --git a/meveo-el-resolver/pom.xml b/meveo-el-resolver/pom.xml index da8914979..15153ccb2 100644 --- a/meveo-el-resolver/pom.xml +++ b/meveo-el-resolver/pom.xml @@ -3,7 +3,7 @@ meveo org.meveo - 7.1.4 + 7.1.5 4.0.0 diff --git a/meveo-json-schema/pom.xml b/meveo-json-schema/pom.xml index 8d6a5278e..f712a0b98 100644 --- a/meveo-json-schema/pom.xml +++ b/meveo-json-schema/pom.xml @@ -6,7 +6,7 @@ org.meveo meveo ../pom.xml - 7.1.4 + 7.1.5 meveo-json-schema diff --git a/meveo-model/pom.xml b/meveo-model/pom.xml index ea5224c3c..4a8221249 100644 --- a/meveo-model/pom.xml +++ b/meveo-model/pom.xml @@ -4,7 +4,7 @@ org.meveo meveo ../pom.xml - 7.1.4 + 7.1.5 meveo-model jar diff --git a/meveo-reporting/pom.xml b/meveo-reporting/pom.xml index 921c70ceb..b4f86cbe1 100644 --- a/meveo-reporting/pom.xml +++ b/meveo-reporting/pom.xml @@ -19,7 +19,7 @@ meveo org.meveo - 7.1.4 + 7.1.5 4.0.0 diff --git a/meveo-security/pom.xml b/meveo-security/pom.xml index 0eb31904d..00a02ce71 100644 --- a/meveo-security/pom.xml +++ b/meveo-security/pom.xml @@ -4,7 +4,7 @@ org.meveo meveo ../pom.xml - 7.1.4 + 7.1.5 meveo-security jar diff --git a/meveo-ws/pom.xml b/meveo-ws/pom.xml index 454583d16..e1340859d 100644 --- a/meveo-ws/pom.xml +++ b/meveo-ws/pom.xml @@ -15,7 +15,7 @@ meveo org.meveo - 7.1.4 + 7.1.5 4.0.0 diff --git a/pom.xml b/pom.xml index 0c9ae2902..a84d55b38 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.meveo meveo pom - 7.1.4 + 7.1.5 Meveo Parent Project UTF-8