In order to extend Database Model, Minyaa introduces a Abstract Model Manager.
Its allows you to extend Database Model by creating your own Model Manager.
Before Minyaa 2.2, extension was done by modifying directly the OFBiz files !
This previous solution had many constraints :
package com.yourcompany.model; import com.minyaa.model.AbstractPluginModelManager; public class YourModelManager implements AbstractPluginModelManager { private static String entityModelFileName = "edit-webapp/WEB-INF/classes/entitydefs/entitymodel.yourcompany.xml"; private static String entityGroupModelFileName = "edit-webapp/WEB-INF/classes/entitydefs/entitygroup.yourcompany.xml"; public YourModelManager(final PluginModelManagerDirectory _pluginModelManagerDirectory) { super(_pluginModelManagerDirectory); } /** * @see com.minyaa.model.PluginModelManager.getEntityModelFileName() */ public String getEntityModelFileName() { return entityModelFileName; } /** * @see com.minyaa.model.PluginModelManager.getEntityGroupModelFileName() */ public String getEntityGroupModelFileName() { return entityGroupModelFileName; } /** * @see com.minyaa.model.PluginModelManager.getPluginKey() */ public String getPluginKey() { return "com.yourcompany.plugin"; } }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE entitymodel PUBLIC "-//OFBiz//DTD Entity Model//EN" "http://oss.org.cn/ossdocs/applications/ofbiz/ofbiz-2.1.1-docs/website/dtds/entitymodel.dtd"> <entitymodel> <title>Entity Model for Your Plugin</title> <description>Entities added to store Your Data</description> <author>You</author> <version>X.Y</version> <entity entity-name="YourEntity" table-name="companyprefix_your_entity" package-name=""> ... </entity> </entitymodel>
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE entitygroup PUBLIC "-//OFBiz//DTD Entity Group//EN" "http://oss.org.cn/ossdocs/applications/ofbiz/ofbiz-2.1.1-docs/website/dtds/entitygroup.dtd"> <entitygroup> <entity-group group="default" entity="YourEntity"/> </entitygroup>
<atlassian-plugin key="jira.plugin.yourcompany.model" name="Your Company Plugin for Database Model Extension"> <plugin-info> <description>${pom.description}</description> <version>${pom.version}</version> <vendor name="${pom.organization.name}" url="${pom.organization.url}"/> </plugin-info> ... <component key="YourModelManager" name="YourModelManager" class="com.yourcompany.model.YourModelManager" /> ... </atlassian-plugin>
Provider | Details |
---|---|
com.minyaa.model.MinyaaCoreModelManager | Database Model Extension for Minyaa Core |
com.minyaa.model.MinyaaTimeModelManager | Database Model Extension for Minyaa Time |
com.minyaa.model.MinyaaSpreadModelManager | Database Model Extension for Minyaa Spread |