[jira] Created: (OFBIZ-2108) The bug using IN operator with FindServices.java

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

[jira] Created: (OFBIZ-2108) The bug using IN operator with FindServices.java

Nicolas Malin (Jira)
The bug using IN operator with FindServices.java
------------------------------------------------

                 Key: OFBIZ-2108
                 URL: https://issues.apache.org/jira/browse/OFBIZ-2108
             Project: OFBiz
          Issue Type: Bug
          Components: framework
    Affects Versions: SVN trunk
            Reporter: WeizhanGuo


I want search all the OrganId is  0001 or 0002, and use the performFindList service.
So I set the value like this:pfInput.inputFields.OrganId_fld0_op=in and pfInput.inputFields.OrganId_fld0_value=0001,0002 and invoke the service, the generate where SQL is "OrganId in ('0001,0002') "  but what I want is "OrganId in ('0001','0002')."
if I pass the list value to the pfInput.inputFields.OrganId_fld0_value, the createCondtion don't support value as list type. and the method of convertFieldValue will convert the list to String, that's more complex.

I created a patch, let the value accept the list and if the operator is in ignore the convertFieldValue.
Please let me know if there is any problem

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-2108) The bug using IN operator with FindServices.java

Nicolas Malin (Jira)

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

WeizhanGuo updated OFBIZ-2108:
------------------------------

    Attachment: FindServices_IN.patch

> The bug using IN operator with FindServices.java
> ------------------------------------------------
>
>                 Key: OFBIZ-2108
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2108
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: WeizhanGuo
>         Attachments: FindServices_IN.patch
>
>
> I want search all the OrganId is  0001 or 0002, and use the performFindList service.
> So I set the value like this:pfInput.inputFields.OrganId_fld0_op=in and pfInput.inputFields.OrganId_fld0_value=0001,0002 and invoke the service, the generate where SQL is "OrganId in ('0001,0002') "  but what I want is "OrganId in ('0001','0002')."
> if I pass the list value to the pfInput.inputFields.OrganId_fld0_value, the createCondtion don't support value as list type. and the method of convertFieldValue will convert the list to String, that's more complex.
> I created a patch, let the value accept the list and if the operator is in ignore the convertFieldValue.
> Please let me know if there is any problem

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

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (OFBIZ-2108) The bug using IN operator with FindServices.java

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

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

Jacques Le Roux closed OFBIZ-2108.
----------------------------------

       Resolution: Fixed
    Fix Version/s: SVN trunk
         Assignee: Jacques Le Roux

Not sure how/when to use this in real life, but it works. Tested using
{code}
    <simple-method method-name="isSubscribed" short-description="check if a party has a subscription">
        <set field="map.invoiceId_fld0_op" value="in"/>
        <call-bsh><![CDATA[
                list = new ArrayList();
                list.add("demo10000");
                list.add("demo11000");
                parameters.put("listValues", list);
            ]]></call-bsh>
        <set field="map.invoiceId_fld0_value"  from-field="parameters.listValues"/>
        <set field="pfInput.inputFields"  from-field="map"/>
        <set field="pfInput.entityName" value="Invoice"/>
        <set field="pfInput.filterByDate" from-field="parameters.filterByDate" default-value="N"/>
{code}
This is the kind of stuff I'd like to have when testing a patch :/

Anyway, thanks Jack,

Your slightly modified (tabs -> 4 spaces, {} around blocks, some other minor formatting issues) patch is in trunk revision: 730001  


> The bug using IN operator with FindServices.java
> ------------------------------------------------
>
>                 Key: OFBIZ-2108
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2108
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: WeizhanGuo
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: FindServices_IN.patch
>
>
> I want search all the OrganId is  0001 or 0002, and use the performFindList service.
> So I set the value like this:pfInput.inputFields.OrganId_fld0_op=in and pfInput.inputFields.OrganId_fld0_value=0001,0002 and invoke the service, the generate where SQL is "OrganId in ('0001,0002') "  but what I want is "OrganId in ('0001','0002')."
> if I pass the list value to the pfInput.inputFields.OrganId_fld0_value, the createCondtion don't support value as list type. and the method of convertFieldValue will convert the list to String, that's more complex.
> I created a patch, let the value accept the list and if the operator is in ignore the convertFieldValue.
> Please let me know if there is any problem

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-2108) The bug using IN operator with FindServices.java

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659728#action_12659728 ]

WeizhanGuo commented on OFBIZ-2108:
-----------------------------------

Thank you for your testing.

We use it in our project for the restriction of recorders; the people can only read the recorders that under his organizations. Such as organizations id are 0001 and 0002, and we show the recorder in 0001, 0002.

I know what your mean {} around blocks, but I do set the tabs to 4 spaces, any wrong about this?

> The bug using IN operator with FindServices.java
> ------------------------------------------------
>
>                 Key: OFBIZ-2108
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2108
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: WeizhanGuo
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: FindServices_IN.patch
>
>
> I want search all the OrganId is  0001 or 0002, and use the performFindList service.
> So I set the value like this:pfInput.inputFields.OrganId_fld0_op=in and pfInput.inputFields.OrganId_fld0_value=0001,0002 and invoke the service, the generate where SQL is "OrganId in ('0001,0002') "  but what I want is "OrganId in ('0001','0002')."
> if I pass the list value to the pfInput.inputFields.OrganId_fld0_value, the createCondtion don't support value as list type. and the method of convertFieldValue will convert the list to String, that's more complex.
> I created a patch, let the value accept the list and if the operator is in ignore the convertFieldValue.
> Please let me know if there is any problem

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-2108) The bug using IN operator with FindServices.java

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659775#action_12659775 ]

Jacques Le Roux commented on OFBIZ-2108:
----------------------------------------

Lines 57 & 59 of your patch, exactly where the braces missed ;)

> The bug using IN operator with FindServices.java
> ------------------------------------------------
>
>                 Key: OFBIZ-2108
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2108
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: WeizhanGuo
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: FindServices_IN.patch
>
>
> I want search all the OrganId is  0001 or 0002, and use the performFindList service.
> So I set the value like this:pfInput.inputFields.OrganId_fld0_op=in and pfInput.inputFields.OrganId_fld0_value=0001,0002 and invoke the service, the generate where SQL is "OrganId in ('0001,0002') "  but what I want is "OrganId in ('0001','0002')."
> if I pass the list value to the pfInput.inputFields.OrganId_fld0_value, the createCondtion don't support value as list type. and the method of convertFieldValue will convert the list to String, that's more complex.
> I created a patch, let the value accept the list and if the operator is in ignore the convertFieldValue.
> Please let me know if there is any problem

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

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Commented: (OFBIZ-2108) The bug using IN operator with FindServices.java

guo weizhan
Yeah, I saw braces missed

but what's wrong about the tabs? I don't know about this, if you can tell me
I can do better next time :D

2008/12/30 Jacques Le Roux (JIRA) <[hidden email]>

>
>    [
> https://issues.apache.org/jira/browse/OFBIZ-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659775#action_12659775]
>
> Jacques Le Roux commented on OFBIZ-2108:
> ----------------------------------------
>
> Lines 57 & 59 of your patch, exactly where the braces missed ;)
>
> > The bug using IN operator with FindServices.java
> > ------------------------------------------------
> >
> >                 Key: OFBIZ-2108
> >                 URL: https://issues.apache.org/jira/browse/OFBIZ-2108
> >             Project: OFBiz
> >          Issue Type: Bug
> >          Components: framework
> >    Affects Versions: SVN trunk
> >            Reporter: WeizhanGuo
> >            Assignee: Jacques Le Roux
> >             Fix For: SVN trunk
> >
> >         Attachments: FindServices_IN.patch
> >
> >
> > I want search all the OrganId is  0001 or 0002, and use the
> performFindList service.
> > So I set the value like this:pfInput.inputFields.OrganId_fld0_op=in and
> pfInput.inputFields.OrganId_fld0_value=0001,0002 and invoke the service, the
> generate where SQL is "OrganId in ('0001,0002') "  but what I want is
> "OrganId in ('0001','0002')."
> > if I pass the list value to the pfInput.inputFields.OrganId_fld0_value,
> the createCondtion don't support value as list type. and the method of
> convertFieldValue will convert the list to String, that's more complex.
> > I created a patch, let the value accept the list and if the operator is
> in ignore the convertFieldValue.
> > Please let me know if there is any problem
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [jira] Commented: (OFBIZ-2108) The bug using IN operator with FindServices.java

Jacques Le Roux
Administrator
You should not have any tabs in files but 4 spaces (but in FTL files where 2 spaces is better)
Just read http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices

Thanks

Jacques

From: "guo weizhan" <[hidden email]>

> Yeah, I saw braces missed
>
> but what's wrong about the tabs? I don't know about this, if you can tell me
> I can do better next time :D
>
> 2008/12/30 Jacques Le Roux (JIRA) <[hidden email]>
>
>>
>>    [
>> https://issues.apache.org/jira/browse/OFBIZ-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659775#action_12659775]
>>
>> Jacques Le Roux commented on OFBIZ-2108:
>> ----------------------------------------
>>
>> Lines 57 & 59 of your patch, exactly where the braces missed ;)
>>
>> > The bug using IN operator with FindServices.java
>> > ------------------------------------------------
>> >
>> >                 Key: OFBIZ-2108
>> >                 URL: https://issues.apache.org/jira/browse/OFBIZ-2108
>> >             Project: OFBiz
>> >          Issue Type: Bug
>> >          Components: framework
>> >    Affects Versions: SVN trunk
>> >            Reporter: WeizhanGuo
>> >            Assignee: Jacques Le Roux
>> >             Fix For: SVN trunk
>> >
>> >         Attachments: FindServices_IN.patch
>> >
>> >
>> > I want search all the OrganId is  0001 or 0002, and use the
>> performFindList service.
>> > So I set the value like this:pfInput.inputFields.OrganId_fld0_op=in and
>> pfInput.inputFields.OrganId_fld0_value=0001,0002 and invoke the service, the
>> generate where SQL is "OrganId in ('0001,0002') "  but what I want is
>> "OrganId in ('0001','0002')."
>> > if I pass the list value to the pfInput.inputFields.OrganId_fld0_value,
>> the createCondtion don't support value as list type. and the method of
>> convertFieldValue will convert the list to String, that's more complex.
>> > I created a patch, let the value accept the list and if the operator is
>> in ignore the convertFieldValue.
>> > Please let me know if there is any problem
>>
>> --
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: [jira] Commented: (OFBIZ-2108) The bug using IN operator with FindServices.java

guo weizhan
Ok, thanks

2008/12/30 Jacques Le Roux <[hidden email]>

> You should not have any tabs in files but 4 spaces (but in FTL files where
> 2 spaces is better)
> Just read
> http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices
>
> Thanks
>
> Jacques
>
> From: "guo weizhan" <[hidden email]>
>
> Yeah, I saw braces missed
>>
>> but what's wrong about the tabs? I don't know about this, if you can tell
>> me
>> I can do better next time :D
>>
>> 2008/12/30 Jacques Le Roux (JIRA) <[hidden email]>
>>
>>
>>>   [
>>>
>>> https://issues.apache.org/jira/browse/OFBIZ-2108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659775#action_12659775
>>> ]
>>>
>>> Jacques Le Roux commented on OFBIZ-2108:
>>> ----------------------------------------
>>>
>>> Lines 57 & 59 of your patch, exactly where the braces missed ;)
>>>
>>> > The bug using IN operator with FindServices.java
>>> > ------------------------------------------------
>>> >
>>> >                 Key: OFBIZ-2108
>>> >                 URL: https://issues.apache.org/jira/browse/OFBIZ-2108
>>> >             Project: OFBiz
>>> >          Issue Type: Bug
>>> >          Components: framework
>>> >    Affects Versions: SVN trunk
>>> >            Reporter: WeizhanGuo
>>> >            Assignee: Jacques Le Roux
>>> >             Fix For: SVN trunk
>>> >
>>> >         Attachments: FindServices_IN.patch
>>> >
>>> >
>>> > I want search all the OrganId is  0001 or 0002, and use the
>>> performFindList service.
>>> > So I set the value like this:pfInput.inputFields.OrganId_fld0_op=in and
>>> pfInput.inputFields.OrganId_fld0_value=0001,0002 and invoke the service,
>>> the
>>> generate where SQL is "OrganId in ('0001,0002') "  but what I want is
>>> "OrganId in ('0001','0002')."
>>> > if I pass the list value to the pfInput.inputFields.OrganId_fld0_value,
>>> the createCondtion don't support value as list type. and the method of
>>> convertFieldValue will convert the list to String, that's more complex.
>>> > I created a patch, let the value accept the list and if the operator is
>>> in ignore the convertFieldValue.
>>> > Please let me know if there is any problem
>>>
>>> --
>>> This message is automatically generated by JIRA.
>>> -
>>> You can reply to this email to add a comment to the issue online.
>>>
>>>
>>>
>>
>