Filter search entity list with date value on forms

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Filter search entity list with date value on forms

Malin Nicolas
Hi,

I tred to find all productPrice associated to a workEffort and filter
them by the workEffort.actualStartDate value. To achieve that I used in
the form's action an entity-condition like this one :

<entity-condition entity-name="ProductPrice" list="listIt" >
<condition-list>
<condition-expr field-name="fromDate"
from-field="workEffort.actualStartDate" operator="less-equals"/>
<condition-expr field-name="thruDate"
from-field="workEffort.actualStartDate" operator="greater-equals"/>
<condition-expr field-name="productId" from-field="workEffort.productId"/>
</condition-list>
</entity-condition>

This is working fine but only if the ProductPrice.thruDate exists. If I
use :
<entity-condition entity-name="ProductPrice" list="listIt"
filter-by-date="true">
The filter isn't anymore with workEffort.actualStartDate but with
nowTimestamp value. It's not my goal.

After a quick search I extended ListFinder.java to add a new attribute :
filter-with-date-value to have the possibility to give a date value to
filter. Now I can do :
<entity-condition entity-name="ProductPrice" list="listIt"
filter-with-date-value="${workEffort.actualStartDate}" >
<condition-list>
<condition-expr field-name="productId" from-field="workEffort.productId"/>
</condition-list>
</entity-condition>

I opened a jira issue to submit this improvment or is there already a
solution for doing this?
Any suggestions are welcome !


Nicolas

--
Nicolas MALIN
Consultant
Tél : 06.17.66.40.06
Site projet : http://www.neogia.org/
-------
Société LibrenBerry
Tél : 02.48.02.56.12
Site : http://www.librenberry.net/

Reply | Threaded
Open this post in threaded view
|

Re: Filter search entity list with date value on forms

Scott Gray-2
Hi Nicolas,

No comment right now on your suggestion but just as an FYI, condition-expr has ignore-if-null and ignore-if-empty attributes to avoid the problem you described with your initial attempt.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 16/09/2010, at 10:17 PM, Nicolas Malin wrote:

> Hi,
>
> I tred to find all productPrice associated to a workEffort and filter them by the workEffort.actualStartDate value. To achieve that I used in the form's action an entity-condition like this one :
>
> <entity-condition entity-name="ProductPrice" list="listIt" >
> <condition-list>
> <condition-expr field-name="fromDate" from-field="workEffort.actualStartDate" operator="less-equals"/>
> <condition-expr field-name="thruDate" from-field="workEffort.actualStartDate" operator="greater-equals"/>
> <condition-expr field-name="productId" from-field="workEffort.productId"/>
> </condition-list>
> </entity-condition>
>
> This is working fine but only if the ProductPrice.thruDate exists. If I use :
> <entity-condition entity-name="ProductPrice" list="listIt" filter-by-date="true">
> The filter isn't anymore with workEffort.actualStartDate but with nowTimestamp value. It's not my goal.
>
> After a quick search I extended ListFinder.java to add a new attribute : filter-with-date-value to have the possibility to give a date value to filter. Now I can do :
> <entity-condition entity-name="ProductPrice" list="listIt" filter-with-date-value="${workEffort.actualStartDate}" >
> <condition-list>
> <condition-expr field-name="productId" from-field="workEffort.productId"/>
> </condition-list>
> </entity-condition>
>
> I opened a jira issue to submit this improvment or is there already a solution for doing this?
> Any suggestions are welcome !
>
>
> Nicolas
>
> --
> Nicolas MALIN
> Consultant
> Tél : 06.17.66.40.06
> Site projet : http://www.neogia.org/
> -------
> Société LibrenBerry
> Tél : 02.48.02.56.12
> Site : http://www.librenberry.net/
>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Filter search entity list with date value on forms

Malin Nicolas
Hi Scott, it was my first idea, but ignore-if-null and ignore-if-empty
works on given value and not search attribute.

Nicolas

Le 16/09/2010 12:51, Scott Gray a écrit :

> Hi Nicolas,
>
> No comment right now on your suggestion but just as an FYI, condition-expr has ignore-if-null and ignore-if-empty attributes to avoid the problem you described with your initial attempt.
>
> Regards
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 16/09/2010, at 10:17 PM, Nicolas Malin wrote:
>
>    
>> Hi,
>>
>> I tred to find all productPrice associated to a workEffort and filter them by the workEffort.actualStartDate value. To achieve that I used in the form's action an entity-condition like this one :
>>
>> <entity-condition entity-name="ProductPrice" list="listIt">
>> <condition-list>
>> <condition-expr field-name="fromDate" from-field="workEffort.actualStartDate" operator="less-equals"/>
>> <condition-expr field-name="thruDate" from-field="workEffort.actualStartDate" operator="greater-equals"/>
>> <condition-expr field-name="productId" from-field="workEffort.productId"/>
>> </condition-list>
>> </entity-condition>
>>
>> This is working fine but only if the ProductPrice.thruDate exists. If I use :
>> <entity-condition entity-name="ProductPrice" list="listIt" filter-by-date="true">
>> The filter isn't anymore with workEffort.actualStartDate but with nowTimestamp value. It's not my goal.
>>
>> After a quick search I extended ListFinder.java to add a new attribute : filter-with-date-value to have the possibility to give a date value to filter. Now I can do :
>> <entity-condition entity-name="ProductPrice" list="listIt" filter-with-date-value="${workEffort.actualStartDate}">
>> <condition-list>
>> <condition-expr field-name="productId" from-field="workEffort.productId"/>
>> </condition-list>
>> </entity-condition>
>>
>> I opened a jira issue to submit this improvment or is there already a solution for doing this?
>> Any suggestions are welcome !
>>
>>
>> Nicolas
>>
>> --
>> Nicolas MALIN
>> Consultant
>> Tél : 06.17.66.40.06
>> Site projet : http://www.neogia.org/
>> -------
>> Société LibrenBerry
>> Tél : 02.48.02.56.12
>> Site : http://www.librenberry.net/
>>
>>      
>    


--
Nicolas MALIN
Consultant
Tél : 06.17.66.40.06
Site projet : http://www.neogia.org/
-------
Société LibrenBerry
Tél : 02.48.02.56.12
Site : http://www.librenberry.net/

Reply | Threaded
Open this post in threaded view
|

Re: Filter search entity list with date value on forms

Scott Gray-2
Oh right, I see what you mean.

About adding the new attribute, my preference would be to see a new element specifically for date filtering.  Maybe after this problem is solved someone will come along and say that they need to filter on date fields that aren't called fromDate and thruDate.  Or perhaps someone will wanted to filter against a date range instead of a single moment i.e. all prices active at some point during August.  A new element would help us avoid clutter on the main entity-condition element.

Regards
Scott

On 16/09/2010, at 11:10 PM, Nicolas Malin wrote:

> Hi Scott, it was my first idea, but ignore-if-null and ignore-if-empty works on given value and not search attribute.
>
> Nicolas
>
> Le 16/09/2010 12:51, Scott Gray a écrit :
>> Hi Nicolas,
>>
>> No comment right now on your suggestion but just as an FYI, condition-expr has ignore-if-null and ignore-if-empty attributes to avoid the problem you described with your initial attempt.
>>
>> Regards
>> Scott
>>
>> HotWax Media
>> http://www.hotwaxmedia.com
>>
>> On 16/09/2010, at 10:17 PM, Nicolas Malin wrote:
>>
>>  
>>> Hi,
>>>
>>> I tred to find all productPrice associated to a workEffort and filter them by the workEffort.actualStartDate value. To achieve that I used in the form's action an entity-condition like this one :
>>>
>>> <entity-condition entity-name="ProductPrice" list="listIt">
>>> <condition-list>
>>> <condition-expr field-name="fromDate" from-field="workEffort.actualStartDate" operator="less-equals"/>
>>> <condition-expr field-name="thruDate" from-field="workEffort.actualStartDate" operator="greater-equals"/>
>>> <condition-expr field-name="productId" from-field="workEffort.productId"/>
>>> </condition-list>
>>> </entity-condition>
>>>
>>> This is working fine but only if the ProductPrice.thruDate exists. If I use :
>>> <entity-condition entity-name="ProductPrice" list="listIt" filter-by-date="true">
>>> The filter isn't anymore with workEffort.actualStartDate but with nowTimestamp value. It's not my goal.
>>>
>>> After a quick search I extended ListFinder.java to add a new attribute : filter-with-date-value to have the possibility to give a date value to filter. Now I can do :
>>> <entity-condition entity-name="ProductPrice" list="listIt" filter-with-date-value="${workEffort.actualStartDate}">
>>> <condition-list>
>>> <condition-expr field-name="productId" from-field="workEffort.productId"/>
>>> </condition-list>
>>> </entity-condition>
>>>
>>> I opened a jira issue to submit this improvment or is there already a solution for doing this?
>>> Any suggestions are welcome !
>>>
>>>
>>> Nicolas
>>>
>>> --
>>> Nicolas MALIN
>>> Consultant
>>> Tél : 06.17.66.40.06
>>> Site projet : http://www.neogia.org/
>>> -------
>>> Société LibrenBerry
>>> Tél : 02.48.02.56.12
>>> Site : http://www.librenberry.net/
>>>
>>>    
>>  
>
>
> --
> Nicolas MALIN
> Consultant
> Tél : 06.17.66.40.06
> Site projet : http://www.neogia.org/
> -------
> Société LibrenBerry
> Tél : 02.48.02.56.12
> Site : http://www.librenberry.net/
>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Filter search entity list with date value on forms

Malin Nicolas
Yes your right also scott ;)

My solution is quick correction but not a global analyse. I don't have
time to make more but I create a jira to keep idea and have a task
remerber ;)
I works on it asap.

Nicolas

Le 16/09/2010 13:48, Scott Gray a écrit :

> Oh right, I see what you mean.
>
> About adding the new attribute, my preference would be to see a new element specifically for date filtering.  Maybe after this problem is solved someone will come along and say that they need to filter on date fields that aren't called fromDate and thruDate.  Or perhaps someone will wanted to filter against a date range instead of a single moment i.e. all prices active at some point during August.  A new element would help us avoid clutter on the main entity-condition element.
>
> Regards
> Scott
>
> On 16/09/2010, at 11:10 PM, Nicolas Malin wrote:
>
>    
>> Hi Scott, it was my first idea, but ignore-if-null and ignore-if-empty works on given value and not search attribute.
>>
>> Nicolas
>>
>> Le 16/09/2010 12:51, Scott Gray a écrit :
>>      
>>> Hi Nicolas,
>>>
>>> No comment right now on your suggestion but just as an FYI, condition-expr has ignore-if-null and ignore-if-empty attributes to avoid the problem you described with your initial attempt.
>>>
>>> Regards
>>> Scott
>>>
>>> HotWax Media
>>> http://www.hotwaxmedia.com
>>>
>>> On 16/09/2010, at 10:17 PM, Nicolas Malin wrote:
>>>
>>>
>>>        
>>>> Hi,
>>>>
>>>> I tred to find all productPrice associated to a workEffort and filter them by the workEffort.actualStartDate value. To achieve that I used in the form's action an entity-condition like this one :
>>>>
>>>> <entity-condition entity-name="ProductPrice" list="listIt">
>>>> <condition-list>
>>>> <condition-expr field-name="fromDate" from-field="workEffort.actualStartDate" operator="less-equals"/>
>>>> <condition-expr field-name="thruDate" from-field="workEffort.actualStartDate" operator="greater-equals"/>
>>>> <condition-expr field-name="productId" from-field="workEffort.productId"/>
>>>> </condition-list>
>>>> </entity-condition>
>>>>
>>>> This is working fine but only if the ProductPrice.thruDate exists. If I use :
>>>> <entity-condition entity-name="ProductPrice" list="listIt" filter-by-date="true">
>>>> The filter isn't anymore with workEffort.actualStartDate but with nowTimestamp value. It's not my goal.
>>>>
>>>> After a quick search I extended ListFinder.java to add a new attribute : filter-with-date-value to have the possibility to give a date value to filter. Now I can do :
>>>> <entity-condition entity-name="ProductPrice" list="listIt" filter-with-date-value="${workEffort.actualStartDate}">
>>>> <condition-list>
>>>> <condition-expr field-name="productId" from-field="workEffort.productId"/>
>>>> </condition-list>
>>>> </entity-condition>
>>>>
>>>> I opened a jira issue to submit this improvment or is there already a solution for doing this?
>>>> Any suggestions are welcome !
>>>>
>>>>
>>>> Nicolas
>>>>
>>>> --
>>>> Nicolas MALIN
>>>> Consultant
>>>> Tél : 06.17.66.40.06
>>>> Site projet : http://www.neogia.org/
>>>> -------
>>>> Société LibrenBerry
>>>> Tél : 02.48.02.56.12
>>>> Site : http://www.librenberry.net/
>>>>
>>>>
>>>>          
>>>
>>>        
>>
>> --
>> Nicolas MALIN
>> Consultant
>> Tél : 06.17.66.40.06
>> Site projet : http://www.neogia.org/
>> -------
>> Société LibrenBerry
>> Tél : 02.48.02.56.12
>> Site : http://www.librenberry.net/
>>
>>      
>    


--
Nicolas MALIN
Consultant
Tél : 06.17.66.40.06
Site projet : http://www.neogia.org/
-------
Société LibrenBerry
Tél : 02.48.02.56.12
Site : http://www.librenberry.net/