<?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.
-->

<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="https://ofbiz.apache.org/dtds/entitymodel.xsd">
  <!-- ========================================================= -->
  <!-- ======================== Defaults ======================= -->
  <!-- ========================================================= -->
    <title>Entity of an Apache OFBiz Component</title>
    <description>None</description>
    <version>1.0</version>

  <!-- ========================================================= -->
  <!-- ======================== Data Model ===================== -->
  <!-- The modules in this file are as follows:                  -->
  <!--  - org.apache.ofbiz.content.compdoc -->
  <!--  - org.apache.ofbiz.content.content -->
  <!--  - org.apache.ofbiz.content.data -->
  <!--  - org.apache.ofbiz.content.document -->
  <!--  - org.apache.ofbiz.content.email -->
  <!--  - org.apache.ofbiz.content.preference -->
  <!--  - org.apache.ofbiz.content.survey -->
  <!--  - org.apache.ofbiz.content.website -->
  <!-- ========================================================= -->

  <!-- ========================================================= -->
  <!-- org.apache.ofbiz.content.compdoc -->
  <!-- ========================================================= -->

    <view-entity entity-name="AssocRevisionItemView"
                package-name="org.apache.ofbiz.content.compdoc"
                title="Latest Revision Children">
      <member-entity entity-alias="CRI" entity-name="ContentRevisionItem"/>
      <member-entity entity-alias="CA" entity-name="ContentAssoc"/>
      <alias entity-alias="CA" name="contentId" group-by="true"/>
      <alias entity-alias="CA" name="contentIdTo" group-by="true"/>
      <alias entity-alias="CA" name="contentAssocTypeId" group-by="true"/>
      <alias entity-alias="CA" name="thruDate" group-by="true"/>
      <alias entity-alias="CA" name="fromDate" group-by="true"/>
      <alias entity-alias="CA" name="sequenceNum" group-by="true"/>
      <alias entity-alias="CRI" name="rootRevisionContentId" field="contentId" group-by="true"/>
      <alias entity-alias="CRI" name="itemContentId" group-by="true"/>
      <alias entity-alias="CRI" name="contentRevisionSeqId" group-by="true"/>
      <alias entity-alias="CRI" name="maxRevisionSeqId" field="contentRevisionSeqId" function="max"/>
      <view-link entity-alias="CA" rel-entity-alias="CRI">
        <key-map field-name="contentId" rel-field-name="itemContentId"/>
      </view-link>
    </view-entity>
    <view-entity entity-name="ContentAssocRevisionItemView"
                package-name="org.apache.ofbiz.content.compdoc"
                title="Latest Revision Children">
      <member-entity entity-alias="C" entity-name="Content"/>
      <member-entity entity-alias="CRI" entity-name="ContentRevisionItem"/>
      <member-entity entity-alias="CA" entity-name="ContentAssoc"/>
      <alias entity-alias="C" name="instanceOfContentId" group-by="true"/>
      <alias entity-alias="C" name="dataResourceId" group-by="true"/>
      <alias entity-alias="CA" name="contentId" group-by="true"/>
      <alias entity-alias="CA" name="contentIdTo" group-by="true"/>
      <alias entity-alias="CA" name="contentAssocTypeId" group-by="true"/>
      <alias entity-alias="CA" name="thruDate" group-by="true"/>
      <alias entity-alias="CA" name="fromDate" group-by="true"/>
      <alias entity-alias="CA" name="sequenceNum" group-by="true"/>
      <alias entity-alias="CRI" name="rootRevisionContentId" field="contentId" group-by="true"/>
      <alias entity-alias="CRI" name="itemContentId" group-by="true"/>
      <alias entity-alias="CRI" name="contentRevisionSeqId" group-by="false"/>
      <alias entity-alias="CRI" name="maxRevisionSeqId" field="contentRevisionSeqId" function="max"/>
      <view-link entity-alias="C" rel-entity-alias="CA">
        <key-map field-name="contentId" rel-field-name="contentId"/>
      </view-link>
      <view-link entity-alias="CA" rel-entity-alias="CRI">
        <key-map field-name="contentId" rel-field-name="itemContentId"/>
      </view-link>
    </view-entity>
    <view-entity entity-name="MaxRevisionItemView"
                package-name="org.apache.ofbiz.content.compdoc"
                title="Latest Revision Children">
      <member-entity entity-alias="CRI" entity-name="ContentRevisionItem"/>
      <alias entity-alias="CRI" name="rootRevisionContentId" field="contentId" group-by="true"/>
      <alias entity-alias="CRI" name="itemContentId" group-by="true"/>
      <alias entity-alias="CRI" name="contentRevisionSeqId" group-by="false"/>
      <alias entity-alias="CRI" name="maxRevisionSeqId" field="contentRevisionSeqId" function="max"/>
    </view-entity>
    <view-entity entity-name="MaxContentApprovalView"
                package-name="org.apache.ofbiz.content.compdoc"
                title="Latest ContentApproval">
      <member-entity entity-alias="C" entity-name="Content"/>
      <member-entity entity-alias="CA" entity-name="ContentApproval"/>
      <alias entity-alias="C" name="contentTypeId"  group-by="true"/>
      <alias entity-alias="CA" name="contentId"  group-by="true"/>
      <alias entity-alias="CA" name="partyId"  group-by="true"/>
      <alias entity-alias="CA" name="roleTypeId" group-by="true"/>
      <alias entity-alias="CA" name="sequenceNum" group-by="false"/>
      <alias entity-alias="CA" name="contentRevisionSeqId" group-by="false"/>
      <alias entity-alias="CA" name="maxContentRevisionSeqId" field="contentRevisionSeqId" function="max"/>
      <view-link entity-alias="C" rel-entity-alias="CA">
        <key-map field-name="contentId" rel-field-name="contentId"/>
      </view-link>
    </view-entity>
    <view-entity entity-name="ContentAssocOptViewFrom"
                package-name="org.apache.ofbiz.content.content"
                title="Main Assoc To">
      <member-entity entity-alias="CO" entity-name="Content"/>
      <member-entity entity-alias="CA" entity-name="ContentAssoc"/>
      <alias-all entity-alias="CO"/>
      <alias-all entity-alias="CA" prefix="ca"/>
      <alias entity-alias="CA" name="contentIdStart" field="contentIdTo"/>
      <view-link entity-alias="CA" rel-entity-alias="CO" rel-optional="true">
        <key-map field-name="contentIdTo" rel-field-name="contentId"/>
      </view-link>
    </view-entity>
    <!--
    <view-entity entity-name="ContentRevisionItemAndContentApprovalView"
                package-name="org.apache.ofbiz.content.content"
                title="ContentRevisionItem and ContentApproval">
      <member-entity entity-alias="CRI" entity-name="ContentRevisionItem"/>
      <member-entity entity-alias="CA" entity-name="ContentApproval"/>
      <alias-all entity-alias="CRI"/>
      <alias entity-alias="CA" name="caContentId" field="contentId" group-by="true"/>
      <alias entity-alias="CA" name="caContentRevisionSeqId" name="contentRevisionSeqId" group-by="true"/>
      <alias entity-alias="CA" name="approvalCount" field="contentId" function="count"/>
      <view-link entity-alias="CRI" rel-entity-alias="CA" rel-optional="true">
        <key-map field-name="contentId"/>
        <key-map field-name="contentRevisionSeqId"/>
      </view-link>
    </view-entity>
    -->

  <!-- ========================================================= -->
  <!-- org.apache.ofbiz.content.content -->
  <!-- ========================================================= -->

    <entity entity-name="Content"
            package-name="org.apache.ofbiz.content.content"
            default-resource-name="ContentEntityLabels"
            title="Content">
      <field name="contentId" type="id"></field>
      <field name="contentTypeId" type="id"></field>
      <field name="ownerContentId" type="id"><description>Used for permissions checking</description></field>
      <field name="decoratorContentId" type="id"></field>
      <field name="instanceOfContentId" type="id"></field>
      <field name="dataResourceId" type="id"></field>
      <field name="templateDataResourceId" type="id"></field>
      <field name="dataSourceId" type="id"></field>
      <field name="statusId" type="id"></field>
      <field name="privilegeEnumId" type="id"></field>
      <field name="serviceName" type="long-varchar"><description>Deprecated : use customMethod pattern instead. Kept for backward compatibility</description></field>
      <field name="customMethodId" type="id"></field>
      <field name="contentName" type="value"></field>
      <field name="description" type="description"></field>
      <field name="localeString" type="very-short"></field>
      <field name="mimeTypeId" type="id-vlong"></field>
      <field name="characterSetId" type="id-long"></field>
      <field name="childLeafCount" type="numeric"/>
      <field name="childBranchCount" type="numeric"/>
      <field name="createdDate" type="date-time"></field>
      <field name="createdByUserLogin" type="id-vlong"></field>
      <field name="lastModifiedDate" type="date-time"></field>
      <field name="lastModifiedByUserLogin" type="id-vlong"></field>
      <prim-key field="contentId"/>
      <relation type="one" fk-name="CONTENT_TO_TYPE" rel-entity-name="ContentType">
        <key-map field-name="contentTypeId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_TO_DATA" rel-entity-name="DataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_TO_TMPDATA" title="Template" rel-entity-name="DataResource">
        <key-map field-name="templateDataResourceId" rel-field-name="dataResourceId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_STATUS" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_PRIVENM" title="Privilege" rel-entity-name="Enumeration">
        <key-map field-name="privilegeEnumId" rel-field-name="enumId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_CUSTMET" rel-entity-name="CustomMethod">
        <key-map field-name="customMethodId"/>
      </relation>
      <!-- the relationship to MimeType is one-nofk so that you can still do a lookup on MimeType but a new
      and unexpected mime type would not cause a foreign key constraint violation, so MimeType can store the
      most common mime types instead of an exhaustive list of all possible mime types -->
      <relation type="one-nofk" rel-entity-name="MimeType">
        <key-map field-name="mimeTypeId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_CHST" rel-entity-name="CharacterSet">
        <key-map field-name="characterSetId"/>
      </relation>
      <relation type="many" rel-entity-name="ContentTypeAttr">
        <key-map field-name="contentTypeId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_CB_ULGN" title="CreatedBy" rel-entity-name="UserLogin">
        <key-map field-name="createdByUserLogin" rel-field-name="userLoginId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_LMB_ULGN" title="LastModifiedBy" rel-entity-name="UserLogin">
        <key-map field-name="lastModifiedByUserLogin" rel-field-name="userLoginId"/>
      </relation>
      <relation type="many" rel-entity-name="ProductFeatureDataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_DTSRC" rel-entity-name="DataSource">
        <key-map field-name="dataSourceId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_DCNTNT" title="Decorator" rel-entity-name="Content">
        <key-map field-name="decoratorContentId" rel-field-name="contentId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_PCNTNT" title="Owner" rel-entity-name="Content">
        <key-map field-name="ownerContentId" rel-field-name="contentId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_IOFCNT" title="InstanceOf" rel-entity-name="Content">
          <key-map field-name="instanceOfContentId" rel-field-name="contentId"/>
      </relation>
      <relation type="many" rel-entity-name="ContentAssocDataResourceViewFrom">
        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
      </relation>
      <relation type="many" rel-entity-name="ContentAssocDataResourceViewTo">
        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
      </relation>
    </entity>
    <view-entity entity-name="ContentAndRole" package-name="org.apache.ofbiz.content.content" title="Content And Role View">
        <member-entity entity-alias="CNT" entity-name="Content"/>
        <member-entity entity-alias="CRLE" entity-name="ContentRole"/>
        <alias-all entity-alias="CNT"/>
        <alias-all entity-alias="CRLE"/>
        <view-link entity-alias="CNT" rel-entity-alias="CRLE">
            <key-map field-name="contentId"/>
        </view-link>
        <relation type="one-nofk" rel-entity-name="DataResource">
            <key-map field-name="dataResourceId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="ContentType">
            <key-map field-name="contentTypeId"/>
        </relation>
    </view-entity>
    <entity entity-name="ContentApproval"
        package-name="org.apache.ofbiz.content.content"
        title="Content Approval">
        <field name="contentApprovalId" type="id"></field>
        <field name="contentId" type="id"></field>
        <field name="contentRevisionSeqId" type="id"></field>
        <field name="partyId" type="id"></field>
        <field name="roleTypeId" type="id"></field>
        <field name="approvalStatusId" type="id"></field>
        <field name="approvalDate" type="date-time"></field>
        <field name="sequenceNum" type="numeric"></field>
        <field name="comments" type="comment"></field>
        <prim-key field="contentApprovalId"/>
        <relation type="one" fk-name="CNTNTAPPR_CNT" rel-entity-name="Content">
            <key-map field-name="contentId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="ContentRevision">
            <key-map field-name="contentId"/>
            <key-map field-name="contentRevisionSeqId"/>
        </relation>
        <relation type="one" fk-name="CNTNTAPPR_PTY" rel-entity-name="Party">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="CNTNTAPPR_RLTP" rel-entity-name="RoleType">
            <key-map field-name="roleTypeId"/>
        </relation>
        <relation type="one" fk-name="CNTNTAPPR_APSI" title="Approval" rel-entity-name="StatusItem">
            <key-map field-name="approvalStatusId" rel-field-name="statusId"/>
        </relation>
    </entity>
    <entity entity-name="ContentAssoc"
            package-name="org.apache.ofbiz.content.content"
            title="Content Association">
      <field name="contentId" type="id"><description>"parent" content</description></field>
      <field name="contentIdTo" type="id"><description>"child" or "sub" content</description></field>
      <field name="contentAssocTypeId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <field name="contentAssocPredicateId" type="id"></field>
      <field name="dataSourceId" type="id"></field>
      <field name="sequenceNum" type="numeric"></field>
      <field name="mapKey" type="name"></field>
      <field name="upperCoordinate" type="numeric"></field>
      <field name="leftCoordinate" type="numeric"></field>
      <field name="createdDate" type="date-time"></field>
      <field name="createdByUserLogin" type="id-vlong"></field>
      <field name="lastModifiedDate" type="date-time"></field>
      <field name="lastModifiedByUserLogin" type="id-vlong"></field>
      <prim-key field="contentId"/>
      <prim-key field="contentIdTo"/>
      <prim-key field="contentAssocTypeId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="CONTENTASSC_FROM" title="From" rel-entity-name="Content">
        <key-map field-name="contentId"/>
      </relation>
      <relation type="one" fk-name="CONTENTASSC_TO" title="To" rel-entity-name="Content">
        <key-map field-name="contentIdTo" rel-field-name="contentId"/>
      </relation>
      <relation type="one" fk-name="CONTENTASSC_TYP" rel-entity-name="ContentAssocType">
        <key-map field-name="contentAssocTypeId"/>
      </relation>
      <relation type="one" fk-name="CONTENTASSC_CBUSR" title="CreatedBy" rel-entity-name="UserLogin">
        <key-map field-name="createdByUserLogin" rel-field-name="userLoginId"/>
      </relation>
      <relation type="one" fk-name="CONTENTASSC_LMBUR" title="LastModifiedBy" rel-entity-name="UserLogin">
        <key-map field-name="lastModifiedByUserLogin" rel-field-name="userLoginId"/>
      </relation>
      <relation type="one" fk-name="CONTENTASSC_PRED" rel-entity-name="ContentAssocPredicate">
        <key-map field-name="contentAssocPredicateId"/>
      </relation>
      <relation type="one" fk-name="CONTENTASSC_DTSRC" rel-entity-name="DataSource">
        <key-map field-name="dataSourceId"/>
      </relation>
        <index name="CONTENTASSC_TOQRY">
            <index-field name="contentIdTo"/>
            <index-field name="contentAssocTypeId"/>
            <index-field name="thruDate"/>
        </index>
    </entity>
    <view-entity entity-name="ContentAssocDataResourceViewFrom"
                package-name="org.apache.ofbiz.content.content"
                title="Main Assoc From and DataResource View">
      <member-entity entity-alias="CO" entity-name="Content"/>
      <member-entity entity-alias="CA" entity-name="ContentAssoc"/>
      <member-entity entity-alias="DR" entity-name="DataResource"/>
      <alias-all entity-alias="CO"/>
      <alias-all entity-alias="CA" prefix="ca"/>
      <alias-all entity-alias="DR" prefix="dr"/>
      <alias entity-alias="CA" name="contentIdStart" field="contentIdTo"/>
      <view-link entity-alias="CA" rel-entity-alias="CO" rel-optional="true">
        <key-map field-name="contentId" rel-field-name="contentId"/>
      </view-link>
      <view-link entity-alias="CO" rel-entity-alias="DR" rel-optional="true">
        <key-map field-name="dataResourceId" rel-field-name="dataResourceId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="ElectronicText">
        <key-map field-name="drDataResourceId" rel-field-name="dataResourceId"/> </relation>
      <relation type="one-nofk" rel-entity-name="ImageDataResource">
        <key-map field-name="drDataResourceId" rel-field-name="dataResourceId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="OtherDataResource">
        <key-map field-name="drDataResourceId" rel-field-name="dataResourceId"/>
      </relation>
      <relation type="many" rel-entity-name="ContentAssocDataResourceViewFrom">
        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
      </relation>
      <relation type="many" rel-entity-name="ContentAssocDataResourceViewTo">
        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
      </relation>
      <relation type="many" rel-entity-name="ContentPurpose">
          <key-map field-name="contentId" rel-field-name="contentId"/>
      </relation>
      <relation type="many" title="From" rel-entity-name="ContentAssoc">
        <key-map field-name="contentId"/>
      </relation>
      <relation type="many" title="To" rel-entity-name="ContentAssoc">
        <key-map field-name="contentId" rel-field-name="contentIdTo"/>
      </relation>
      <relation type="many" rel-entity-name="ContentRole">
        <key-map field-name="contentId"/>
      </relation>
    </view-entity>
    <view-entity entity-name="ContentAssocDataResourceViewTo"
                package-name="org.apache.ofbiz.content.content"
                title="Main Assoc To and DataResource View">
      <member-entity entity-alias="CO" entity-name="Content"/>
      <member-entity entity-alias="CA" entity-name="ContentAssoc"/>
      <member-entity entity-alias="DR" entity-name="DataResource"/>
      <alias-all entity-alias="CA" prefix="ca"/>
      <alias-all entity-alias="CO"/>
      <alias-all entity-alias="DR" prefix="dr"/>
      <alias entity-alias="CA" name="contentIdStart" field="contentId"/>
      <view-link entity-alias="CA" rel-entity-alias="CO" rel-optional="true">
        <key-map field-name="contentIdTo" rel-field-name="contentId"/>
      </view-link>
      <view-link entity-alias="CO" rel-entity-alias="DR" rel-optional="true">
        <key-map field-name="dataResourceId" rel-field-name="dataResourceId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="ElectronicText">
        <key-map field-name="drDataResourceId" rel-field-name="dataResourceId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ImageDataResource">
        <key-map field-name="drDataResourceId" rel-field-name="dataResourceId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="OtherDataResource">
        <key-map field-name="drDataResourceId" rel-field-name="dataResourceId"/>
      </relation>
      <relation type="many" rel-entity-name="ContentAssocDataResourceViewFrom">
        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
      </relation>
      <relation type="many" rel-entity-name="ContentAssocDataResourceViewTo">
        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
      </relation>
      <relation type="many" rel-entity-name="ContentPurpose">
          <key-map field-name="caContentIdTo" rel-field-name="contentId"/>
      </relation>
      <relation type="many" title="From" rel-entity-name="ContentAssoc">
        <key-map field-name="caContentIdTo" rel-field-name="contentId"/>
      </relation>
      <relation type="many" title="To" rel-entity-name="ContentAssoc">
        <key-map field-name="caContentIdTo" rel-field-name="contentIdTo"/>
      </relation>
      <relation type="many" rel-entity-name="ContentRole">
        <key-map field-name="caContentIdTo" rel-field-name="contentId"/>
      </relation>
    </view-entity>
    <entity entity-name="ContentAssocPredicate"
            package-name="org.apache.ofbiz.content.content"
            default-resource-name="ContentEntityLabels"
            title="Content Association Predicate">
      <field name="contentAssocPredicateId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="contentAssocPredicateId"/>
    </entity>
    <entity entity-name="ContentAssocType"
            package-name="org.apache.ofbiz.content.content"
            default-resource-name="ContentEntityLabels"
            title="Content Association Type">
      <field name="contentAssocTypeId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="contentAssocTypeId"/>
    </entity>
   <view-entity entity-name="ContentAssocViewFrom"
                package-name="org.apache.ofbiz.content.content"
                title="Main Assoc From View">
      <member-entity entity-alias="CO" entity-name="Content"/>
      <member-entity entity-alias="CA" entity-name="ContentAssoc"/>
      <alias-all entity-alias="CO"/>
      <alias-all entity-alias="CA" prefix="ca"/>
      <alias entity-alias="CA" name="contentIdStart" field="contentIdTo"/>
      <alias entity-alias="CA" name="fromDate" field="fromDate"/>
      <alias entity-alias="CA" name="thruDate" field="thruDate"/>
      <view-link entity-alias="CA" rel-entity-alias="CO">
        <key-map field-name="contentId"/>
      </view-link>
    </view-entity>
    <view-entity entity-name="ContentAssocViewTo"
                package-name="org.apache.ofbiz.content.content"
                title="Main Assoc To View">
      <member-entity entity-alias="CO" entity-name="Content"/>
      <member-entity entity-alias="CA" entity-name="ContentAssoc"/>
      <alias-all entity-alias="CO"/>
      <alias-all entity-alias="CA" prefix="ca"/>
      <alias entity-alias="CA" name="contentIdStart" field="contentId"/>
      <alias entity-alias="CA" name="fromDate" field="fromDate"/>
      <alias entity-alias="CA" name="thruDate" field="thruDate"/>
      <view-link entity-alias="CA" rel-entity-alias="CO">
        <key-map field-name="contentIdTo" rel-field-name="contentId"/>
      </view-link>
    </view-entity>
    <entity entity-name="ContentAttribute"
            package-name="org.apache.ofbiz.content.content"
            title="Content Attribute">
      <field name="contentId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="attrValue" type="value"></field>
      <field name="attrDescription" type="description"></field>
      <prim-key field="contentId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="CONTENT_ATTR" rel-entity-name="Content">
        <key-map field-name="contentId"/>
      </relation>
      <relation type="many" rel-entity-name="ContentTypeAttr">
        <key-map field-name="attrName"/>
      </relation>
    </entity>
    <view-entity entity-name="ContentDataResourceView"
                package-name="org.apache.ofbiz.content.content"
                title="Content and DataResource View">
      <member-entity entity-alias="CO" entity-name="Content"/>
      <member-entity entity-alias="DR" entity-name="DataResource"/>
      <alias-all entity-alias="CO"/>
      <alias-all entity-alias="DR" prefix="dr"/>
      <view-link entity-alias="CO" rel-entity-alias="DR" rel-optional="true">
        <key-map field-name="dataResourceId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="ElectronicText">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ImageDataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="OtherDataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="many" rel-entity-name="ContentAssocDataResourceViewFrom">
        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
      </relation>
      <relation type="many" rel-entity-name="ContentAssocDataResourceViewTo">
        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
      </relation>
      <relation type="many" title="From" rel-entity-name="ContentAssoc">
        <key-map field-name="contentId"/>
      </relation>
      <relation type="many" title="To" rel-entity-name="ContentAssoc">
        <key-map field-name="contentId" rel-field-name="contentIdTo"/>
      </relation>
      <relation type="many" rel-entity-name="ContentPurpose">
          <key-map field-name="contentId"/>
      </relation>
      <relation type="many" rel-entity-name="ContentRole">
        <key-map field-name="contentId"/>
      </relation>
    </view-entity>
    <entity entity-name="ContentMetaData"
            package-name="org.apache.ofbiz.content.content"
            title="Content Meta-Data Predicate">
      <field name="contentId" type="id"></field>
      <field name="metaDataPredicateId" type="id"></field>
      <field name="metaDataValue" type="value"></field>
      <field name="dataSourceId" type="id"></field>
      <prim-key field="contentId"/>
      <prim-key field="metaDataPredicateId"/>
      <relation type="one" fk-name="CONTENTMD_CNTNT" rel-entity-name="Content">
        <key-map field-name="contentId"/>
      </relation>
      <relation type="one" fk-name="CONTENTMD_DMDPRD" rel-entity-name="MetaDataPredicate">
        <key-map field-name="metaDataPredicateId"/>
      </relation>
      <relation type="one" fk-name="CONTENTMD_DTSRC" rel-entity-name="DataSource">
        <key-map field-name="dataSourceId"/>
      </relation>
    </entity>
    <entity entity-name="ContentOperation"
            package-name="org.apache.ofbiz.content.content"
            default-resource-name="ContentEntityLabels"
            title="Content Operation">
      <field name="contentOperationId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="contentOperationId"/>
    </entity>
    <entity entity-name="ContentPurpose"
            package-name="org.apache.ofbiz.content.content"
            title="Content Purpose">
      <field name="contentId" type="id"></field>
      <field name="contentPurposeTypeId" type="id"></field>
      <field name="sequenceNum" type="numeric"></field>
      <prim-key field="contentId"/>
      <prim-key field="contentPurposeTypeId"/>
      <relation type="one" fk-name="CONTENT_PRP" rel-entity-name="Content">
        <key-map field-name="contentId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_PRP_TYPE" rel-entity-name="ContentPurposeType">
        <key-map field-name="contentPurposeTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ContentPurposeOperation"
            package-name="org.apache.ofbiz.content.content"
            title="Content Purpose">
      <field name="contentPurposeTypeId" type="id"></field>
      <field name="contentOperationId" type="id"></field>
      <field name="roleTypeId" type="id"></field>
      <field name="statusId" type="id"></field>
      <field name="privilegeEnumId" type="id"></field>
      <prim-key field="contentPurposeTypeId"/>
      <prim-key field="contentOperationId"/>
      <prim-key field="roleTypeId"/>
      <prim-key field="statusId"/>
      <prim-key field="privilegeEnumId"/>
      <relation type="one" fk-name="CONTENT_PRO_TYPE" rel-entity-name="ContentPurposeType">
        <key-map field-name="contentPurposeTypeId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_PRO_OPER" rel-entity-name="ContentOperation">
        <key-map field-name="contentOperationId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_PRO_RLT" rel-entity-name="RoleType">
        <key-map field-name="roleTypeId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_PRO_STI" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="CONTENT_PRO_PEI" rel-entity-name="Enumeration">
        <key-map field-name="privilegeEnumId" rel-field-name="enumId"/>
      </relation>
    </entity>
    <entity entity-name="ContentPurposeType"
            package-name="org.apache.ofbiz.content.content"
            default-resource-name="ContentEntityLabels"
            title="Content Purpose Type">
      <field name="contentPurposeTypeId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="contentPurposeTypeId"/>
    </entity>
    <entity entity-name="ContentRevision"
        package-name="org.apache.ofbiz.content.content"
        title="Content Revision">
        <field name="contentId" type="id"></field>
        <field name="contentRevisionSeqId" type="id"></field>
        <field name="committedByPartyId" type="id"></field>
        <field name="comments" type="comment"></field>
        <prim-key field="contentId"/>
        <prim-key field="contentRevisionSeqId"/>
        <relation type="one" fk-name="CNTNTREV_CNT" rel-entity-name="Content">
            <key-map field-name="contentId"/>
        </relation>
        <relation type="one" fk-name="CNTNTREV_CBPTY" title="CommittedBy" rel-entity-name="Party">
            <key-map field-name="committedByPartyId" rel-field-name="partyId"/>
        </relation>
    </entity>
    <entity entity-name="ContentRevisionItem"
        package-name="org.apache.ofbiz.content.content"
        title="Content Revision">
        <field name="contentId" type="id"></field>
        <field name="contentRevisionSeqId" type="id"></field>
        <field name="itemContentId" type="id"></field>
        <field name="oldDataResourceId" type="id"></field>
        <field name="newDataResourceId" type="id"></field>
        <prim-key field="contentId"/>
        <prim-key field="contentRevisionSeqId"/>
        <prim-key field="itemContentId"/>
        <relation type="one" fk-name="CNTNTREVIT_CNTREV" rel-entity-name="ContentRevision">
            <key-map field-name="contentId"/>
            <key-map field-name="contentRevisionSeqId"/>
        </relation>
        <relation type="one" fk-name="CNTNTREVIT_OLDDR" title="Old" rel-entity-name="DataResource">
            <key-map field-name="oldDataResourceId" rel-field-name="dataResourceId"/>
        </relation>
        <relation type="one" fk-name="CNTNTREVIT_NEWDR" title="New" rel-entity-name="DataResource">
            <key-map field-name="newDataResourceId" rel-field-name="dataResourceId"/>
        </relation>
    </entity>
    <entity entity-name="ContentRole"
            package-name="org.apache.ofbiz.content.content"
            title="Content Role">
      <field name="contentId" type="id"></field>
      <field name="partyId" type="id"></field>
      <field name="roleTypeId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <prim-key field="contentId"/>
      <prim-key field="partyId"/>
      <prim-key field="roleTypeId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="CNTNT_RL_CNTNT" rel-entity-name="Content">
        <key-map field-name="contentId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="CNTNT_RL_PTRL" rel-entity-name="PartyRole">
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ContentType"
            package-name="org.apache.ofbiz.content.content"
            default-resource-name="ContentEntityLabels"
            title="Content Type">
      <field name="contentTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="contentTypeId"/>
      <relation type="one" fk-name="CNTNT_TYPE_PARENT" title="Parent" rel-entity-name="ContentType">
        <key-map field-name="parentTypeId" rel-field-name="contentTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ContentTypeAttr"
            package-name="org.apache.ofbiz.content.content"
            title="Content Type Attribute">
      <field name="contentTypeId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="description" type="description"></field>
      <prim-key field="contentTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="CONTENT_TPAT_TYP" rel-entity-name="ContentType">
        <key-map field-name="contentTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="ContentAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="Content">
        <key-map field-name="contentTypeId"/>
      </relation>
    </entity>
    <view-entity entity-name="SubContentDataResourceView"
                package-name="org.apache.ofbiz.content.content"
                title="Content and DataResource for SubContent View">
      <member-entity entity-alias="CO" entity-name="Content"/>
      <member-entity entity-alias="DR" entity-name="DataResource"/>
      <alias-all entity-alias="CO"/>
      <alias-all entity-alias="DR" prefix="dr"/>
      <view-link entity-alias="CO" rel-entity-alias="DR" rel-optional="true">
        <key-map field-name="dataResourceId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="ElectronicText">
        <key-map field-name="drDataResourceId" rel-field-name="dataResourceId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ImageDataResource">
        <key-map field-name="drDataResourceId" rel-field-name="dataResourceId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="OtherDataResource">
        <key-map field-name="drDataResourceId" rel-field-name="dataResourceId"/>
      </relation>
      <relation type="many" rel-entity-name="ContentAssocDataResourceViewFrom">
        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
      </relation>
      <relation type="many" rel-entity-name="ContentAssocDataResourceViewTo">
        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
      </relation>
      <relation type="many" rel-entity-name="ContentPurpose">
        <key-map field-name="contentId"/>
      </relation>
      <relation type="many" rel-entity-name="ContentRole">
        <key-map field-name="contentId"/>
      </relation>
      <relation type="many" title="From" rel-entity-name="ContentAssoc">
        <key-map field-name="contentId"/>
      </relation>
      <relation type="many" title="To" rel-entity-name="ContentAssoc">
        <key-map field-name="contentId" rel-field-name="contentIdTo"/>
      </relation>
    </view-entity>

  <!-- ========================================================= -->
  <!-- org.apache.ofbiz.content.data -->
  <!-- ========================================================= -->

    <entity entity-name="AudioDataResource"
            package-name="org.apache.ofbiz.content.data"
            title="Audio Data Object">
      <field name="dataResourceId" type="id"></field>
      <field name="audioData" type="byte-array"></field>
      <prim-key field="dataResourceId"/>
      <relation type="one" fk-name="DATA_REC_AUDIO" rel-entity-name="DataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
    </entity>
    <entity entity-name="CharacterSet"
            package-name="org.apache.ofbiz.content.data"
            default-resource-name="ContentEntityLabels"
            title="Character Set">
      <field name="characterSetId" type="id-long"></field>
      <field name="description" type="description"></field>
      <prim-key field="characterSetId"/>
    </entity>
    <entity entity-name="DataCategory"
            package-name="org.apache.ofbiz.content.data"
            default-resource-name="ContentEntityLabels"
            title="Data Category">
      <field name="dataCategoryId" type="id"></field>
      <field name="parentCategoryId" type="id"></field>
      <field name="categoryName" type="name"></field>
      <prim-key field="dataCategoryId"/>
      <relation type="one" fk-name="DATA_CAT_PARENT" title="Parent" rel-entity-name="DataCategory">
        <key-map field-name="parentCategoryId" rel-field-name="dataCategoryId"/>
      </relation>
      <relation type="many" title="Sibling" rel-entity-name="DataCategory">
        <key-map field-name="parentCategoryId"/>
      </relation>
    </entity>
    <entity entity-name="DataResource"
            package-name="org.apache.ofbiz.content.data"
            title="Data Object">
      <field name="dataResourceId" type="id"></field>
      <field name="dataResourceTypeId" type="id"></field>
      <field name="dataTemplateTypeId" type="id"></field>
      <field name="dataCategoryId" type="id"></field>
      <field name="dataSourceId" type="id"></field>
      <field name="statusId" type="id"></field>
      <field name="dataResourceName" type="value"></field>
      <field name="localeString" type="very-short"></field>
      <field name="mimeTypeId" type="id-vlong"></field>
      <field name="characterSetId" type="id-long"></field>
      <field name="objectInfo" type="long-varchar"><description>For Short Text the text goes here.</description></field>
      <field name="surveyId" type="id"></field>
      <field name="surveyResponseId" type="id"></field>
      <field name="relatedDetailId" type="id"><description>Depending on the dataResourceTypeId this can point to other entities, like: Survey, SurveyResponse, etc.</description></field>
      <field name="isPublic" type="indicator"><description>If this is set to Y then anyone can download it, otherwise the download is restricted.</description></field>
      <field name="createdDate" type="date-time"></field>
      <field name="createdByUserLogin" type="id-vlong"></field>
      <field name="lastModifiedDate" type="date-time"></field>
      <field name="lastModifiedByUserLogin" type="id-vlong"></field>
      <prim-key field="dataResourceId"/>
      <relation type="one" fk-name="DTRSRC_STATUS" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
      <relation type="one" fk-name="DATA_REC_TO_TYPE" rel-entity-name="DataResourceType">
        <key-map field-name="dataResourceTypeId"/>
      </relation>
      <relation type="one" fk-name="DATA_REC_TO_TTP" rel-entity-name="DataTemplateType">
        <key-map field-name="dataTemplateTypeId"/>
      </relation>
      <relation type="one" fk-name="DATA_REC_TO_CAT" rel-entity-name="DataCategory">
        <key-map field-name="dataCategoryId"/>
      </relation>
      <relation type="one" fk-name="DATA_REC_DTSRC" rel-entity-name="DataSource">
        <key-map field-name="dataSourceId"/>
      </relation>
      <!-- see comment above for Content.mimeTypeId -->
      <relation type="one-nofk" rel-entity-name="MimeType">
        <key-map field-name="mimeTypeId"/>
      </relation>
      <relation type="one" fk-name="DATA_REC_CHST" rel-entity-name="CharacterSet">
        <key-map field-name="characterSetId"/>
      </relation>
      <relation type="many" rel-entity-name="DataResourceTypeAttr">
        <key-map field-name="dataResourceTypeId"/>
      </relation>
      <relation type="one" fk-name="DATA_REC_CB_ULGN" title="CreatedBy" rel-entity-name="UserLogin">
        <key-map field-name="createdByUserLogin" rel-field-name="userLoginId"/>
      </relation>
      <relation type="one" fk-name="DATA_REC_LMB_ULGN" title="LastModifiedBy" rel-entity-name="UserLogin">
        <key-map field-name="lastModifiedByUserLogin" rel-field-name="userLoginId"/>
      </relation>
        <relation type="one" fk-name="DATA_REC_SURVEY" rel-entity-name="Survey">
            <key-map field-name="surveyId"/>
        </relation>
        <relation type="one" fk-name="DATA_REC_SVRSP" rel-entity-name="SurveyResponse">
            <key-map field-name="surveyResponseId"/>
        </relation>
    </entity>
    <entity entity-name="DataResourceAttribute"
            package-name="org.apache.ofbiz.content.data"
            title="Data Object Attribute">
      <field name="dataResourceId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="attrValue" type="value"></field>
      <field name="attrDescription" type="description"></field>
      <prim-key field="dataResourceId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="DATA_REC_ATTR" rel-entity-name="DataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="many" rel-entity-name="DataResourceTypeAttr">
        <key-map field-name="attrName"/>
      </relation>
    </entity>
    <view-entity entity-name="DataResourceContentView"
                package-name="org.apache.ofbiz.content.content"
                title="DataResource and Content View">
      <member-entity entity-alias="DR" entity-name="DataResource"/>
      <member-entity entity-alias="CO" entity-name="Content"/>
      <alias-all entity-alias="DR"/>
      <alias-all entity-alias="CO"  prefix="co"/>
      <view-link entity-alias="DR" rel-entity-alias="CO" rel-optional="true">
        <key-map field-name="dataResourceId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="ElectronicText">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="ImageDataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="OtherDataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one" rel-entity-name="DataResourceType">
        <key-map field-name="dataResourceTypeId"/>
      </relation>
      <relation type="one" rel-entity-name="DataCategory">
        <key-map field-name="dataCategoryId"/>
      </relation>
      <relation type="one" rel-entity-name="DataSource">
        <key-map field-name="dataSourceId"/>
      </relation>
      <relation type="one" rel-entity-name="MimeType">
        <key-map field-name="mimeTypeId"/>
      </relation>
      <relation type="one" rel-entity-name="CharacterSet">
        <key-map field-name="characterSetId"/>
      </relation>
      <relation type="many" rel-entity-name="DataResourceTypeAttr">
        <key-map field-name="dataResourceTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="DataResourceAttribute">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="many" rel-entity-name="DataResourceRole">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one" title="CreatedBy" rel-entity-name="UserLogin">
        <key-map field-name="createdByUserLogin" rel-field-name="userLoginId"/>
      </relation>
      <relation type="one" title="LastModifiedBy" rel-entity-name="UserLogin">
        <key-map field-name="lastModifiedByUserLogin" rel-field-name="userLoginId"/>
      </relation>
    </view-entity>
    <entity entity-name="DataResourceMetaData"
            package-name="org.apache.ofbiz.content.data"
            title="Data Resource Meta-Data Predicate">
      <field name="dataResourceId" type="id"></field>
      <field name="metaDataPredicateId" type="id"></field>
      <field name="metaDataValue" type="value"></field>
      <field name="dataSourceId" type="id"></field>
      <prim-key field="dataResourceId"/>
      <prim-key field="metaDataPredicateId"/>
      <relation type="one" fk-name="DATA_MD_DATREC" rel-entity-name="DataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one" fk-name="DATA_MD_DMDPRD" rel-entity-name="MetaDataPredicate">
        <key-map field-name="metaDataPredicateId"/>
      </relation>
      <relation type="one" fk-name="DATA_MD_DTSRC" rel-entity-name="DataSource">
        <key-map field-name="dataSourceId"/>
      </relation>
    </entity>
    <entity entity-name="DataResourcePurpose"
            package-name="org.apache.ofbiz.content.data"
            title="Data Object Purpose">
      <field name="dataResourceId" type="id"></field>
      <field name="contentPurposeTypeId" type="id"></field>
      <prim-key field="dataResourceId"/>
      <prim-key field="contentPurposeTypeId"/>
      <relation type="one" fk-name="DATA_REC_PRP" rel-entity-name="DataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one" fk-name="DATA_REC_PRP_TYPE" rel-entity-name="ContentPurposeType">
        <key-map field-name="contentPurposeTypeId"/>
      </relation>
    </entity>
    <entity entity-name="DataResourceRole"
            package-name="org.apache.ofbiz.content.data"
            title="DataResource Role">
      <field name="dataResourceId" type="id"></field>
      <field name="partyId" type="id"></field>
      <field name="roleTypeId" type="id"></field>
      <field name="fromDate" type="date-time"></field>
      <field name="thruDate" type="date-time"></field>
      <prim-key field="dataResourceId"/>
      <prim-key field="partyId"/>
      <prim-key field="roleTypeId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="DATARECRL_DATREC" rel-entity-name="DataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one" fk-name="DATARECRL_PTRL" rel-entity-name="PartyRole">
        <key-map field-name="partyId"/>
        <key-map field-name="roleTypeId"/>
      </relation>
    </entity>
    <entity entity-name="DataResourceType"
            package-name="org.apache.ofbiz.content.data"
            default-resource-name="ContentEntityLabels"
            title="Data Object Type">
      <field name="dataResourceTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="dataResourceTypeId"/>
      <relation type="one" fk-name="DATA_OBTYPE_PARENT" title="Parent" rel-entity-name="DataResourceType">
        <key-map field-name="parentTypeId" rel-field-name="dataResourceTypeId"/>
      </relation>
    </entity>
    <entity entity-name="DataResourceTypeAttr"
            package-name="org.apache.ofbiz.content.data"
            title="Data Object Type Attribute">
      <field name="dataResourceTypeId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="description" type="description"></field>
      <prim-key field="dataResourceTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="DATA_OBTYPE_ATTR" rel-entity-name="DataResourceType">
        <key-map field-name="dataResourceTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="DataResourceAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="DataResource">
        <key-map field-name="dataResourceTypeId"/>
      </relation>
    </entity>
    <entity entity-name="DataTemplateType"
            package-name="org.apache.ofbiz.content.data"
            default-resource-name="ContentEntityLabels"
            title="Data Template Type">
      <field name="dataTemplateTypeId" type="id"></field>
      <field name="description" type="description"></field>
      <field name="extension" type="short-varchar"></field>
      <prim-key field="dataTemplateTypeId"/>
    </entity>
    <entity entity-name="ElectronicText"
            package-name="org.apache.ofbiz.content.data"
            title="Electronic Text">
      <field name="dataResourceId" type="id"></field>
      <field name="textData" type="very-long"></field>
      <prim-key field="dataResourceId"/>
      <relation type="one" fk-name="DATA_REC_TEXT" rel-entity-name="DataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
    </entity>
    <entity entity-name="FileExtension"
            package-name="org.apache.ofbiz.content.data"
            title="File Extension">
      <field name="fileExtensionId" type="id-long"></field>
      <field name="mimeTypeId" type="id-vlong"></field>
      <prim-key field="fileExtensionId"/>
      <relation type="one" fk-name="FILEEXT_MMTYP" rel-entity-name="MimeType">
        <key-map field-name="mimeTypeId"/>
      </relation>
    </entity>
    <entity entity-name="ImageDataResource"
            package-name="org.apache.ofbiz.content.data"
            title="Image Data Object">
      <field name="dataResourceId" type="id"></field>
      <field name="imageData" type="byte-array"></field>
      <prim-key field="dataResourceId"/>
      <relation type="one" fk-name="DATA_REC_IMAGE" rel-entity-name="DataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
    </entity>
    <entity entity-name="MetaDataPredicate"
            package-name="org.apache.ofbiz.content.data"
            default-resource-name="ContentEntityLabels"
            title="Data Meta-Data Predicate">
      <field name="metaDataPredicateId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="metaDataPredicateId"/>
    </entity>
    <entity entity-name="MimeType"
            package-name="org.apache.ofbiz.content.data"
            default-resource-name="ContentEntityLabels"
            title="Mime Type">
      <field name="mimeTypeId" type="id-vlong"></field>
      <field name="description" type="description"></field>
      <prim-key field="mimeTypeId"/>
    </entity>
    <entity entity-name="MimeTypeHtmlTemplate"
            package-name="org.apache.ofbiz.content.data"
            default-resource-name="ContentEntityLabels"
            title="Mime Text Template">
      <field name="mimeTypeId" type="id-vlong"></field>
      <field name="templateLocation" type="long-varchar"></field>
      <prim-key field="mimeTypeId"/>
      <relation type="one" fk-name="MIMETYPE_TPL_MT" rel-entity-name="MimeType">
          <key-map field-name="mimeTypeId"/>
      </relation>
    </entity>
    <entity entity-name="OtherDataResource"
            package-name="org.apache.ofbiz.content.data"
            title="Other Data Object">
      <field name="dataResourceId" type="id"></field>
      <field name="dataResourceContent" type="byte-array"></field>
      <prim-key field="dataResourceId"/>
      <relation type="one" fk-name="DATA_REC_OTHER" rel-entity-name="DataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
    </entity>
    <entity entity-name="VideoDataResource"
            package-name="org.apache.ofbiz.content.data"
            title="Video Data Object">
      <field name="dataResourceId" type="id"></field>
      <field name="videoData" type="byte-array"></field>
      <prim-key field="dataResourceId"/>
      <relation type="one" fk-name="DATA_REC_VIDEO" rel-entity-name="DataResource">
        <key-map field-name="dataResourceId"/>
      </relation>
    </entity>

  <!-- ========================================================= -->
  <!-- org.apache.ofbiz.content.document -->
  <!-- ========================================================= -->

    <entity entity-name="Document"
            package-name="org.apache.ofbiz.content.document"
            title="Document">
      <field name="documentId" type="id"></field>
      <field name="documentTypeId" type="id"></field>
      <field name="dateCreated" type="date-time"></field>
      <field name="comments" type="comment"></field>
      <field name="documentLocation" type="long-varchar"></field>
      <field name="documentText" type="long-varchar"></field>
      <field name="imageData" type="object"></field>
      <prim-key field="documentId"/>
      <relation type="one" fk-name="DOCUMENT_TO_TYPE" rel-entity-name="DocumentType">
        <key-map field-name="documentTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="DocumentTypeAttr">
        <key-map field-name="documentTypeId"/>
      </relation>
    </entity>
    <entity entity-name="DocumentAttribute"
            package-name="org.apache.ofbiz.content.document"
            title="Document Attribute">
      <field name="documentId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="attrValue" type="value"></field>
      <field name="attrDescription" type="description"></field>
      <prim-key field="documentId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="DOCUMENT_ATTR" rel-entity-name="Document">
        <key-map field-name="documentId"/>
      </relation>
      <relation type="many" rel-entity-name="DocumentTypeAttr">
        <key-map field-name="attrName"/>
      </relation>
    </entity>
    <entity entity-name="DocumentType"
            package-name="org.apache.ofbiz.content.document"
            default-resource-name="ContentEntityLabels"
            title="Document Type">
      <field name="documentTypeId" type="id"></field>
      <field name="parentTypeId" type="id"></field>
      <field name="hasTable" type="indicator"></field>
      <field name="description" type="description"></field>
      <prim-key field="documentTypeId"/>
      <relation type="one" fk-name="DOC_TYPE_PARENT" title="Parent" rel-entity-name="DocumentType">
        <key-map field-name="parentTypeId" rel-field-name="documentTypeId"/>
      </relation>
    </entity>
    <entity entity-name="DocumentTypeAttr"
            package-name="org.apache.ofbiz.content.document"
            title="Document Type Attribute">
      <field name="documentTypeId" type="id"></field>
      <field name="attrName" type="id-long"></field>
      <field name="description" type="description"></field>
      <prim-key field="documentTypeId"/>
      <prim-key field="attrName"/>
      <relation type="one" fk-name="DOC_TYPE_ATTR" rel-entity-name="DocumentType">
        <key-map field-name="documentTypeId"/>
      </relation>
      <relation type="many" rel-entity-name="DocumentAttribute">
        <key-map field-name="attrName"/>
      </relation>
      <relation type="many" rel-entity-name="Document">
        <key-map field-name="documentTypeId"/>
      </relation>
    </entity>

  <!-- ========================================================= -->
  <!-- org.apache.ofbiz.content.preference -->
  <!-- ========================================================= -->

    <entity entity-name="WebPreferenceType"
            package-name="org.apache.ofbiz.content.preference"
            title="Web Preference Type">
      <field name="webPreferenceTypeId" type="id"></field>
      <field name="description" type="description"></field>
      <prim-key field="webPreferenceTypeId"/>
    </entity>
    <entity entity-name="WebUserPreference"
            package-name="org.apache.ofbiz.content.preference"
            title="Web User Preference">
      <field name="userLoginId" type="id-vlong"></field>
      <field name="partyId" type="id"></field>
      <field name="visitId" type="id"><description>To be able to keep preferences for a non loggin in user for the current session</description></field>
      <field name="webPreferenceTypeId" type="id"></field>
      <field name="webPreferenceValue" type="long-varchar"/>
      <prim-key field="userLoginId"/>
      <prim-key field="partyId"/>
      <prim-key field="visitId"/>
      <prim-key field="webPreferenceTypeId"/>
      <relation type="one" fk-name="WEB_PREF_TYPE" rel-entity-name="WebPreferenceType">
        <key-map field-name="webPreferenceTypeId"/>
      </relation>
      <relation type="one" fk-name="WEB_PREF_USER" rel-entity-name="UserLogin">
        <key-map field-name="userLoginId"/>
      </relation>
      <relation type="one" fk-name="WEB_PREF_PARTY" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
    </entity>

  <!-- ========================================================= -->
  <!-- org.apache.ofbiz.content.survey -->
  <!-- ========================================================= -->

    <entity entity-name="Survey"
            package-name="org.apache.ofbiz.content.survey"
            title="Survey">
      <field name="surveyId" type="id"/>
      <field name="surveyName" type="name"/>
      <field name="description" type="description"/>
      <field name="comments" type="comment"/>
      <field name="submitCaption" type="short-varchar"/>
      <field name="responseService" type="long-varchar"/>
      <field name="isAnonymous" type="indicator"><description>Allow response to the survey without login?</description></field>
      <field name="allowMultiple" type="indicator"><description>Allow multiple responses to this survey (if Y), or just a single answer (if N)?</description></field>
      <field name="allowUpdate" type="indicator"><description>Allow change to responses?</description></field>
      <field name="acroFormContentId" type="id"><description>Points to PDF with AcroForm</description></field>
      <prim-key field="surveyId"/>
    </entity>
    <entity entity-name="SurveyApplType"
            package-name="org.apache.ofbiz.content.survey"
            default-resource-name="ContentEntityLabels"
            title="Survey Application Type">
      <field name="surveyApplTypeId" type="id"/>
      <field name="description" type="description"/>
      <prim-key field="surveyApplTypeId"/>
    </entity>
    <entity entity-name="SurveyMultiResp"
        package-name="org.apache.ofbiz.content.survey"
        title="Survey Multi-Response Group">
        <field name="surveyId" type="id"/>
        <field name="surveyMultiRespId" type="id"/>
        <field name="multiRespTitle" type="name"/>
        <prim-key field="surveyId"/>
        <prim-key field="surveyMultiRespId"/>
        <relation type="one" fk-name="SRVYMRSP_SRVY" rel-entity-name="Survey">
            <key-map field-name="surveyId"/>
        </relation>
    </entity>
    <entity entity-name="SurveyMultiRespColumn"
        package-name="org.apache.ofbiz.content.survey"
        title="Survey Multi-Response Group Column/Category">
        <field name="surveyId" type="id"/>
        <field name="surveyMultiRespId" type="id"/>
        <field name="surveyMultiRespColId" type="id"/>
        <field name="columnTitle" type="name"/>
        <field name="sequenceNum" type="numeric"/>
        <prim-key field="surveyId"/>
        <prim-key field="surveyMultiRespId"/>
        <prim-key field="surveyMultiRespColId"/>
        <relation type="one" fk-name="SRVYMRSPCL_SMRESP" rel-entity-name="SurveyMultiResp">
            <key-map field-name="surveyId"/>
            <key-map field-name="surveyMultiRespId"/>
        </relation>
    </entity>
    <entity entity-name="SurveyPage"
        package-name="org.apache.ofbiz.content.survey"
        title="Survey Page Type">
        <field name="surveyId" type="id"/>
        <field name="surveyPageSeqId" type="id"/>
        <field name="pageName" type="name"/>
        <field name="sequenceNum" type="numeric"/>
        <prim-key field="surveyId"/>
        <prim-key field="surveyPageSeqId"/>
        <relation type="one" fk-name="SRVYPAGE_SRVY" rel-entity-name="Survey">
            <key-map field-name="surveyId"/>
        </relation>
    </entity>
    <entity entity-name="SurveyQuestion"
            package-name="org.apache.ofbiz.content.survey"
            title="Survey Question">
      <field name="surveyQuestionId" type="id"/>
      <field name="surveyQuestionCategoryId" type="id"/>
      <field name="surveyQuestionTypeId" type="id"/>
      <field name="description" type="description"/>
      <field name="question" type="very-long"/>
      <field name="hint" type="very-long"/>
      <field name="enumTypeId" type="id"></field>
      <field name="geoId" type="id"></field>
      <field name="formatString" type="value"></field>
      <prim-key field="surveyQuestionId"/>
      <relation type="one" fk-name="SRVYQST_SRVYQTP" rel-entity-name="SurveyQuestionType">
        <key-map field-name="surveyQuestionTypeId"/>
      </relation>
      <relation type="one" fk-name="SRVYQST_SRVYQTCT" rel-entity-name="SurveyQuestionCategory">
        <key-map field-name="surveyQuestionCategoryId"/>
      </relation>
      <relation type="one" fk-name="SRVYQST_GEO" rel-entity-name="Geo">
        <key-map field-name="geoId"/>
      </relation>
      <relation type="many" fk-name="SRVYQST_ENUM" rel-entity-name="Enumeration">
        <key-map field-name="enumTypeId"/>
      </relation>

    </entity>
    <view-entity entity-name="SurveyQuestionAndAppl"
            package-name="org.apache.ofbiz.content.survey"
            title="Survey Question And Application View">
      <member-entity entity-alias="SQ" entity-name="SurveyQuestion"/>
      <member-entity entity-alias="SA" entity-name="SurveyQuestionAppl"/>
      <alias-all entity-alias="SQ"/>
      <alias-all entity-alias="SA"/>
      <view-link entity-alias="SQ" rel-entity-alias="SA">
        <key-map field-name="surveyQuestionId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="SurveyQuestionCategory">
        <key-map field-name="surveyQuestionCategoryId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="SurveyQuestionType">
        <key-map field-name="surveyQuestionTypeId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Survey">
        <key-map field-name="surveyId"/>
      </relation>
      <relation type="many" rel-entity-name="SurveyQuestionOption">
        <key-map field-name="surveyQuestionId"/>
      </relation>
      <relation type="many" rel-entity-name="Enumeration">
        <key-map field-name="enumTypeId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="Geo">
        <key-map field-name="geoId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="SurveyPage">
        <key-map field-name="surveyId"/>
        <key-map field-name="surveyPageSeqId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="SurveyMultiResp">
        <key-map field-name="surveyId"/>
        <key-map field-name="surveyMultiRespId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="SurveyMultiRespColumn">
        <key-map field-name="surveyId"/>
        <key-map field-name="surveyMultiRespId"/>
        <key-map field-name="surveyMultiRespColId"/>
      </relation>
    </view-entity>
    <entity entity-name="SurveyQuestionAppl"
            package-name="org.apache.ofbiz.content.survey"
            title="Survey Question Application">
      <field name="surveyId" type="id"/>
      <field name="surveyQuestionId" type="id"/>
      <field name="fromDate" type="date-time"/>
      <field name="thruDate" type="date-time"/>
      <field name="surveyPageSeqId" type="id"/>
      <field name="surveyMultiRespId" type="id"/>
      <field name="surveyMultiRespColId" type="id"><description>Used to optionally associate this question to a specific column in the Multi-Response set; with this you can associate a single question to each cell in the question/column grid; this is useful for AcroForm round trips where the target PDF needs a question associated with each cell, or even the same question applied with different externalFieldRef values.</description></field>
      <field name="requiredField" type="indicator"/>
      <field name="sequenceNum" type="numeric"/>
      <field name="externalFieldRef" type="long-varchar"><description>External field ID/reference; for AcroForms used to track the field ID</description></field>
      <field name="withSurveyQuestionId" type="id"><description>These two with* fields are used to specify that this question should only appear if the with option has been selected for the with question.</description></field>
      <field name="withSurveyOptionSeqId" type="id"/>
      <prim-key field="surveyId"/>
      <prim-key field="surveyQuestionId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="SRVYQSTAPL_SRVY" rel-entity-name="Survey">
        <key-map field-name="surveyId"/>
      </relation>
      <relation type="one" fk-name="SRVYQSTAPL_SRVYQ" rel-entity-name="SurveyQuestion">
        <key-map field-name="surveyQuestionId"/>
      </relation>
      <relation type="one" fk-name="SRVYQSTAPL_SVQO" title="With" rel-entity-name="SurveyQuestionOption">
        <key-map field-name="withSurveyQuestionId" rel-field-name="surveyQuestionId"/>
        <key-map field-name="withSurveyOptionSeqId" rel-field-name="surveyOptionSeqId"/>
      </relation>
        <relation type="one-nofk" rel-entity-name="SurveyPage">
            <description>This does not have a foreign key because the surveyId will never be null, and we want the surveyPageSeqId to be optional.</description>
            <key-map field-name="surveyId"/>
            <key-map field-name="surveyPageSeqId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="SurveyMultiResp">
            <description>This does not have a foreign key because the surveyId will never be null, and we want the surveyMultiRespId to be optional.</description>
            <key-map field-name="surveyId"/>
            <key-map field-name="surveyMultiRespId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="SurveyMultiRespColumn">
            <key-map field-name="surveyId"/>
            <key-map field-name="surveyMultiRespId"/>
            <key-map field-name="surveyMultiRespColId"/>
        </relation>
    </entity>
    <entity entity-name="SurveyQuestionCategory"
            package-name="org.apache.ofbiz.content.survey"
            title="Survey Question Category">
      <field name="surveyQuestionCategoryId" type="id"/>
      <field name="parentCategoryId" type="id"/>
      <field name="description" type="description"/>
      <prim-key field="surveyQuestionCategoryId"/>
      <relation type="one" fk-name="SRVYQSTCT_PAR" title="Parent" rel-entity-name="SurveyQuestionCategory">
        <key-map field-name="parentCategoryId" rel-field-name="surveyQuestionCategoryId"/>
      </relation>
    </entity>
    <entity entity-name="SurveyQuestionOption"
            package-name="org.apache.ofbiz.content.survey"
            title="Survey Question Option">
      <field name="surveyQuestionId" type="id"/>
      <field name="surveyOptionSeqId" type="id"/>
      <field name="description" type="description"/>
      <field name="sequenceNum" type="numeric"/>
      <field name="amountBase" type="currency-amount"/>
      <field name="amountBaseUomId" type="id"/>
      <field name="weightFactor" type="floating-point"/>
      <field name="duration" type="numeric"/>
      <field name="durationUomId" type="id"/>
      <prim-key field="surveyQuestionId"/>
      <prim-key field="surveyOptionSeqId"/>
      <relation type="one" fk-name="SRVYQSTOP_SRVYQ" rel-entity-name="SurveyQuestion">
        <key-map field-name="surveyQuestionId"/>
      </relation>
    </entity>
    <entity entity-name="SurveyQuestionType"
            package-name="org.apache.ofbiz.content.survey"
            default-resource-name="ContentEntityLabels"
            title="Survey Question Type">
      <field name="surveyQuestionTypeId" type="id"/>
      <field name="description" type="description"/>
      <prim-key field="surveyQuestionTypeId"/>
    </entity>
    <entity entity-name="SurveyResponse"
            package-name="org.apache.ofbiz.content.survey"
            title="Survey Response">
      <field name="surveyResponseId" type="id"></field>
      <field name="surveyId" type="id"></field>
      <field name="partyId" type="id"></field>
      <field name="responseDate" type="date-time"></field>
      <field name="lastModifiedDate" type="date-time"></field>
      <field name="referenceId" type="id-vlong"></field>
      <field name="generalFeedback" type="very-long"></field>
      <field name="orderId" type="id"></field>
      <field name="orderItemSeqId" type="id"></field>
      <field name="statusId" type="id"></field>
      <prim-key field="surveyResponseId"/>
      <relation type="one-nofk" rel-entity-name="Party">
        <key-map field-name="partyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="OrderItem">
        <key-map field-name="orderId"/>
        <key-map field-name="orderItemSeqId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="OrderHeader">
        <key-map field-name="orderId"/>
      </relation>
      <relation type="one" fk-name="SRVYRSP_SRVY" rel-entity-name="Survey">
        <key-map field-name="surveyId"/>
      </relation>
      <relation type="one" fk-name="SRVYRSP_STTS" rel-entity-name="StatusItem">
        <key-map field-name="statusId"/>
      </relation>
    </entity>
    <view-entity entity-name="SurveyResponseAndAnswer"
            package-name="org.apache.ofbiz.content.survey"
            title="Survey Response And Answer View">
      <member-entity entity-alias="SR" entity-name="SurveyResponse"/>
      <member-entity entity-alias="SRA" entity-name="SurveyResponseAnswer"/>
      <alias-all entity-alias="SR"/>
      <alias-all entity-alias="SRA"/>
      <view-link entity-alias="SR" rel-entity-alias="SRA">
        <key-map field-name="surveyResponseId"/>
      </view-link>
      <relation type="one-nofk" rel-entity-name="Survey">
        <key-map field-name="surveyId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="SurveyQuestion">
        <key-map field-name="surveyQuestionId"/>
      </relation>
      <relation type="one-nofk" rel-entity-name="SurveyQuestionOption">
        <key-map field-name="surveyQuestionId"/>
        <key-map field-name="surveyOptionSeqId"/>
      </relation>
        <relation type="one-nofk" rel-entity-name="SurveyResponse">
            <key-map field-name="surveyResponseId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="Content">
            <key-map field-name="contentId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="SurveyMultiRespColumn">
            <key-map field-name="surveyId"/>
            <key-map field-name="surveyMultiRespId"/>
            <key-map field-name="surveyMultiRespColId"/>
        </relation>
    </view-entity>
    <entity entity-name="SurveyResponseAnswer"
            package-name="org.apache.ofbiz.content.survey"
            title="Survey Response Answer">
      <field name="surveyResponseId" type="id"></field>
      <field name="surveyQuestionId" type="id"></field>
      <field name="surveyMultiRespColId" type="id"><description>This is needed to support multiple responses for different MultiResp Columns; if not part of a MultiResp will be _NA_</description></field>
      <field name="surveyMultiRespId" type="id"><description>This is not part of the primary key, but should be populated so that the SurveyMultiRespColumn can be more easily looked up.</description></field>
      <field name="booleanResponse" type="indicator"></field>
      <field name="currencyResponse" type="currency-amount"></field>
      <field name="floatResponse" type="floating-point"></field>
      <field name="numericResponse" type="numeric"></field>
      <field name="textResponse" type="very-long"></field>
      <field name="surveyOptionSeqId" type="id"></field>
      <field name="contentId" type="id"></field>
      <field name="answeredDate" type="date-time"></field>
      <field name="amountBase" type="currency-amount"/>
      <field name="amountBaseUomId" type="id"/>
      <field name="weightFactor" type="floating-point"/>
      <field name="duration" type="numeric"/>
      <field name="durationUomId" type="id"/>
      <field name="sequenceNum" type="numeric"/>
      <prim-key field="surveyResponseId"/>
      <prim-key field="surveyQuestionId"/>
      <prim-key field="surveyMultiRespColId"/>
      <relation type="one" fk-name="SRVYRSPA_SVRSP" rel-entity-name="SurveyResponse">
        <key-map field-name="surveyResponseId"/>
      </relation>
      <relation type="one" fk-name="SRVYRSPA_SVQU" rel-entity-name="SurveyQuestion">
        <key-map field-name="surveyQuestionId"/>
      </relation>
      <relation type="one" fk-name="SRVYRSPA_OPT" rel-entity-name="SurveyQuestionOption">
        <key-map field-name="surveyQuestionId"/>
        <key-map field-name="surveyOptionSeqId"/>
      </relation>
      <relation type="one" fk-name="SRVYRSPA_CONT" rel-entity-name="Content">
        <key-map field-name="contentId"/>
      </relation>
    </entity>
    <entity entity-name="SurveyTrigger"
            package-name="org.apache.ofbiz.content.survey"
            title="Survey Trigger">
      <field name="surveyId" type="id"/>
      <field name="surveyApplTypeId" type="id"/>
      <field name="fromDate" type="date-time"/>
      <field name="thruDate" type="date-time"/>
      <prim-key field="surveyId"/>
      <prim-key field="surveyApplTypeId"/>
      <prim-key field="fromDate"/>
      <relation type="one" fk-name="SRVYTRG_SRVY" rel-entity-name="Survey">
        <key-map field-name="surveyId"/>
      </relation>
      <relation type="one" fk-name="SRVYTRG_SRVYAPT" rel-entity-name="SurveyApplType">
        <key-map field-name="surveyApplTypeId"/>
      </relation>
    </entity>

  <!-- ========================================================= -->
  <!-- org.apache.ofbiz.content.website -->
  <!-- ========================================================= -->

    <extend-entity entity-name="WebPage">
        <field name="contentId" type="id"></field>
        <relation type="one" fk-name="WEB_PAGE_CONTENT" rel-entity-name="Content">
            <key-map field-name="contentId"/>
        </relation>
    </extend-entity>
    <entity entity-name="WebSiteContent"
        package-name="org.apache.ofbiz.content.website"
        title="Web Site Content Associations">
        <field name="webSiteId" type="id"></field>
        <field name="contentId" type="id"></field>
        <field name="webSiteContentTypeId" type="id"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <prim-key field="webSiteId"/>
        <prim-key field="contentId"/>
        <prim-key field="webSiteContentTypeId"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="WSCTNT_WEBSITE" rel-entity-name="WebSite">
            <key-map field-name="webSiteId"/>
        </relation>
        <relation type="one" fk-name="WSCTNT_CONTENT" rel-entity-name="Content">
            <key-map field-name="contentId"/>
        </relation>
        <relation type="one" fk-name="WSCTNT_WSCTTYPE" rel-entity-name="WebSiteContentType">
            <key-map field-name="webSiteContentTypeId"/>
        </relation>
    </entity>
    <view-entity entity-name="WebSiteAndContent"
        package-name="org.apache.ofbiz.content.website"
        title="Web Sites by contentId">
      <member-entity entity-alias="WS" entity-name="WebSite"/>
      <member-entity entity-alias="WSCT" entity-name="WebSiteContent"/>
      <alias-all entity-alias="WS"/>
      <alias-all entity-alias="WSCT">
        <exclude field="webSiteId"/>
      </alias-all>
      <view-link entity-alias="WS" rel-entity-alias="WSCT">
        <key-map field-name="webSiteId"/>
      </view-link>
    </view-entity>
    <entity entity-name="WebSiteContentType"
        package-name="org.apache.ofbiz.content.website"
        default-resource-name="ContentEntityLabels"
        title="Web Site Content Type">
        <field name="webSiteContentTypeId" type="id"></field>
        <field name="description" type="description"></field>
        <field name="parentTypeId" type="id"></field>
        <field name="hasTable" type="indicator"></field>
        <prim-key field="webSiteContentTypeId"/>
        <relation type="one" fk-name="WSCT_TYPE_PARENT" title="Parent" rel-entity-name="WebSiteContentType">
            <key-map field-name="parentTypeId" rel-field-name="webSiteContentTypeId"/>
        </relation>
    </entity>
    <entity entity-name="WebSitePathAlias"
        package-name="org.apache.ofbiz.content.website"
        title="Web Site Path Alias">
        <field name="webSiteId" type="id"></field>
        <field name="pathAlias" type="id-vlong"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <field name="aliasTo" type="long-varchar"></field>
        <field name="contentId" type="id"></field>
        <field name="mapKey" type="name"></field>
        <prim-key field="webSiteId"/>
        <prim-key field="pathAlias"/>
        <prim-key field="fromDate"/>
        <relation type="one" fk-name="WSPATH_WEBSITE" rel-entity-name="WebSite">
            <key-map field-name="webSiteId"/>
        </relation>
        <relation type="one" fk-name="WSPATH_CONTENT" rel-entity-name="Content">
            <key-map field-name="contentId"/>
        </relation>
    </entity>
    <entity entity-name="WebSitePublishPoint"
        package-name="org.apache.ofbiz.content.website"
        title="Web Site Publish Point">
        <field name="contentId" type="id"></field>
        <field name="templateTitle" type="long-varchar"></field>
        <field name="styleSheetFile" type="long-varchar"></field>
        <field name="logo" type="long-varchar"></field>
        <field name="medallionLogo" type="long-varchar"></field>
        <field name="lineLogo" type="long-varchar"></field>
        <field name="leftBarId" type="id"></field>
        <field name="rightBarId" type="id"></field>
        <field name="contentDept" type="id"></field>
        <field name="aboutContentId" type="id"></field>
        <prim-key field="contentId"/>
        <relation type="one" fk-name="WBSTPP_CONTENT" rel-entity-name="Content">
            <key-map field-name="contentId"/>
        </relation>
    </entity>
    <entity entity-name="WebSiteRole" package-name="org.apache.ofbiz.party.party" title="WebSite Role Association">
        <field name="partyId" type="id"></field>
        <field name="roleTypeId" type="id"></field>
        <field name="webSiteId" type="id"></field>
        <field name="fromDate" type="date-time"></field>
        <field name="thruDate" type="date-time"></field>
        <field name="sequenceNum" type="numeric"></field>
        <prim-key field="partyId"/>
        <prim-key field="roleTypeId"/>
        <prim-key field="webSiteId"/>
        <prim-key field="fromDate"/>
        <relation type="one-nofk" rel-entity-name="Party">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="RoleType">
            <key-map field-name="roleTypeId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="Person">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="PartyGroup">
            <key-map field-name="partyId"/>
        </relation>
        <relation type="one" fk-name="WSRLE_PTYRLE" rel-entity-name="PartyRole">
            <key-map field-name="partyId"/>
            <key-map field-name="roleTypeId"/>
        </relation>
        <relation type="one" fk-name="WSRLE_WSITE" rel-entity-name="WebSite">
            <key-map field-name="webSiteId"/>
        </relation>
    </entity>
    <view-entity entity-name="ContentAssocAndContentPurpose"
            package-name="org.apache.ofbiz.content.compdoc"
            title="ContentAssoc and ContentPurpose View">
        <member-entity entity-alias="CNTA" entity-name="ContentAssoc"/>
        <member-entity entity-alias="CNTP" entity-name="ContentPurpose"/>
        <alias entity-alias="CNTA" name="contentId"/>
        <alias entity-alias="CNTA" name="contentIdTo"/>
        <alias entity-alias="CNTA" name="contentAssocTypeId"/>
        <alias entity-alias="CNTA" name="fromDate"/>
        <alias entity-alias="CNTA" name="thruDate"/>
        <alias entity-alias="CNTA" name="dataSourceId"/>
        <alias entity-alias="CNTA" name="mapKey"/>
        <alias entity-alias="CNTP" name="contentPurposeTypeId"/>
        <alias entity-alias="CNTP" name="sequenceNum"/>
        <view-link entity-alias="CNTA" rel-entity-alias="CNTP">
            <key-map field-name="contentIdTo" rel-field-name="contentId"/>
        </view-link>
    </view-entity>

    <!-- defined as an extend and not directly in common to avoid dependencies between common and content -->
    <extend-entity entity-name="PortalPage">
        <field name="helpContentId" type="id"><description>Used to give contentId which will be shown when help on this page will be called</description></field>
        <relation type="one" fk-name="PORTPAL_HELP_CONT" rel-entity-name="Content">
            <key-map field-name="helpContentId" rel-field-name="contentId"/>
        </relation>
    </extend-entity>
    
    <entity entity-name="ContentKeyword" package-name="org.apache.ofbiz.content.content" title="Content Keyword" never-cache="true">
      <field name="contentId" type="id"></field>
      <field name="keyword" type="short-varchar"></field>
      <field name="relevancyWeight" type="numeric"></field>
      <prim-key field="contentId"/>
      <prim-key field="keyword"/>
      <relation type="one" fk-name="CNT_KWD_CNT" rel-entity-name="Content">
        <key-map field-name="contentId"/>
      </relation>
      <index name="CNT_KWD_KWD">
        <index-field name="keyword"/>
      </index>
    </entity>
    <entity entity-name="ContentSearchConstraint" package-name="org.apache.ofbiz.content.content" never-cache="true" title="Content Search Result Constraint">
      <field name="contentSearchResultId" type="id"></field>
      <field name="constraintSeqId" type="id"></field>
      <field name="constraintName" type="long-varchar"></field>
      <field name="infoString" type="long-varchar"></field>
      <field name="includeSubCategories" type="indicator"></field>
      <field name="isAnd" type="indicator"></field>
      <field name="anyPrefix" type="indicator"></field>
      <field name="anySuffix" type="indicator"></field>
      <field name="removeStems" type="indicator"></field>
      <field name="lowValue" type="short-varchar"></field>
      <field name="highValue" type="short-varchar"></field>
      <prim-key field="contentSearchResultId"/>
      <prim-key field="constraintSeqId"/>
      <relation type="one" fk-name="CNT_SCHRSI_RES" rel-entity-name="ContentSearchResult">
        <key-map field-name="contentSearchResultId"/>
      </relation>
    </entity>
    <entity entity-name="ContentSearchResult"
            package-name="org.apache.ofbiz.content.content"
            never-cache="true"
            title="Content Search Result">
      <field name="contentSearchResultId" type="id"></field>
      <field name="visitId" type="id"></field>
      <field name="orderByName" type="long-varchar"></field>
      <field name="isAscending" type="indicator"></field>
      <field name="numResults" type="numeric"></field>
      <field name="secondsTotal" type="floating-point"></field>
      <field name="searchDate" type="date-time"></field>
      <prim-key field="contentSearchResultId"/>
    </entity>
    
    <entity entity-name="WebAnalyticsConfig"
            package-name="org.apache.ofbiz.content.website"
            title="Web Analytics Configuration">
        <field name="webSiteId" type="id"></field>
        <field name="webAnalyticsTypeId" type="id"></field>
        <field name="webAnalyticsCode" type="very-long"><description>copy in here the analitics javascript code without the beginning- and end&lt;script&gt; tags</description></field>
        <prim-key field="webSiteId"/>
        <prim-key field="webAnalyticsTypeId"/>
        <relation type="one-nofk" rel-entity-name="WebAnalyticsType">
          <key-map field-name="webAnalyticsTypeId"/>
        </relation>
        <relation type="one-nofk" rel-entity-name="WebSite">
            <key-map field-name="webSiteId"/>
        </relation>
    </entity>

    <entity entity-name="WebAnalyticsType" package-name="org.apache.ofbiz.content.website"
        title="Web Analytics Type">
        <field name="webAnalyticsTypeId" type="id"></field>
        <field name="parentTypeId" type="id"></field>
        <field name="hasTable" type="indicator"></field>
        <field name="description" type="description"></field>
        <prim-key field="webAnalyticsTypeId"/>
        <relation type="one" fk-name="WANA_TYP_PARENT" title="Parent" rel-entity-name="WebAnalyticsType">
            <key-map field-name="parentTypeId" rel-field-name="webAnalyticsTypeId"/>
        </relation>
    </entity>
</entitymodel>
