[ 
https://issues.apache.org/jira/browse/OFBIZ-1425?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Adrian Crum updated OFBIZ-1425:
-------------------------------

    Attachment: example.patch
                modelfield.patch

modelfield.patch contains the improvement.
example.patch contains a demo in the Example component. Use the Webtools entity 
reference to view the results.

ModelField.getDescription() uses the following strategy to resolve the 
description:

1. If the entity definition has a <default-resource-name> property, and the 
corresponding resource contains the FieldDescription.[entityname].[fieldname]  
property, then return the property
2. If the entity definition contains a <description>  element for this field, 
then return the <description> element
3. If the entity definition has a <default-resource-name> property, and the 
corresponding resource contains the FieldDescription.[fieldname] property, then 
return the property
4. Convert the field name into a sentence, then return the sentence

I believe this strategy will make everyone happy. An entity that isn't 
documented will have its field names converted to sentences for field 
descriptions. An entity that has a handful of fields documented will show those 
descriptions, and the remaining fields will have field names converted to 
sentences for field descriptions. An entity can be further docmented by putting 
common, redundant field descriptions in a property file. An ambitious developer 
could create a localized properties file to document an entity in another 
language.


> Improve the ModelField.getDescription method
> --------------------------------------------
>
>                 Key: OFBIZ-1425
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1425
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Adrian Crum
>            Priority: Minor
>         Attachments: example.patch, modelfield.patch
>
>
> Based upon discussion on the dev mailing list and in the OFBIZ-1387 issue, 
> modify the ModelField.getDescription method so it uses a more comprehensive 
> way to resolve a field description.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to