You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Adrian Crum <ad...@sandglass-software.com> on 2015/07/31 14:27:01 UTC

Re: svn commit: r1693579 - /ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy

Why are we putting Jira issue numbers in code comments? It was my 
understanding that this type of meta-data belongs in the commit message.

Adrian Crum
Sandglass Software
www.sandglass-software.com

On 7/31/2015 4:56 AM, jleroux@apache.org wrote:
> Author: jleroux
> Date: Fri Jul 31 11:56:58 2015
> New Revision: 1693579
>
> URL: http://svn.apache.org/r1693579
> Log:
> A solution from Gareth Carter for "Wrong percent encoding in Webtool/SQL Processor" https://issues.apache.org/jira/browse/OFBIZ-6567
>
> This was reported by Gareth Carter;
>
> If for instance you use this SQL expression
>      select * from Party_Role where role_Type_Id LIKE  '%CA%'
> It will be interpreted (and returned to UI) as
>     select * from Party_Role where role_Type_Id LIKE  'Ê%'
> And no result will be returned when OOTB there is  6 <PartyRole partyId="***" roleTypeId="CARRIER"/> entities
>
> The solution is to keep the SQL expression string from the context at the top of the EntitySQLProcessor.groovy script and put it back in context after the request call (at bottom)
>
> Modified:
>      ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy
>
> Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy?rev=1693579&r1=1693578&r2=1693579&view=diff
> ==============================================================================
> --- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy (original)
> +++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy Fri Jul 31 11:56:58 2015
> @@ -26,6 +26,8 @@ import java.util.Iterator;
>   import org.ofbiz.entity.*;
>   import org.ofbiz.entity.model.ModelGroupReader;
>
> +sqlCommand = context.request.getParameter("sqlCommand");
> +
>   resultMessage = "";
>   rs = null;
>   columns = [];
> @@ -74,3 +76,4 @@ context.groups = groups;
>   context.resultMessage = resultMessage;
>   context.columns = columns;
>   context.records = records;
> +context.sqlCommand = sqlCommand; // (see OFBIZ-6567)
>
>

Re: svn commit: r1693579 - /ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/Enti tySQLProcessor.groovy

Posted by Jacques Le Roux <ja...@les7arts.com>.
I'm not changing it, it's only a peculiar case. It was too long too explain there and not everybody knows how to trace back a line to its commit. So 
in such cases, I sometimes put the Jira number for a better developer experience.

Jacques

Le 01/08/2015 17:40, Adrian Crum a écrit :
> Nonsense. All you have to do is put
>
> (see OFBIZ-6567)
>
> in the commit log instead of in the code.
>
> This is what we have done for years and I don't understand why you are changing it.
>
> Adrian Crum
> Sandglass Software
> www.sandglass-software.com
>
> On 8/1/2015 3:29 AM, Jacques Le Roux wrote:
>> Because it's not clear why this is done there and it was too long to
>> explain in a comment.
>>
>> Jacques
>>
>> Le 31/07/2015 14:27, Adrian Crum a écrit :
>>> Why are we putting Jira issue numbers in code comments? It was my
>>> understanding that this type of meta-data belongs in the commit message.
>>>
>>> Adrian Crum
>>> Sandglass Software
>>> www.sandglass-software.com
>>>
>>> On 7/31/2015 4:56 AM, jleroux@apache.org wrote:
>>>> Author: jleroux
>>>> Date: Fri Jul 31 11:56:58 2015
>>>> New Revision: 1693579
>>>>
>>>> URL: http://svn.apache.org/r1693579
>>>> Log:
>>>> A solution from Gareth Carter for "Wrong percent encoding in
>>>> Webtool/SQL Processor" https://issues.apache.org/jira/browse/OFBIZ-6567
>>>>
>>>> This was reported by Gareth Carter;
>>>>
>>>> If for instance you use this SQL expression
>>>>      select * from Party_Role where role_Type_Id LIKE '%CA%'
>>>> It will be interpreted (and returned to UI) as
>>>>     select * from Party_Role where role_Type_Id LIKE  'Ê%'
>>>> And no result will be returned when OOTB there is  6 <PartyRole
>>>> partyId="***" roleTypeId="CARRIER"/> entities
>>>>
>>>> The solution is to keep the SQL expression string from the context at
>>>> the top of the EntitySQLProcessor.groovy script and put it back in
>>>> context after the request call (at bottom)
>>>>
>>>> Modified:
>>>> ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy
>>>>
>>>>
>>>> Modified:
>>>> ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy
>>>>
>>>> URL:
>>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy?rev=1693579&r1=1693578&r2=1693579&view=diff 
>>>>
>>>>
>>>> ==============================================================================
>>>>
>>>> ---
>>>> ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy
>>>> (original)
>>>> +++
>>>> ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy
>>>> Fri Jul 31 11:56:58 2015
>>>> @@ -26,6 +26,8 @@ import java.util.Iterator;
>>>>   import org.ofbiz.entity.*;
>>>>   import org.ofbiz.entity.model.ModelGroupReader;
>>>>
>>>> +sqlCommand = context.request.getParameter("sqlCommand");
>>>> +
>>>>   resultMessage = "";
>>>>   rs = null;
>>>>   columns = [];
>>>> @@ -74,3 +76,4 @@ context.groups = groups;
>>>>   context.resultMessage = resultMessage;
>>>>   context.columns = columns;
>>>>   context.records = records;
>>>> +context.sqlCommand = sqlCommand; // (see OFBIZ-6567)
>>>>
>>>>
>>>
>

Re: svn commit: r1693579 - /ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/Enti tySQLProcessor.groovy

Posted by Adrian Crum <ad...@sandglass-software.com>.
Nonsense. All you have to do is put

(see OFBIZ-6567)

in the commit log instead of in the code.

This is what we have done for years and I don't understand why you are 
changing it.

Adrian Crum
Sandglass Software
www.sandglass-software.com

On 8/1/2015 3:29 AM, Jacques Le Roux wrote:
> Because it's not clear why this is done there and it was too long to
> explain in a comment.
>
> Jacques
>
> Le 31/07/2015 14:27, Adrian Crum a écrit :
>> Why are we putting Jira issue numbers in code comments? It was my
>> understanding that this type of meta-data belongs in the commit message.
>>
>> Adrian Crum
>> Sandglass Software
>> www.sandglass-software.com
>>
>> On 7/31/2015 4:56 AM, jleroux@apache.org wrote:
>>> Author: jleroux
>>> Date: Fri Jul 31 11:56:58 2015
>>> New Revision: 1693579
>>>
>>> URL: http://svn.apache.org/r1693579
>>> Log:
>>> A solution from Gareth Carter for "Wrong percent encoding in
>>> Webtool/SQL Processor" https://issues.apache.org/jira/browse/OFBIZ-6567
>>>
>>> This was reported by Gareth Carter;
>>>
>>> If for instance you use this SQL expression
>>>      select * from Party_Role where role_Type_Id LIKE  '%CA%'
>>> It will be interpreted (and returned to UI) as
>>>     select * from Party_Role where role_Type_Id LIKE  'Ê%'
>>> And no result will be returned when OOTB there is  6 <PartyRole
>>> partyId="***" roleTypeId="CARRIER"/> entities
>>>
>>> The solution is to keep the SQL expression string from the context at
>>> the top of the EntitySQLProcessor.groovy script and put it back in
>>> context after the request call (at bottom)
>>>
>>> Modified:
>>> ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy
>>>
>>>
>>> Modified:
>>> ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy
>>>
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy?rev=1693579&r1=1693578&r2=1693579&view=diff
>>>
>>> ==============================================================================
>>>
>>> ---
>>> ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy
>>> (original)
>>> +++
>>> ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy
>>> Fri Jul 31 11:56:58 2015
>>> @@ -26,6 +26,8 @@ import java.util.Iterator;
>>>   import org.ofbiz.entity.*;
>>>   import org.ofbiz.entity.model.ModelGroupReader;
>>>
>>> +sqlCommand = context.request.getParameter("sqlCommand");
>>> +
>>>   resultMessage = "";
>>>   rs = null;
>>>   columns = [];
>>> @@ -74,3 +76,4 @@ context.groups = groups;
>>>   context.resultMessage = resultMessage;
>>>   context.columns = columns;
>>>   context.records = records;
>>> +context.sqlCommand = sqlCommand; // (see OFBIZ-6567)
>>>
>>>
>>

Re: svn commit: r1693579 - /ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/Enti tySQLProcessor.groovy

Posted by Jacques Le Roux <ja...@les7arts.com>.
Because it's not clear why this is done there and it was too long to explain in a comment.

Jacques

Le 31/07/2015 14:27, Adrian Crum a écrit :
> Why are we putting Jira issue numbers in code comments? It was my understanding that this type of meta-data belongs in the commit message.
>
> Adrian Crum
> Sandglass Software
> www.sandglass-software.com
>
> On 7/31/2015 4:56 AM, jleroux@apache.org wrote:
>> Author: jleroux
>> Date: Fri Jul 31 11:56:58 2015
>> New Revision: 1693579
>>
>> URL: http://svn.apache.org/r1693579
>> Log:
>> A solution from Gareth Carter for "Wrong percent encoding in Webtool/SQL Processor" https://issues.apache.org/jira/browse/OFBIZ-6567
>>
>> This was reported by Gareth Carter;
>>
>> If for instance you use this SQL expression
>>      select * from Party_Role where role_Type_Id LIKE  '%CA%'
>> It will be interpreted (and returned to UI) as
>>     select * from Party_Role where role_Type_Id LIKE  'Ê%'
>> And no result will be returned when OOTB there is  6 <PartyRole partyId="***" roleTypeId="CARRIER"/> entities
>>
>> The solution is to keep the SQL expression string from the context at the top of the EntitySQLProcessor.groovy script and put it back in context 
>> after the request call (at bottom)
>>
>> Modified:
>> ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy
>>
>> Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy
>> URL: 
>> http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy?rev=1693579&r1=1693578&r2=1693579&view=diff
>> ==============================================================================
>> --- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy (original)
>> +++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/entity/EntitySQLProcessor.groovy Fri Jul 31 11:56:58 2015
>> @@ -26,6 +26,8 @@ import java.util.Iterator;
>>   import org.ofbiz.entity.*;
>>   import org.ofbiz.entity.model.ModelGroupReader;
>>
>> +sqlCommand = context.request.getParameter("sqlCommand");
>> +
>>   resultMessage = "";
>>   rs = null;
>>   columns = [];
>> @@ -74,3 +76,4 @@ context.groups = groups;
>>   context.resultMessage = resultMessage;
>>   context.columns = columns;
>>   context.records = records;
>> +context.sqlCommand = sqlCommand; // (see OFBIZ-6567)
>>
>>
>