ofbiz-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Taher Alkhateeb <slidingfilame...@gmail.com>
Subject Re: svn commit: r1711019 - /ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/In voiceServices.xml
Date Sat, 31 Oct 2015 10:16:36 GMT
Hi Jacques, 

Yeah I think it would be too difficult to include prettyprinters for XML. That kind of stuff
exists mostly for programming languages. I think we need to rely on the prudence of the developers
to try to stay consistent in the coding conventions. 

To that end, our document for coding conventions here needs to be more strictly applied and
reformatted for clarity (for example a table for indentation rules on each language). In the
linux kerne l there is a perl script called checkpatch.pl which checks each submission for
coding styles. We can perhaps pull something up similar to that to enforce a coding standard
on future patches . 

My 2 cents if useful! 

Taher Alkhateeb 

----- Original Message -----

From: "Jacques Le Roux" <jacques.le.roux@les7arts.com> 
To: dev@ofbiz.apache.org 
Sent: Saturday, 31 October, 2015 12:45:28 PM 
Subject: Re: svn commit: r1711019 - /ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/In
voiceServices.xml 

To have an idea I tried this https://stackoverflow.com/questions/10813265/eclipse-how-to-format-all-xml-files-in-workspace
but it eventually failed 
Moreover the patch is insanely huge (520k lines) and that would mask a lot of real changes
in history, forget it! 

Jacques 

Le 28/10/2015 19:41, Jacques Le Roux a écrit : 
> That makes sense, notably if you want to use automatic formatting. Unfortunately my experience
with OFBiz XML files in Eclipse is rather rude from 
> this perspective :/ 
> 
> We could automatically format all XML files to have something consistent, but I'm not
sure everybody would be happy with that 
> 
> Jacques 
> 
> Le 28/10/2015 15:32, Taher Alkhateeb a écrit : 
>> Hi Jacques, 
>> 
>> I would suggest that minilang is XML first, and a programming language second. Hence,
a tag if nested inside another tag should always be indented, 
>> regardless of the fact that programming languages indent else at the same level as
if. If you want if and else to be on the same level, then they 
>> should be on the same schema hierarchy IMHO. 
>> 
>> Cheers, 
>> 
>> Taher Alkhateeb 
>> 
>> ----- Original Message ----- 
>> 
>> From: "Jacques Le Roux" <jacques.le.roux@les7arts.com> 
>> To: dev@ofbiz.apache.org 
>> Sent: Wednesday, 28 October, 2015 5:25:05 PM 
>> Subject: Re: svn commit: r1711019 - /ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/In
voiceServices.xml 
>> 
>> Hi All, 
>> 
>> I just wanted to ask you which type of indentation you prefer for <else> in
minilang. 
>> 
>> Below I changed because for me it easier to read, what do you think? 
>> 
>> Thanks 
>> 
>> Jacques 
>> 
>> 
>> Le 28/10/2015 15:13, jleroux@apache.org a écrit : 
>>> Author: jleroux 
>>> Date: Wed Oct 28 14:13:00 2015 
>>> New Revision: 1711019 
>>> 
>>> URL: http://svn.apache.org/viewvc?rev=1711019&view=rev 
>>> Log: 
>>> No functional changes: 
>>> Removes trailing blanks 
>>> Indent differently (to be discussed) 
>>> 
>>> Modified: 
>>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml

>>> 
>>> Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml

>>> URL: 
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml?rev=1711019&r1=1711018&r2=1711019&view=diff

>>> ==============================================================================

>>> --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml
(original) 
>>> +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml
Wed Oct 28 14:13:00 2015 
>>> @@ -26,9 +26,10 @@ under the License. 
>>> <entity-one entity-name="PartyAcctgPreference" value-field="partyAcctgPreference"
auto-field-map="false"> 
>>> <field-map field-name="partyId" from-field="parameters.partyId"/> 
>>> </entity-one> 
>>> - <log level="info" message="In getNextInvoiceId partyId is [${parameters.partyId}],
partyAcctgPreference: ${partyAcctgPreference}"/> 
>>> + <log level="info" message="In getNextInvoiceId partyId is [${parameters.partyId}],
partyAcctgPreference: ${partyAcctgPreference}"/> 
>>> 
>>> <if-not-empty field="partyAcctgPreference"> 
>>> + <!-- see OFBIZ-3765 beware of OFBIZ-3557 --> 
>>> <get-related-one relation-name="InvoiceCustomMethod" value-field="partyAcctgPreference"
to-value-field="customMethod"/> 
>>> <else> 
>>> <log level="warning" message="Acctg preference not defined for partyId [${parameters.partyId}]"/>

>>> @@ -37,14 +38,14 @@ under the License. 
>>> 
>>> <if-not-empty field="customMethod"> 
>>> <set field="customMethodName" from-field="customMethod.customMethodName"/>

>>> - <else><!-- retreive service from deprecated enumeration --> 
>>> - <if-compare operator="equals" value="INVSQ_ENF_SEQ" field="partyAcctgPreference.oldInvoiceSequenceEnumId">

>>> - <set field="customMethodName" value="invoiceSequenceEnforced"/> 
>>> - </if-compare> 
>>> - <if-compare operator="equals" value="INVSQ_RESTARTYR" field="partyAcctgPreference.oldInvoiceSequenceEnumId">

>>> - <set field="customMethodName" value="invoiceSequenceRestart"/> 
>>> - </if-compare> 
>>> - </else> 
>>> + <else><!-- retrieve service from deprecated enumeration see OFBIZ-3765
beware of OFBIZ-3557 --> 
>>> + <if-compare operator="equals" value="INVSQ_ENF_SEQ" field="partyAcctgPreference.oldInvoiceSequenceEnumId">

>>> + <set field="customMethodName" value="invoiceSequenceEnforced"/> 
>>> + </if-compare> 
>>> + <if-compare operator="equals" value="INVSQ_RESTARTYR" field="partyAcctgPreference.oldInvoiceSequenceEnumId">

>>> + <set field="customMethodName" value="invoiceSequenceRestart"/> 
>>> + </if-compare> 
>>> + </else> 
>>> </if-not-empty> 
>>> 
>>> <if-not-empty field="customMethodName"> 
>>> 
>>> 
>>> 
>> 
> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message