Search code examples
javaxmlofbiz

Where is DataResource Entity defined in OFBiz?


I am studying the OFBiz framework, and I have a question.

I found a service that creates a DataResource. (applications/content/src/main/java/org/apache/ofbiz/content/data/DataServices.java)

But I can't find where is defined the DataResource entity. Typically entities are defined in entitymodel.xml file under entitydef directory. However, the content application does not have an entitymodel.xml file. There is only the eecas.xml file.

directory tree

<entity-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entity-eca.xsd">

<!-- If the text in the database has changed for the data resource, we need to clear out anything depending on this cached value -->
<eca entity="ElectronicText" operation="store-remove" event="return">
    <action service="clearAssociatedRenderCache" mode="sync" />
</eca>

<!-- Content Keyword Indexing ECAs -->
<eca entity="Content" operation="create" event="return">
    <action service="indexContentKeywords" mode="sync" value-attr="contentInstance"/>
</eca>
<eca entity="Content" operation="store" event="return">
    <action service="indexContentKeywords" mode="sync"/>
</eca>
<eca entity="ContentAttribute" operation="create-store" event="return">
    <action service="indexContentKeywords" mode="sync"/>
</eca>
<eca entity="ContentMetaData" operation="create-store" event="return">
    <action service="indexContentKeywords" mode="sync"/>
</eca>
<eca entity="ContentRole" operation="create-store" event="return">
    <action service="indexContentKeywords" mode="sync"/>
</eca>
<eca entity="ProductContent" operation="create-store" event="return">
    <action service="indexContentKeywords" mode="sync"/>
</eca>
<eca entity="ProductCategoryContent" operation="create-store" event="return">
    <action service="indexContentKeywords" mode="sync"/>
</eca>
<eca entity="PartyContent" operation="create-store" event="return">
    <action service="indexContentKeywords" mode="sync"/>
</eca>
<eca entity="WebSiteContent" operation="create-store" event="return">
    <action service="indexContentKeywords" mode="sync"/>
</eca>
<eca entity="WorkEffortContent" operation="create-store" event="return">
    <action service="indexContentKeywords" mode="sync"/>
</eca>

And this eecas.xml file doesn't seem to be related to dataresource. It is an entity that clearly exists, but where the hell is it defined? I would be very grateful if you could give me the answer.


Solution

  • You can find it in https://github.com/apache/ofbiz-framework/blob/trunk/applications/datamodel/entitydef/content-entitymodel.xml look for:

    <entity entity-name="DataResource"