Author: jaz
Date: Wed Feb 24 23:59:58 2010
New Revision: 916049
URL:
http://svn.apache.org/viewvc?rev=916049&view=revLog:
extend-entity can now override the default-resource-name attribute
Modified:
ofbiz/trunk/framework/entity/dtd/entitymodel.xsd
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java
Modified: ofbiz/trunk/framework/entity/dtd/entitymodel.xsd
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/dtd/entitymodel.xsd?rev=916049&r1=916048&r2=916049&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/dtd/entitymodel.xsd (original)
+++ ofbiz/trunk/framework/entity/dtd/entitymodel.xsd Wed Feb 24 23:59:58 2010
@@ -452,5 +452,6 @@
</xs:element>
<xs:attributeGroup name="attlist.extend-entity">
<xs:attribute name="entity-name" type="xs:string" use="required"/>
+ <xs:attribute name="default-resource-name" type="xs:string"/>
</xs:attributeGroup>
</xs:schema>
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java?rev=916049&r1=916048&r2=916049&view=diff==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntity.java Wed Feb 24 23:59:58 2010
@@ -37,6 +37,7 @@
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.ObjectType;
+import org.ofbiz.base.util.StringUtil;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilPlist;
import org.ofbiz.base.util.UtilTimer;
@@ -305,6 +306,13 @@
if (!field.isPk) this.nopks.add(field);
}
}
+
+ // override the default resource file
+ String defResourceName = StringUtil.internString(extendEntityElement.getAttribute("default-resource-name"));
+ Debug.log("Extended entity - " + extendEntityElement.getAttribute("entity-name") + " new resource name : " + defResourceName, module);
+ if (UtilValidate.isNotEmpty(defResourceName)) {
+ this.setDefaultResourceName(defResourceName);
+ }
this.populateRelated(reader, extendEntityElement);
this.populateIndexes(extendEntityElement);