[ofbiz-framework] branch trunk updated: Improved: Use ‘depends-on’ attribute instead of “component-load.xml” (OFBIZ-11296)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Improved: Use ‘depends-on’ attribute instead of “component-load.xml” (OFBIZ-11296)

mthl
This is an automated email from the ASF dual-hosted git repository.

mthl pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new eeabe69  Improved: Use ‘depends-on’ attribute instead of “component-load.xml” (OFBIZ-11296)
eeabe69 is described below

commit eeabe69813a1d9f42911dec70a912574046ef49b
Author: Mathieu Lirzin <[hidden email]>
AuthorDate: Mon Nov 25 15:10:48 2019 +0100

    Improved: Use ‘depends-on’ attribute instead of “component-load.xml” (OFBIZ-11296)
   
    We currently have two ways to define component loading order. Either
    by using ‘depends-on’ attribute in “component-config.xml” or by adding
    a “component-load.xml” file at the root of a component directory.
   
    “depends-on” is more flexible because it handles partial ordering when
    “component-load.xml” defines a total order which is not necessarily
    meaningful, so it is better to rely only “depends-on”.
   
    This removes the usage of “component-load.xml” to use ‘depends-on’
    instead. The dependency declarations correspond to the total ordering
    previously defined but will need to be refined in the future to relax
    unnecessary dependency declarations.
   
    Only “framework/base/config/component-load.xml” which defines the
    top-level directories order (framework, applications, themes and
    plugins) is kept.
---
 applications/accounting/ofbiz-component.xml    |  1 +
 applications/commonext/ofbiz-component.xml     |  3 +++
 applications/component-load.xml                | 36 --------------------------
 applications/content/ofbiz-component.xml       |  1 +
 applications/humanres/ofbiz-component.xml      |  1 +
 applications/manufacturing/ofbiz-component.xml |  1 +
 applications/marketing/ofbiz-component.xml     |  1 +
 applications/order/ofbiz-component.xml         |  1 +
 applications/party/ofbiz-component.xml         |  1 +
 applications/product/ofbiz-component.xml       |  1 +
 applications/securityext/ofbiz-component.xml   |  1 +
 applications/workeffort/ofbiz-component.xml    |  1 +
 framework/catalina/ofbiz-component.xml         |  1 +
 framework/common/ofbiz-component.xml           |  1 +
 framework/component-load.xml                   | 36 --------------------------
 framework/datafile/ofbiz-component.xml         |  1 +
 framework/entity/ofbiz-component.xml           |  1 +
 framework/entityext/ofbiz-component.xml        |  1 +
 framework/minilang/ofbiz-component.xml         |  1 +
 framework/security/ofbiz-component.xml         |  1 +
 framework/service/ofbiz-component.xml          |  1 +
 framework/testtools/ofbiz-component.xml        |  1 +
 framework/webapp/ofbiz-component.xml           |  2 +-
 framework/webtools/ofbiz-component.xml         |  1 +
 framework/widget/ofbiz-component.xml           |  1 +
 25 files changed, 25 insertions(+), 73 deletions(-)

diff --git a/applications/accounting/ofbiz-component.xml b/applications/accounting/ofbiz-component.xml
index 31692c8..48828ed 100644
--- a/applications/accounting/ofbiz-component.xml
+++ b/applications/accounting/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="accounting"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="manufacturing"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
 
diff --git a/applications/commonext/ofbiz-component.xml b/applications/commonext/ofbiz-component.xml
index 60c7bbc..ca14df6 100644
--- a/applications/commonext/ofbiz-component.xml
+++ b/applications/commonext/ofbiz-component.xml
@@ -21,6 +21,9 @@ under the License.
 <ofbiz-component name="commonext"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <!-- Common component used by most other components must be last because it
+         uses info from most other "application" components. -->
+    <depends-on component-name="marketing"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
     
diff --git a/applications/component-load.xml b/applications/component-load.xml
deleted file mode 100644
index 7d2a71a..0000000
--- a/applications/component-load.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<component-loader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/component-loader.xsd">
-    <load-component component-location="datamodel"/>
-    <load-component component-location="party"/>
-    <load-component component-location="securityext"/>
-    <load-component component-location="content"/>
-    <load-component component-location="workeffort"/>
-    <load-component component-location="product"/>
-    <load-component component-location="manufacturing"/>
-    <load-component component-location="accounting"/>
-    <load-component component-location="humanres"/>
-    <load-component component-location="order"/>
-    <load-component component-location="marketing"/>
-<!-- common component used by most other components last because it uses info from most components-->
-    <load-component component-location="commonext"/>
-</component-loader>
diff --git a/applications/content/ofbiz-component.xml b/applications/content/ofbiz-component.xml
index 03d7cf8..7682d2b 100644
--- a/applications/content/ofbiz-component.xml
+++ b/applications/content/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="content"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="securityext"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
 
diff --git a/applications/humanres/ofbiz-component.xml b/applications/humanres/ofbiz-component.xml
index 9526ef5..117aeff 100644
--- a/applications/humanres/ofbiz-component.xml
+++ b/applications/humanres/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="humanres"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="accounting"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
 
diff --git a/applications/manufacturing/ofbiz-component.xml b/applications/manufacturing/ofbiz-component.xml
index 737d5b3..10e4024 100644
--- a/applications/manufacturing/ofbiz-component.xml
+++ b/applications/manufacturing/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="manufacturing"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="product"/>
     <resource-loader name="main" type="component"/>
 
     <!-- place the config directory on the classpath to access configuration files -->
diff --git a/applications/marketing/ofbiz-component.xml b/applications/marketing/ofbiz-component.xml
index b5cdcea..3347407 100644
--- a/applications/marketing/ofbiz-component.xml
+++ b/applications/marketing/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="marketing"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="order"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
     
diff --git a/applications/order/ofbiz-component.xml b/applications/order/ofbiz-component.xml
index 7222034..d6c67d9 100644
--- a/applications/order/ofbiz-component.xml
+++ b/applications/order/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="order"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="humanres"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
 
diff --git a/applications/party/ofbiz-component.xml b/applications/party/ofbiz-component.xml
index d393aec..145719a 100644
--- a/applications/party/ofbiz-component.xml
+++ b/applications/party/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="party"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="datamodel"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
 
diff --git a/applications/product/ofbiz-component.xml b/applications/product/ofbiz-component.xml
index 9a203d0..6659dec 100644
--- a/applications/product/ofbiz-component.xml
+++ b/applications/product/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="product"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="workeffort"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
 
diff --git a/applications/securityext/ofbiz-component.xml b/applications/securityext/ofbiz-component.xml
index 20d308e..6fc94f9 100644
--- a/applications/securityext/ofbiz-component.xml
+++ b/applications/securityext/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="securityext"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="party"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
     
diff --git a/applications/workeffort/ofbiz-component.xml b/applications/workeffort/ofbiz-component.xml
index b5a0e00..729d7b5 100644
--- a/applications/workeffort/ofbiz-component.xml
+++ b/applications/workeffort/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="workeffort"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="content"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
 
diff --git a/framework/catalina/ofbiz-component.xml b/framework/catalina/ofbiz-component.xml
index f9eaf36..8d71e84 100644
--- a/framework/catalina/ofbiz-component.xml
+++ b/framework/catalina/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="catalina"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="service"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
     <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
diff --git a/framework/common/ofbiz-component.xml b/framework/common/ofbiz-component.xml
index 4a5ac2b..cf237ec 100644
--- a/framework/common/ofbiz-component.xml
+++ b/framework/common/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="common"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="minilang"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
     
diff --git a/framework/component-load.xml b/framework/component-load.xml
deleted file mode 100644
index a7f7779..0000000
--- a/framework/component-load.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-
-<component-loader xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/component-loader.xsd">
-    <load-component component-location="base"/>
-    <load-component component-location="entity"/>
-    <load-component component-location="security"/>
-    <load-component component-location="datafile"/>
-    <load-component component-location="minilang"/>
-    <load-component component-location="common"/>
-    <load-component component-location="service"/>
-    <load-component component-location="catalina"/>
-    <load-component component-location="entityext"/>
-    <load-component component-location="webapp"/>
-    <load-component component-location="widget"/>
-    <load-component component-location="testtools"/>
-    <load-component component-location="webtools"/>
-</component-loader>
diff --git a/framework/datafile/ofbiz-component.xml b/framework/datafile/ofbiz-component.xml
index 435d2f6..3492033 100644
--- a/framework/datafile/ofbiz-component.xml
+++ b/framework/datafile/ofbiz-component.xml
@@ -21,5 +21,6 @@ under the License.
 <ofbiz-component name="datafile"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="security"/>
     <resource-loader name="main" type="component"/>
 </ofbiz-component>
diff --git a/framework/entity/ofbiz-component.xml b/framework/entity/ofbiz-component.xml
index 54f0890..5c41d46 100644
--- a/framework/entity/ofbiz-component.xml
+++ b/framework/entity/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="entity"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="base"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
     
diff --git a/framework/entityext/ofbiz-component.xml b/framework/entityext/ofbiz-component.xml
index 3ea4508..414684c 100644
--- a/framework/entityext/ofbiz-component.xml
+++ b/framework/entityext/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="entityext"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="catalina"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
     
diff --git a/framework/minilang/ofbiz-component.xml b/framework/minilang/ofbiz-component.xml
index 2dfefdf..2343665 100644
--- a/framework/minilang/ofbiz-component.xml
+++ b/framework/minilang/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="minilang"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="datafile"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
 
diff --git a/framework/security/ofbiz-component.xml b/framework/security/ofbiz-component.xml
index b3c015b..3ecacb2 100644
--- a/framework/security/ofbiz-component.xml
+++ b/framework/security/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="security"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="entity"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
 
diff --git a/framework/service/ofbiz-component.xml b/framework/service/ofbiz-component.xml
index 1735f9d..1a979f6 100644
--- a/framework/service/ofbiz-component.xml
+++ b/framework/service/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="service"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="common"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
 
diff --git a/framework/testtools/ofbiz-component.xml b/framework/testtools/ofbiz-component.xml
index 23c9223..5262d3a 100644
--- a/framework/testtools/ofbiz-component.xml
+++ b/framework/testtools/ofbiz-component.xml
@@ -22,6 +22,7 @@
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
     <!-- define resource loaders; most common is to use the component resource loader -->
+    <depends-on component-name="widget"/>
     <resource-loader name="main" type="component"/>
 
     <!-- service resources: model(s), eca(s) and group definitions -->
diff --git a/framework/webapp/ofbiz-component.xml b/framework/webapp/ofbiz-component.xml
index 32fe616..ab27ca2 100644
--- a/framework/webapp/ofbiz-component.xml
+++ b/framework/webapp/ofbiz-component.xml
@@ -21,7 +21,7 @@ under the License.
 <ofbiz-component name="webapp"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
-
+    <depends-on component-name="entityext"/>
     <resource-loader name="main" type="component"/>
 
     <classpath type="dir" location="config"/>
diff --git a/framework/webtools/ofbiz-component.xml b/framework/webtools/ofbiz-component.xml
index 662e606..43799e3 100644
--- a/framework/webtools/ofbiz-component.xml
+++ b/framework/webtools/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="webtools"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="testtools"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>
     
diff --git a/framework/widget/ofbiz-component.xml b/framework/widget/ofbiz-component.xml
index c7f8186..3a4dd5d 100644
--- a/framework/widget/ofbiz-component.xml
+++ b/framework/widget/ofbiz-component.xml
@@ -21,6 +21,7 @@ under the License.
 <ofbiz-component name="widget"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd">
+    <depends-on component-name="webapp"/>
     <resource-loader name="main" type="component"/>
     <classpath type="dir" location="config"/>