[ 
https://issues.apache.org/jira/browse/OFBIZ-1232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526351
 ] 

Jonathon Wong commented on OFBIZ-1232:
--------------------------------------

This works too. My own implementation puts it in the <view-link>, and the 
"filter condition" can only be applied to either (one or both) tables being 
joined by the <view-link>.

That way, it makes for cleaner entitymodel.xml definitions, and we don't easily 
end up with redundant or duplicate "filter conditions" like when using <filter>.

A good practice to ensure clean codes in entitymodel.xml, if you're using my 
approach, is to always add the "filter condition" only for the "2nd table being 
joined". That is, the "rel-entity-alias". That is assuming you also do the good 
practice of constructing your <view-entity> in a strict and clean top-down 
hierarchy!

> Data filtering in entity views
> ------------------------------
>
>                 Key: OFBIZ-1232
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1232
>             Project: OFBiz
>          Issue Type: New Feature
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Oscar Pablo
>            Priority: Minor
>             Fix For: SVN trunk
>
>         Attachments: filter_views.diff
>
>
> OfBiz allows the creation of views based on the database model. But the data 
> selection is done only by join. It would be great to select the data also by 
> value. And, in some cases, it avoids workarounds and a cleaner code.
> The proposal is to create a new tag inside view-entity tag from 
> entitymodel.xml with the following syntax:
> <filter entity-alias="<table_alias>" field-name="<field_name>" 
> operator="<operator:equals, not-equals, like...>" value="<value_to_select>"/>
> these tag could appear from 0 to N times. When N times, all filter criteria 
> must match with the data to select it.
> I am attaching the xsd and the code I made...

-- 
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