This is an automated email from the ASF dual-hosted git repository. mridulpathak pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
commit 62412c5aa66d39bd5f71d4b3ebea0788c8952036 Author: Mridul Pathak <[email protected]> AuthorDate: Thu Jul 23 20:30:29 2026 +0530 Added: Optional disableEeca attribute to entity import services (OFBIZ-5259) Expose a disableEeca attribute on parseEntityXmlFile, entityImport, and entityImportDir (default off, no behavior change unless set) that calls the existing EntitySaxReader.setDisableEeca(true) to skip Entity Change Actions while the import runs. Add a corresponding checkbox and tooltip warning to the EntityImport and EntityImportDir webtools screens. This gives operators explicit control for full-instance snapshot restores, where ECA side effects (e.g. order status changes triggered by importing OrderPaymentPreference) are unwanted. --- framework/webtools/config/WebtoolsUiLabels.xml | 6 ++++++ framework/webtools/servicedef/services.xml | 3 +++ .../src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java | 8 ++++++++ framework/webtools/template/entity/EntityImport.ftl | 1 + framework/webtools/template/entity/EntityImportDir.ftl | 1 + 5 files changed, 19 insertions(+) diff --git a/framework/webtools/config/WebtoolsUiLabels.xml b/framework/webtools/config/WebtoolsUiLabels.xml index 786515d1b0..5f257dcdf4 100644 --- a/framework/webtools/config/WebtoolsUiLabels.xml +++ b/framework/webtools/config/WebtoolsUiLabels.xml @@ -1665,6 +1665,12 @@ <value xml:lang="en">Use instead</value> <value xml:lang="fr">Utilisez en remplacement</value> </property> + <property key="WebtoolsDisableEeca"> + <value xml:lang="en">Disable ECAs</value> + </property> + <property key="WebtoolsDisableEecaWarning"> + <value xml:lang="en">Disabling ECAs prevents entity-change-triggered services (e.g. order status updates) from firing while this data is loaded. Use this for full-instance snapshot restores; leave it unchecked for partial or incremental imports that rely on those side effects.</value> + </property> <property key="WebtoolsDispatcherName"> <value xml:lang="de">Dispatcher-Name</value> <value xml:lang="en">Dispatcher Name</value> diff --git a/framework/webtools/servicedef/services.xml b/framework/webtools/servicedef/services.xml index dcbb320b79..d7d3fa80d9 100644 --- a/framework/webtools/servicedef/services.xml +++ b/framework/webtools/servicedef/services.xml @@ -37,6 +37,7 @@ under the License. <attribute name="txTimeout" type="Integer" mode="IN" optional="true"/> <attribute name="createDummyFks" type="String" mode="IN" optional="true"/> <attribute name="checkDataOnly" type="String" mode="IN" optional="true"/> + <attribute name="disableEeca" type="String" mode="IN" optional="true"/> <attribute name="placeholderValues" type="java.util.Map" mode="IN" optional="true"/> <attribute name="rowProcessed" type="Long" mode="OUT" optional="false"/> </service> @@ -52,6 +53,7 @@ under the License. <attribute name="maintainTimeStamps" type="String" mode="IN" optional="true"/> <attribute name="createDummyFks" type="String" mode="IN" optional="true"/> <attribute name="checkDataOnly" type="String" mode="IN" optional="true"/> + <attribute name="disableEeca" type="String" mode="IN" optional="true"/> <attribute name="txTimeout" type="Integer" mode="IN" optional="true"/> <attribute name="placeholderValues" type="java.util.Map" mode="IN" optional="true"/> <attribute name="messages" type="List" mode="OUT" optional="false"/> @@ -65,6 +67,7 @@ under the License. <attribute name="maintainTimeStamps" type="String" mode="IN" optional="true"/> <attribute name="createDummyFks" type="String" mode="IN" optional="true"/> <attribute name="checkDataOnly" type="String" mode="IN" optional="true"/> + <attribute name="disableEeca" type="String" mode="IN" optional="true"/> <attribute name="deleteFiles" type="String" mode="IN" optional="true"/> <attribute name="txTimeout" type="Integer" mode="IN" optional="true"/> <attribute name="filePause" type="Long" mode="IN" optional="true"/> diff --git a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java index 9f3de0db26..be22773f6c 100644 --- a/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java +++ b/framework/webtools/src/main/java/org/apache/ofbiz/webtools/WebToolsServices.java @@ -122,6 +122,7 @@ public class WebToolsServices { String maintainTimeStamps = (String) context.get("maintainTimeStamps"); String createDummyFks = (String) context.get("createDummyFks"); String checkDataOnly = (String) context.get("checkDataOnly"); + String disableEeca = (String) context.get("disableEeca"); Map<String, Object> placeholderValues = UtilGenerics.cast(context.get("placeholderValues")); Integer txTimeout = (Integer) context.get("txTimeout"); @@ -212,6 +213,7 @@ public class WebToolsServices { Map<String, Object> inputMap = UtilMisc.toMap("onlyInserts", onlyInserts, "createDummyFks", createDummyFks, "checkDataOnly", checkDataOnly, + "disableEeca", disableEeca, "maintainTimeStamps", maintainTimeStamps, "txTimeout", txTimeout, "placeholderValues", placeholderValues, @@ -253,6 +255,7 @@ public class WebToolsServices { String onlyInserts = (String) context.get("onlyInserts"); String maintainTimeStamps = (String) context.get("maintainTimeStamps"); String createDummyFks = (String) context.get("createDummyFks"); + String disableEeca = (String) context.get("disableEeca"); boolean deleteFiles = (String) context.get("deleteFiles") != null; String checkDataOnly = (String) context.get("checkDataOnly"); Map<String, Object> placeholderValues = UtilGenerics.cast(context.get("placeholderValues")); @@ -296,6 +299,7 @@ public class WebToolsServices { Map<String, Object> parseEntityXmlFileArgs = UtilMisc.toMap("onlyInserts", onlyInserts, "createDummyFks", createDummyFks, "checkDataOnly", checkDataOnly, + "disableEeca", disableEeca, "maintainTimeStamps", maintainTimeStamps, "txTimeout", txTimeout, "placeholderValues", placeholderValues, @@ -479,6 +483,7 @@ public class WebToolsServices { boolean maintainTimeStamps = (String) context.get("maintainTimeStamps") != null; boolean createDummyFks = (String) context.get("createDummyFks") != null; boolean checkDataOnly = (String) context.get("checkDataOnly") != null; + boolean disableEeca = (String) context.get("disableEeca") != null; Integer txTimeout = (Integer) context.get("txTimeout"); Map<String, Object> placeholderValues = UtilGenerics.cast(context.get("placeholderValues")); @@ -495,6 +500,9 @@ public class WebToolsServices { reader.setCreateDummyFks(createDummyFks); reader.setCheckDataOnly(checkDataOnly); reader.setPlaceholderValues(placeholderValues); + if (disableEeca) { + reader.setDisableEeca(true); + } long numberRead = (url != null ? reader.parse(url) : reader.parse(xmltext)); rowProcessed = numberRead; diff --git a/framework/webtools/template/entity/EntityImport.ftl b/framework/webtools/template/entity/EntityImport.ftl index c99dff2457..cd5cbb2f11 100644 --- a/framework/webtools/template/entity/EntityImport.ftl +++ b/framework/webtools/template/entity/EntityImport.ftl @@ -54,6 +54,7 @@ under the License. <label><input type="checkbox" name="maintainTimeStamps" <#if keepStamps??>checked="checked"</#if>/>${uiLabelMap.WebtoolsMaintainTimestamps}</label> <label><input type="checkbox" name="createDummyFks" <#if createDummyFks??>checked="checked"</#if>/>${uiLabelMap.WebtoolsCreateDummyFks}</label> <label><input type="checkbox" name="checkDataOnly" <#if checkDataOnly??>checked="checked"</#if>/>${uiLabelMap.WebtoolsCheckDataOnly}</label> + <label><input type="checkbox" name="disableEeca" <#if disableEeca??>checked="checked"</#if>/>${uiLabelMap.WebtoolsDisableEeca}</label><span class="tooltip">${uiLabelMap.WebtoolsDisableEecaWarning}</span> </td> </tr> <tr> diff --git a/framework/webtools/template/entity/EntityImportDir.ftl b/framework/webtools/template/entity/EntityImportDir.ftl index d78235ab0a..f47154e650 100644 --- a/framework/webtools/template/entity/EntityImportDir.ftl +++ b/framework/webtools/template/entity/EntityImportDir.ftl @@ -46,6 +46,7 @@ under the License. <label><input type="checkbox" name="createDummyFks" <#if createDummyFks??>checked="checked"</#if>/>${uiLabelMap.WebtoolsCreateDummyFks}</label> <label><input type="checkbox" name="deleteFiles" <#if (deleteFiles??)>checked="checked"</#if>/>${uiLabelMap.WebtoolsDeleteFiles}</label> <label><input type="checkbox" name="checkDataOnly" <#if checkDataOnly??>checked="checked"</#if>/>${uiLabelMap.WebtoolsCheckDataOnly}</label> + <label><input type="checkbox" name="disableEeca" <#if disableEeca??>checked="checked"</#if>/>${uiLabelMap.WebtoolsDisableEeca}</label><span class="tooltip">${uiLabelMap.WebtoolsDisableEecaWarning}</span> </td> </tr> <tr>

