Skip to content

Commit

Permalink
Improved: Use ‘depends-on’ attribute instead of “component-load.xml” …
Browse files Browse the repository at this point in the history
…(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.
  • Loading branch information
mthl committed Nov 25, 2019
1 parent 0003252 commit eeabe69
Show file tree
Hide file tree
Showing 25 changed files with 25 additions and 73 deletions.
1 change: 1 addition & 0 deletions applications/accounting/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
3 changes: 3 additions & 0 deletions applications/commonext/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
36 changes: 0 additions & 36 deletions applications/component-load.xml

This file was deleted.

1 change: 1 addition & 0 deletions applications/content/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
1 change: 1 addition & 0 deletions applications/humanres/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
1 change: 1 addition & 0 deletions applications/manufacturing/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand Down
1 change: 1 addition & 0 deletions applications/marketing/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
1 change: 1 addition & 0 deletions applications/order/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
1 change: 1 addition & 0 deletions applications/party/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
1 change: 1 addition & 0 deletions applications/product/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
1 change: 1 addition & 0 deletions applications/securityext/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
1 change: 1 addition & 0 deletions applications/workeffort/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
1 change: 1 addition & 0 deletions framework/catalina/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down
1 change: 1 addition & 0 deletions framework/common/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
36 changes: 0 additions & 36 deletions framework/component-load.xml

This file was deleted.

1 change: 1 addition & 0 deletions framework/datafile/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
1 change: 1 addition & 0 deletions framework/entity/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
1 change: 1 addition & 0 deletions framework/entityext/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
1 change: 1 addition & 0 deletions framework/minilang/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
1 change: 1 addition & 0 deletions framework/security/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
1 change: 1 addition & 0 deletions framework/service/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
1 change: 1 addition & 0 deletions framework/testtools/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand Down
2 changes: 1 addition & 1 deletion framework/webapp/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down
1 change: 1 addition & 0 deletions framework/webtools/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down
1 change: 1 addition & 0 deletions framework/widget/ofbiz-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>

Expand Down

0 comments on commit eeabe69

Please sign in to comment.