Hi, All
In my project, there are many protocols to set up.
For every protocol, it has many attributes.
All these protocols have been divided into several types according to
their usage.
For example
A type has attributes: ChlUrl, SupportedCharsets, ServerID
B type has attributes: InClientPull
C type has attributes: ChlUrl, SMRCustomerType, GMDChargingCurrency,
SupportedCharsets, ServerID
<form name="A" type="single"
target="createProtocolAttribute?protocolid=${id}">
<field name="ChlUrl"><text/></field>
<field name="SupportedCharsets"><text/></field>
<field name="ServerID"><text/></field>
<field name="submitButton" title="Add Protocol">
<submit button-type="button"/>
</field>
</form>
<form name="B" type="single"
target="createProtocolAttribute?protocolid=${id}">
<field name="InClientPull"><text/></field>
<field name="submitButton" title="Add Protocol">
<submit button-type="button"/>
</field>
</form>
<form name="C" type="single"
target="createProtocolAttribute?protocolid=${id}">
<field name="ChlUrl"><text/></field>
<field name="SMRCustomerType"><text/></field>
<field name="GMDChargingCurrency"><text/></field>
<field name="SupportedCharsets"><text/></field>
<field name="ServerID"><text/></field>
<field name="submitButton" title="Add Protocol">
<submit button-type="button"/>
</field>
</form>
When setting up a protocol in a web page, first choose a type from
drop-down list, the web page show attributes relating to its type.
After filling in the attributes' value, submit the form and save all
these attribute-value pairs in the table protocolAttribute below.
services.xml
<service name=" createProtocolAttribute " engine="java"
location="com.xian.cmb.CmbServices" invoke="createProtocolAttribute">
<attribute name="ChlUrl" mode="IN" type="String"
optional="true" />
<attribute name="SupportedCharsets" mode="IN"
type="String" optional="true" />
<attribute name="ServerID" mode="IN" type="String"
optional="true" />
<attribute name="InClientPull" mode="IN" type="String"
optional="true" />
<attribute name="SMRCustomerType" mode="IN"
type="String" optional="true" />
<attribute name="GMDChargingCurrency" mode="IN"
type="String" optional="true" />
</service>
Tables:
protocol: protocolid, protocolName.
protocolAttribute: id, protocolid, attribute, value.
With the progress of technology, the number of every protocol's
attributes is increasing.
So we need to modify the forms in the screens to add new fields and
services.xml file to add mode IN attributes, and java code to save newly
added attribute-value pairs.
Can OFBiz have solutions to deal with the CHANGE and When adding an
attribute, we needn't modify the form, services.xml and java source
code?
Best Regards,
Jack Liu