From: Mathieu Date: Fri, 4 Nov 2022 06:24:36 +0000 (+0100) Subject: Load typologies from the same package as maintenance by default X-Git-Tag: v2.3.9~27 X-Git-Url: https://git.argeo.org/?p=gpl%2Fargeo-suite.git;a=commitdiff_plain;h=c27a53c10db7f737ef700aa4dea92fc86c08020e Load typologies from the same package as maintenance by default --- diff --git a/org.argeo.app.core/src/org/argeo/app/core/CustomMaintenanceService.java b/org.argeo.app.core/src/org/argeo/app/core/CustomMaintenanceService.java index 4b69883..1c0e26d 100644 --- a/org.argeo.app.core/src/org/argeo/app/core/CustomMaintenanceService.java +++ b/org.argeo.app.core/src/org/argeo/app/core/CustomMaintenanceService.java @@ -25,7 +25,7 @@ public abstract class CustomMaintenanceService extends AbstractMaintenanceServic } protected String getTypologiesLoadBase() { - return "/sys/terms"; + return ""; } protected void loadTypologies(Node customBaseNode) throws RepositoryException, IOException { @@ -44,8 +44,10 @@ public abstract class CustomMaintenanceService extends AbstractMaintenanceServic try { // if (termsBase.hasNode(name)) // return; - - String termsLoadPath = getTypologiesLoadBase() + '/' + name + ".xml"; + String typologiesLoadBase = getTypologiesLoadBase(); + if (typologiesLoadBase.contains("/") && !typologiesLoadBase.endsWith("/")) + typologiesLoadBase = typologiesLoadBase + "/"; + String termsLoadPath = typologiesLoadBase + name + ".xml"; URL termsUrl = getClass().getClassLoader().getResource(termsLoadPath); if (termsUrl == null) throw new IllegalArgumentException("Terms '" + name + "' not found.");