Improved: Replaces ModelInduceFromDb with widgets (OFBIZ-6510)

This is a manual backport of the related two commits in trunk with minor
changes to fit the r18.12 codebase.
This commit is contained in:
Michael Brohl
2021-02-11 21:12:26 +01:00
parent ee51eb7360
commit 177b96300f
11 changed files with 387 additions and 6 deletions
@@ -1538,6 +1538,25 @@ public class ModelEntity implements Comparable<ModelEntity>, Serializable {
return this.toXmlElement(document, this.getPackageName());
}
public Element toGroupXmlElement(Document document) {
return this.toGroupXmlElement(document, this.getPackageName());
}
public Element toGroupXmlElement(Document document, String packageName) {
if (UtilValidate.isNotEmpty(this.getPackageName()) && !packageName.equals(this.getPackageName())) {
Debug.logWarning(
"Export EntityModel XML Element [" + this.getEntityName() + "] with a NEW package - " + packageName,
module);
}
Element root = document.createElement("entity-group");
root.setAttribute("group", packageName);
root.setAttribute("entity", this.getEntityName());
return root;
}
/**
* Writes entity model information in the Apple EOModelBundle format.
*