Formatting controllers

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

Formatting controllers

Jacques Le Roux
Administrator
Hi devs,

I often found myself in difficulties when reading controllers files.

I would like to format them all as it's done on the attached example controller.patch, but the view-maps which I would prefer to keep on one line.

Opinions ?

Thanks

Jacques
Reply | Threaded
Open this post in threaded view
|

Re: Formatting controllers

hans_bakker
sounds fine to me....

On Thu, 2009-11-19 at 05:14 -0800, Jacques Le Roux wrote:

> Hi devs,
>
> I often found myself in difficulties when reading controllers files.
>
> I would like to format them all as it's done on the attached example
> http://n4.nabble.com/file/n623986/controller.patch controller.patch , but
> the view-maps which I would prefer to keep on one line.
>
> Opinions ?
>
> Thanks
>
> Jacques
--
Antwebsystems.com: Quality OFBiz services for competitive rates

Reply | Threaded
Open this post in threaded view
|

Re: Formatting controllers

Ashish Vijaywargiya
In reply to this post by Jacques Le Roux
Hello Jacques,

The following changes are good:
-    <request-map uri="FindSubscriptionResource"><security https="true"
auth="true"/><response name="success" type="view"
value="FindSubscriptionResource"/></request-map>
-    <request-map uri="EditSubscriptionResource"><security https="true"
auth="true"/><response name="success" type="view"
value="EditSubscriptionResource"/></request-map>
+    <request-map uri="FindSubscriptionResource">
+        <security https="true" auth="true"/>
+        <response name="success" type="view"
value="FindSubscriptionResource"/>
+    </request-map>
+    <request-map uri="EditSubscriptionResource">
+        <security https="true" auth="true"/>
+        <response name="success" type="view"
value="EditSubscriptionResource"/>
+    </request-map>

*But* I don't like the changes for moving "invoke" attribute to the new
line:

-        <event type="java" path="org.ofbiz.product.product.ProductEvents"
invoke="updateProductQuickAdminShipping"/>
+        <event type="java" path="org.ofbiz.product.product.ProductEvents"
+            invoke="updateProductQuickAdminShipping"/>

And for view map entries - +1.


--
Ashish


On Thu, Nov 19, 2009 at 6:44 PM, Jacques Le Roux <
[hidden email]> wrote:

>
> Hi devs,
>
> I often found myself in difficulties when reading controllers files.
>
> I would like to format them all as it's done on the attached example
> http://n4.nabble.com/file/n623986/controller.patch controller.patch , but
> the view-maps which I would prefer to keep on one line.
>
> Opinions ?
>
> Thanks
>
> Jacques
> --
> View this message in context:
> http://n4.nabble.com/Formatting-controllers-tp623986p623986.html
> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Formatting controllers

Jacques Le Roux
Administrator
Thanks Ashish, Hans,

Yes I agree on the invoke part. I will see how to handle all this gloabaly (using regexp I guess)

Jacques

From: "Ashish Vijaywargiya" <[hidden email]>

> Hello Jacques,
>
> The following changes are good:
> -    <request-map uri="FindSubscriptionResource"><security https="true"
> auth="true"/><response name="success" type="view"
> value="FindSubscriptionResource"/></request-map>
> -    <request-map uri="EditSubscriptionResource"><security https="true"
> auth="true"/><response name="success" type="view"
> value="EditSubscriptionResource"/></request-map>
> +    <request-map uri="FindSubscriptionResource">
> +        <security https="true" auth="true"/>
> +        <response name="success" type="view"
> value="FindSubscriptionResource"/>
> +    </request-map>
> +    <request-map uri="EditSubscriptionResource">
> +        <security https="true" auth="true"/>
> +        <response name="success" type="view"
> value="EditSubscriptionResource"/>
> +    </request-map>
>
> *But* I don't like the changes for moving "invoke" attribute to the new
> line:
>
> -        <event type="java" path="org.ofbiz.product.product.ProductEvents"
> invoke="updateProductQuickAdminShipping"/>
> +        <event type="java" path="org.ofbiz.product.product.ProductEvents"
> +            invoke="updateProductQuickAdminShipping"/>
>
> And for view map entries - +1.
>
>
> --
> Ashish
>
>
> On Thu, Nov 19, 2009 at 6:44 PM, Jacques Le Roux <
> [hidden email]> wrote:
>
>>
>> Hi devs,
>>
>> I often found myself in difficulties when reading controllers files.
>>
>> I would like to format them all as it's done on the attached example
>> http://n4.nabble.com/file/n623986/controller.patch controller.patch , but
>> the view-maps which I would prefer to keep on one line.
>>
>> Opinions ?
>>
>> Thanks
>>
>> Jacques
>> --
>> View this message in context:
>> http://n4.nabble.com/Formatting-controllers-tp623986p623986.html
>> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Formatting controllers

David E. Jones-2
In reply to this post by Ashish Vijaywargiya

On Nov 19, 2009, at 6:46 AM, Ashish Vijaywargiya wrote:

> Hello Jacques,
>
> The following changes are good:
> -    <request-map uri="FindSubscriptionResource"><security  
> https="true"
> auth="true"/><response name="success" type="view"
> value="FindSubscriptionResource"/></request-map>
> -    <request-map uri="EditSubscriptionResource"><security  
> https="true"
> auth="true"/><response name="success" type="view"
> value="EditSubscriptionResource"/></request-map>
> +    <request-map uri="FindSubscriptionResource">
> +        <security https="true" auth="true"/>
> +        <response name="success" type="view"
> value="FindSubscriptionResource"/>
> +    </request-map>
> +    <request-map uri="EditSubscriptionResource">
> +        <security https="true" auth="true"/>
> +        <response name="success" type="view"
> value="EditSubscriptionResource"/>
> +    </request-map>

I disagree. That change turns one line into four, and the pattern for  
those entries is generally consistent enough that reading beyond the  
first 50 characters or so it totally redundant information.

-David




>
> *But* I don't like the changes for moving "invoke" attribute to the  
> new
> line:
>
> -        <event type="java"  
> path="org.ofbiz.product.product.ProductEvents"
> invoke="updateProductQuickAdminShipping"/>
> +        <event type="java"  
> path="org.ofbiz.product.product.ProductEvents"
> +            invoke="updateProductQuickAdminShipping"/>
>
> And for view map entries - +1.
>
>
> --
> Ashish
>
>
> On Thu, Nov 19, 2009 at 6:44 PM, Jacques Le Roux <
> [hidden email]> wrote:
>
>>
>> Hi devs,
>>
>> I often found myself in difficulties when reading controllers files.
>>
>> I would like to format them all as it's done on the attached example
>> http://n4.nabble.com/file/n623986/controller.patch 
>> controller.patch , but
>> the view-maps which I would prefer to keep on one line.
>>
>> Opinions ?
>>
>> Thanks
>>
>> Jacques
>> --
>> View this message in context:
>> http://n4.nabble.com/Formatting-controllers-tp623986p623986.html
>> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>>

Reply | Threaded
Open this post in threaded view
|

Re: Formatting controllers

Tim Ruppert
"consistent enough" is tough when it slips thru the crack and it's not  
always consistent.  I have to admit to liking it being explicit - but  
it's really trivial enough to go either way.  Some people put the  
bracket on the same line - some the next.  You really just have to  
pick a guideline and stick to it as far as I'm concerned.

Cheers,
Ruppert

On Nov 19, 2009, at 11:44 PM, David E Jones wrote:

>
> On Nov 19, 2009, at 6:46 AM, Ashish Vijaywargiya wrote:
>
>> Hello Jacques,
>>
>> The following changes are good:
>> -    <request-map uri="FindSubscriptionResource"><security  
>> https="true"
>> auth="true"/><response name="success" type="view"
>> value="FindSubscriptionResource"/></request-map>
>> -    <request-map uri="EditSubscriptionResource"><security  
>> https="true"
>> auth="true"/><response name="success" type="view"
>> value="EditSubscriptionResource"/></request-map>
>> +    <request-map uri="FindSubscriptionResource">
>> +        <security https="true" auth="true"/>
>> +        <response name="success" type="view"
>> value="FindSubscriptionResource"/>
>> +    </request-map>
>> +    <request-map uri="EditSubscriptionResource">
>> +        <security https="true" auth="true"/>
>> +        <response name="success" type="view"
>> value="EditSubscriptionResource"/>
>> +    </request-map>
>
> I disagree. That change turns one line into four, and the pattern  
> for those entries is generally consistent enough that reading beyond  
> the first 50 characters or so it totally redundant information.
>
> -David
>
>
>
>
>>
>> *But* I don't like the changes for moving "invoke" attribute to the  
>> new
>> line:
>>
>> -        <event type="java"  
>> path="org.ofbiz.product.product.ProductEvents"
>> invoke="updateProductQuickAdminShipping"/>
>> +        <event type="java"  
>> path="org.ofbiz.product.product.ProductEvents"
>> +            invoke="updateProductQuickAdminShipping"/>
>>
>> And for view map entries - +1.
>>
>>
>> --
>> Ashish
>>
>>
>> On Thu, Nov 19, 2009 at 6:44 PM, Jacques Le Roux <
>> [hidden email]> wrote:
>>
>>>
>>> Hi devs,
>>>
>>> I often found myself in difficulties when reading controllers files.
>>>
>>> I would like to format them all as it's done on the attached example
>>> http://n4.nabble.com/file/n623986/controller.patch 
>>> controller.patch , but
>>> the view-maps which I would prefer to keep on one line.
>>>
>>> Opinions ?
>>>
>>> Thanks
>>>
>>> Jacques
>>> --
>>> View this message in context:
>>> http://n4.nabble.com/Formatting-controllers-tp623986p623986.html
>>> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>>>
>


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

Re: Formatting controllers

Jacques Le Roux
Administrator
Thanks David, Tim,

Yes, actually I'd like to have them consistent.
Not for the sake of consistency but because it's easier to read when there is a sole pattern used.
Your eyes don't have to adapt from a line to the other, less eyeballs work.
And I find it easier to not have all on one line.

This said, I was expecting to use Oxygen in Eclipse to format blocks, but this seems not possible, I found only Ctrl+Shft+F which
formats all the file
Using regexp is then the solution but much more harder and risky...

I will see, I have some issues with Oxygen and it's hard to get them fixed.
You have to make a lot of exchange and to explain all things wich much much details.
To such an extent that the work is almost done...

I'm good to find frustration :/

Jacques

From: "Tim Ruppert" <[hidden email]>

> "consistent enough" is tough when it slips thru the crack and it's not  always consistent.  I have to admit to liking it being
> explicit - but  it's really trivial enough to go either way.  Some people put the  bracket on the same line - some the next.  You
> really just have to  pick a guideline and stick to it as far as I'm concerned.
>
> Cheers,
> Ruppert
>
> On Nov 19, 2009, at 11:44 PM, David E Jones wrote:
>
>>
>> On Nov 19, 2009, at 6:46 AM, Ashish Vijaywargiya wrote:
>>
>>> Hello Jacques,
>>>
>>> The following changes are good:
>>> -    <request-map uri="FindSubscriptionResource"><security  https="true"
>>> auth="true"/><response name="success" type="view"
>>> value="FindSubscriptionResource"/></request-map>
>>> -    <request-map uri="EditSubscriptionResource"><security  https="true"
>>> auth="true"/><response name="success" type="view"
>>> value="EditSubscriptionResource"/></request-map>
>>> +    <request-map uri="FindSubscriptionResource">
>>> +        <security https="true" auth="true"/>
>>> +        <response name="success" type="view"
>>> value="FindSubscriptionResource"/>
>>> +    </request-map>
>>> +    <request-map uri="EditSubscriptionResource">
>>> +        <security https="true" auth="true"/>
>>> +        <response name="success" type="view"
>>> value="EditSubscriptionResource"/>
>>> +    </request-map>
>>
>> I disagree. That change turns one line into four, and the pattern  for those entries is generally consistent enough that reading
>> beyond  the first 50 characters or so it totally redundant information.
>>
>> -David
>>
>>
>>
>>
>>>
>>> *But* I don't like the changes for moving "invoke" attribute to the  new
>>> line:
>>>
>>> -        <event type="java"  path="org.ofbiz.product.product.ProductEvents"
>>> invoke="updateProductQuickAdminShipping"/>
>>> +        <event type="java"  path="org.ofbiz.product.product.ProductEvents"
>>> +            invoke="updateProductQuickAdminShipping"/>
>>>
>>> And for view map entries - +1.
>>>
>>>
>>> --
>>> Ashish
>>>
>>>
>>> On Thu, Nov 19, 2009 at 6:44 PM, Jacques Le Roux <
>>> [hidden email]> wrote:
>>>
>>>>
>>>> Hi devs,
>>>>
>>>> I often found myself in difficulties when reading controllers files.
>>>>
>>>> I would like to format them all as it's done on the attached example
>>>> http://n4.nabble.com/file/n623986/controller.patch  controller.patch , but
>>>> the view-maps which I would prefer to keep on one line.
>>>>
>>>> Opinions ?
>>>>
>>>> Thanks
>>>>
>>>> Jacques
>>>> --
>>>> View this message in context:
>>>> http://n4.nabble.com/Formatting-controllers-tp623986p623986.html
>>>> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>>>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Formatting controllers

Jacopo Cappellato-4
Would it make sense to make optional/implicit all the request-map entries that are associated to a view-map entry with the same name and don't trigger any event?
For all of these entries the view-map could be enough (but we have to provide a default value for the https and auth attributes).

Jacopo


On Nov 20, 2009, at 10:19 AM, Jacques Le Roux wrote:

> Thanks David, Tim,
>
> Yes, actually I'd like to have them consistent.
> Not for the sake of consistency but because it's easier to read when there is a sole pattern used.
> Your eyes don't have to adapt from a line to the other, less eyeballs work.
> And I find it easier to not have all on one line.
>
> This said, I was expecting to use Oxygen in Eclipse to format blocks, but this seems not possible, I found only Ctrl+Shft+F which formats all the file
> Using regexp is then the solution but much more harder and risky...
>
> I will see, I have some issues with Oxygen and it's hard to get them fixed.
> You have to make a lot of exchange and to explain all things wich much much details.
> To such an extent that the work is almost done...
>
> I'm good to find frustration :/
>
> Jacques
>
> From: "Tim Ruppert" <[hidden email]>
>> "consistent enough" is tough when it slips thru the crack and it's not  always consistent.  I have to admit to liking it being explicit - but  it's really trivial enough to go either way.  Some people put the  bracket on the same line - some the next.  You really just have to  pick a guideline and stick to it as far as I'm concerned.
>>
>> Cheers,
>> Ruppert
>>
>> On Nov 19, 2009, at 11:44 PM, David E Jones wrote:
>>
>>>
>>> On Nov 19, 2009, at 6:46 AM, Ashish Vijaywargiya wrote:
>>>
>>>> Hello Jacques,
>>>>
>>>> The following changes are good:
>>>> -    <request-map uri="FindSubscriptionResource"><security  https="true"
>>>> auth="true"/><response name="success" type="view"
>>>> value="FindSubscriptionResource"/></request-map>
>>>> -    <request-map uri="EditSubscriptionResource"><security  https="true"
>>>> auth="true"/><response name="success" type="view"
>>>> value="EditSubscriptionResource"/></request-map>
>>>> +    <request-map uri="FindSubscriptionResource">
>>>> +        <security https="true" auth="true"/>
>>>> +        <response name="success" type="view"
>>>> value="FindSubscriptionResource"/>
>>>> +    </request-map>
>>>> +    <request-map uri="EditSubscriptionResource">
>>>> +        <security https="true" auth="true"/>
>>>> +        <response name="success" type="view"
>>>> value="EditSubscriptionResource"/>
>>>> +    </request-map>
>>>
>>> I disagree. That change turns one line into four, and the pattern  for those entries is generally consistent enough that reading beyond  the first 50 characters or so it totally redundant information.
>>>
>>> -David
>>>
>>>
>>>
>>>
>>>>
>>>> *But* I don't like the changes for moving "invoke" attribute to the  new
>>>> line:
>>>>
>>>> -        <event type="java"  path="org.ofbiz.product.product.ProductEvents"
>>>> invoke="updateProductQuickAdminShipping"/>
>>>> +        <event type="java"  path="org.ofbiz.product.product.ProductEvents"
>>>> +            invoke="updateProductQuickAdminShipping"/>
>>>>
>>>> And for view map entries - +1.
>>>>
>>>>
>>>> --
>>>> Ashish
>>>>
>>>>
>>>> On Thu, Nov 19, 2009 at 6:44 PM, Jacques Le Roux <
>>>> [hidden email]> wrote:
>>>>
>>>>>
>>>>> Hi devs,
>>>>>
>>>>> I often found myself in difficulties when reading controllers files.
>>>>>
>>>>> I would like to format them all as it's done on the attached example
>>>>> http://n4.nabble.com/file/n623986/controller.patch  controller.patch , but
>>>>> the view-maps which I would prefer to keep on one line.
>>>>>
>>>>> Opinions ?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Jacques
>>>>> --
>>>>> View this message in context:
>>>>> http://n4.nabble.com/Formatting-controllers-tp623986p623986.html
>>>>> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>>>>>
>>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Formatting controllers

Jacques Le Roux
Administrator
In reply to this post by Jacques Le Roux
Oxygen users,

From: "Jacques Le Roux" <[hidden email]>
> This said, I was expecting to use Oxygen in Eclipse to format blocks, but this seems not possible, I found only Ctrl+Shft+F which
> formats all the file

I found the reason. I was using the action [Format and Indent Element which is available on the contextual menu -> Source submenu]
yesterday night (and forgot to say it) but found it formats and indents all even if you have selected only a line.
I just retried and the behavior above is only true if you select the EOL (I use it often as it's easier to Copy/Paste). So format
and indent works only if you do not select the EOL of the block you are working on

Jacques


Reply | Threaded
Open this post in threaded view
|

Re: Formatting controllers

Jacques Le Roux
Administrator
In reply to this post by Jacopo Cappellato-4
This sounds like an interesting idea indeed

Jacques

From: "Jacopo Cappellato" <[hidden email]>

> Would it make sense to make optional/implicit all the request-map entries that are associated to a view-map entry with the same
> name and don't trigger any event?
> For all of these entries the view-map could be enough (but we have to provide a default value for the https and auth attributes).
>
> Jacopo
>
>
> On Nov 20, 2009, at 10:19 AM, Jacques Le Roux wrote:
>
>> Thanks David, Tim,
>>
>> Yes, actually I'd like to have them consistent.
>> Not for the sake of consistency but because it's easier to read when there is a sole pattern used.
>> Your eyes don't have to adapt from a line to the other, less eyeballs work.
>> And I find it easier to not have all on one line.
>>
>> This said, I was expecting to use Oxygen in Eclipse to format blocks, but this seems not possible, I found only Ctrl+Shft+F which
>> formats all the file
>> Using regexp is then the solution but much more harder and risky...
>>
>> I will see, I have some issues with Oxygen and it's hard to get them fixed.
>> You have to make a lot of exchange and to explain all things wich much much details.
>> To such an extent that the work is almost done...
>>
>> I'm good to find frustration :/
>>
>> Jacques
>>
>> From: "Tim Ruppert" <[hidden email]>
>>> "consistent enough" is tough when it slips thru the crack and it's not  always consistent.  I have to admit to liking it being
>>> explicit - but  it's really trivial enough to go either way.  Some people put the  bracket on the same line - some the next.
>>> You really just have to  pick a guideline and stick to it as far as I'm concerned.
>>>
>>> Cheers,
>>> Ruppert
>>>
>>> On Nov 19, 2009, at 11:44 PM, David E Jones wrote:
>>>
>>>>
>>>> On Nov 19, 2009, at 6:46 AM, Ashish Vijaywargiya wrote:
>>>>
>>>>> Hello Jacques,
>>>>>
>>>>> The following changes are good:
>>>>> -    <request-map uri="FindSubscriptionResource"><security  https="true"
>>>>> auth="true"/><response name="success" type="view"
>>>>> value="FindSubscriptionResource"/></request-map>
>>>>> -    <request-map uri="EditSubscriptionResource"><security  https="true"
>>>>> auth="true"/><response name="success" type="view"
>>>>> value="EditSubscriptionResource"/></request-map>
>>>>> +    <request-map uri="FindSubscriptionResource">
>>>>> +        <security https="true" auth="true"/>
>>>>> +        <response name="success" type="view"
>>>>> value="FindSubscriptionResource"/>
>>>>> +    </request-map>
>>>>> +    <request-map uri="EditSubscriptionResource">
>>>>> +        <security https="true" auth="true"/>
>>>>> +        <response name="success" type="view"
>>>>> value="EditSubscriptionResource"/>
>>>>> +    </request-map>
>>>>
>>>> I disagree. That change turns one line into four, and the pattern  for those entries is generally consistent enough that
>>>> reading beyond  the first 50 characters or so it totally redundant information.
>>>>
>>>> -David
>>>>
>>>>
>>>>
>>>>
>>>>>
>>>>> *But* I don't like the changes for moving "invoke" attribute to the  new
>>>>> line:
>>>>>
>>>>> -        <event type="java"  path="org.ofbiz.product.product.ProductEvents"
>>>>> invoke="updateProductQuickAdminShipping"/>
>>>>> +        <event type="java"  path="org.ofbiz.product.product.ProductEvents"
>>>>> +            invoke="updateProductQuickAdminShipping"/>
>>>>>
>>>>> And for view map entries - +1.
>>>>>
>>>>>
>>>>> --
>>>>> Ashish
>>>>>
>>>>>
>>>>> On Thu, Nov 19, 2009 at 6:44 PM, Jacques Le Roux <
>>>>> [hidden email]> wrote:
>>>>>
>>>>>>
>>>>>> Hi devs,
>>>>>>
>>>>>> I often found myself in difficulties when reading controllers files.
>>>>>>
>>>>>> I would like to format them all as it's done on the attached example
>>>>>> http://n4.nabble.com/file/n623986/controller.patch  controller.patch , but
>>>>>> the view-maps which I would prefer to keep on one line.
>>>>>>
>>>>>> Opinions ?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Jacques
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://n4.nabble.com/Formatting-controllers-tp623986p623986.html
>>>>>> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>>>>>>
>>>>
>>>
>>
>>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Formatting controllers

Adrian Crum
In reply to this post by Jacques Le Roux
Don't forget the framework includes code to read and write XML files,
and you can specify the indentation level.

-Adrian

Jacques Le Roux wrote:

> Thanks David, Tim,
>
> Yes, actually I'd like to have them consistent.
> Not for the sake of consistency but because it's easier to read when
> there is a sole pattern used.
> Your eyes don't have to adapt from a line to the other, less eyeballs work.
> And I find it easier to not have all on one line.
>
> This said, I was expecting to use Oxygen in Eclipse to format blocks,
> but this seems not possible, I found only Ctrl+Shft+F which formats all
> the file
> Using regexp is then the solution but much more harder and risky...
>
> I will see, I have some issues with Oxygen and it's hard to get them fixed.
> You have to make a lot of exchange and to explain all things wich much
> much details.
> To such an extent that the work is almost done...
>
> I'm good to find frustration :/
>
> Jacques
>
> From: "Tim Ruppert" <[hidden email]>
>> "consistent enough" is tough when it slips thru the crack and it's
>> not  always consistent.  I have to admit to liking it being explicit -
>> but  it's really trivial enough to go either way.  Some people put
>> the  bracket on the same line - some the next.  You really just have
>> to  pick a guideline and stick to it as far as I'm concerned.
>>
>> Cheers,
>> Ruppert
>>
>> On Nov 19, 2009, at 11:44 PM, David E Jones wrote:
>>
>>>
>>> On Nov 19, 2009, at 6:46 AM, Ashish Vijaywargiya wrote:
>>>
>>>> Hello Jacques,
>>>>
>>>> The following changes are good:
>>>> -    <request-map uri="FindSubscriptionResource"><security  
>>>> https="true"
>>>> auth="true"/><response name="success" type="view"
>>>> value="FindSubscriptionResource"/></request-map>
>>>> -    <request-map uri="EditSubscriptionResource"><security  
>>>> https="true"
>>>> auth="true"/><response name="success" type="view"
>>>> value="EditSubscriptionResource"/></request-map>
>>>> +    <request-map uri="FindSubscriptionResource">
>>>> +        <security https="true" auth="true"/>
>>>> +        <response name="success" type="view"
>>>> value="FindSubscriptionResource"/>
>>>> +    </request-map>
>>>> +    <request-map uri="EditSubscriptionResource">
>>>> +        <security https="true" auth="true"/>
>>>> +        <response name="success" type="view"
>>>> value="EditSubscriptionResource"/>
>>>> +    </request-map>
>>>
>>> I disagree. That change turns one line into four, and the pattern  
>>> for those entries is generally consistent enough that reading beyond  
>>> the first 50 characters or so it totally redundant information.
>>>
>>> -David
>>>
>>>
>>>
>>>
>>>>
>>>> *But* I don't like the changes for moving "invoke" attribute to the  
>>>> new
>>>> line:
>>>>
>>>> -        <event type="java"  
>>>> path="org.ofbiz.product.product.ProductEvents"
>>>> invoke="updateProductQuickAdminShipping"/>
>>>> +        <event type="java"  
>>>> path="org.ofbiz.product.product.ProductEvents"
>>>> +            invoke="updateProductQuickAdminShipping"/>
>>>>
>>>> And for view map entries - +1.
>>>>
>>>>
>>>> --
>>>> Ashish
>>>>
>>>>
>>>> On Thu, Nov 19, 2009 at 6:44 PM, Jacques Le Roux <
>>>> [hidden email]> wrote:
>>>>
>>>>>
>>>>> Hi devs,
>>>>>
>>>>> I often found myself in difficulties when reading controllers files.
>>>>>
>>>>> I would like to format them all as it's done on the attached example
>>>>> http://n4.nabble.com/file/n623986/controller.patch 
>>>>> controller.patch , but
>>>>> the view-maps which I would prefer to keep on one line.
>>>>>
>>>>> Opinions ?
>>>>>
>>>>> Thanks
>>>>>
>>>>> Jacques
>>>>> --
>>>>> View this message in context:
>>>>> http://n4.nabble.com/Formatting-controllers-tp623986p623986.html
>>>>> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>>>>>
>>>
>>
>>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Formatting controllers

Jacques Le Roux
Administrator
Do you mean I could even easily format with this code ?
Like what I did in http://svn.apache.org/viewvc?rev=882536&view=rev

Jacques

From: "Adrian Crum" <[hidden email]>

> Don't forget the framework includes code to read and write XML files,
> and you can specify the indentation level.
>
> -Adrian
>
> Jacques Le Roux wrote:
>> Thanks David, Tim,
>>
>> Yes, actually I'd like to have them consistent.
>> Not for the sake of consistency but because it's easier to read when
>> there is a sole pattern used.
>> Your eyes don't have to adapt from a line to the other, less eyeballs work.
>> And I find it easier to not have all on one line.
>>
>> This said, I was expecting to use Oxygen in Eclipse to format blocks,
>> but this seems not possible, I found only Ctrl+Shft+F which formats all
>> the file
>> Using regexp is then the solution but much more harder and risky...
>>
>> I will see, I have some issues with Oxygen and it's hard to get them fixed.
>> You have to make a lot of exchange and to explain all things wich much
>> much details.
>> To such an extent that the work is almost done...
>>
>> I'm good to find frustration :/
>>
>> Jacques
>>
>> From: "Tim Ruppert" <[hidden email]>
>>> "consistent enough" is tough when it slips thru the crack and it's
>>> not  always consistent.  I have to admit to liking it being explicit -
>>> but  it's really trivial enough to go either way.  Some people put
>>> the  bracket on the same line - some the next.  You really just have
>>> to  pick a guideline and stick to it as far as I'm concerned.
>>>
>>> Cheers,
>>> Ruppert
>>>
>>> On Nov 19, 2009, at 11:44 PM, David E Jones wrote:
>>>
>>>>
>>>> On Nov 19, 2009, at 6:46 AM, Ashish Vijaywargiya wrote:
>>>>
>>>>> Hello Jacques,
>>>>>
>>>>> The following changes are good:
>>>>> -    <request-map uri="FindSubscriptionResource"><security  
>>>>> https="true"
>>>>> auth="true"/><response name="success" type="view"
>>>>> value="FindSubscriptionResource"/></request-map>
>>>>> -    <request-map uri="EditSubscriptionResource"><security  
>>>>> https="true"
>>>>> auth="true"/><response name="success" type="view"
>>>>> value="EditSubscriptionResource"/></request-map>
>>>>> +    <request-map uri="FindSubscriptionResource">
>>>>> +        <security https="true" auth="true"/>
>>>>> +        <response name="success" type="view"
>>>>> value="FindSubscriptionResource"/>
>>>>> +    </request-map>
>>>>> +    <request-map uri="EditSubscriptionResource">
>>>>> +        <security https="true" auth="true"/>
>>>>> +        <response name="success" type="view"
>>>>> value="EditSubscriptionResource"/>
>>>>> +    </request-map>
>>>>
>>>> I disagree. That change turns one line into four, and the pattern  
>>>> for those entries is generally consistent enough that reading beyond  
>>>> the first 50 characters or so it totally redundant information.
>>>>
>>>> -David
>>>>
>>>>
>>>>
>>>>
>>>>>
>>>>> *But* I don't like the changes for moving "invoke" attribute to the  
>>>>> new
>>>>> line:
>>>>>
>>>>> -        <event type="java"  
>>>>> path="org.ofbiz.product.product.ProductEvents"
>>>>> invoke="updateProductQuickAdminShipping"/>
>>>>> +        <event type="java"  
>>>>> path="org.ofbiz.product.product.ProductEvents"
>>>>> +            invoke="updateProductQuickAdminShipping"/>
>>>>>
>>>>> And for view map entries - +1.
>>>>>
>>>>>
>>>>> --
>>>>> Ashish
>>>>>
>>>>>
>>>>> On Thu, Nov 19, 2009 at 6:44 PM, Jacques Le Roux <
>>>>> [hidden email]> wrote:
>>>>>
>>>>>>
>>>>>> Hi devs,
>>>>>>
>>>>>> I often found myself in difficulties when reading controllers files.
>>>>>>
>>>>>> I would like to format them all as it's done on the attached example
>>>>>> http://n4.nabble.com/file/n623986/controller.patch 
>>>>>> controller.patch , but
>>>>>> the view-maps which I would prefer to keep on one line.
>>>>>>
>>>>>> Opinions ?
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Jacques
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://n4.nabble.com/Formatting-controllers-tp623986p623986.html
>>>>>> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>>>>>>
>>>>
>>>
>>>
>>
>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Formatting controllers

Adrian Crum-2
Yes. Look at the Label Manager code - it outputs well-formed XML.

Some day this will be easy to do in mini-language, but it's not quite there. You can read and write XML files, but there is no way to add the Apache license header in mini-language.

-Adrian

--- On Fri, 11/20/09, Jacques Le Roux <[hidden email]> wrote:

> From: Jacques Le Roux <[hidden email]>
> Subject: Re: Formatting controllers
> To: [hidden email]
> Date: Friday, November 20, 2009, 1:36 PM
> Do you mean I could even easily
> format with this code ?
> Like what I did in http://svn.apache.org/viewvc?rev=882536&view=rev
>
> Jacques
>
> From: "Adrian Crum" <[hidden email]>
> > Don't forget the framework includes code to read and
> write XML files, and you can specify the indentation level.
> >
> > -Adrian
> >
> > Jacques Le Roux wrote:
> >> Thanks David, Tim,
> >>
> >> Yes, actually I'd like to have them consistent.
> >> Not for the sake of consistency but because it's
> easier to read when there is a sole pattern used.
> >> Your eyes don't have to adapt from a line to the
> other, less eyeballs work.
> >> And I find it easier to not have all on one line.
> >>
> >> This said, I was expecting to use Oxygen in
> Eclipse to format blocks, but this seems not possible, I
> found only Ctrl+Shft+F which formats all the file
> >> Using regexp is then the solution but much more
> harder and risky...
> >>
> >> I will see, I have some issues with Oxygen and
> it's hard to get them fixed.
> >> You have to make a lot of exchange and to explain
> all things wich much much details.
> >> To such an extent that the work is almost done...
> >>
> >> I'm good to find frustration :/
> >>
> >> Jacques
> >>
> >> From: "Tim Ruppert" <[hidden email]>
> >>> "consistent enough" is tough when it slips
> thru the crack and it's not  always consistent.  I
> have to admit to liking it being explicit - but  it's
> really trivial enough to go either way.  Some people
> put the  bracket on the same line - some the
> next.  You really just have to  pick a guideline
> and stick to it as far as I'm concerned.
> >>>
> >>> Cheers,
> >>> Ruppert
> >>>
> >>> On Nov 19, 2009, at 11:44 PM, David E Jones
> wrote:
> >>>
> >>>>
> >>>> On Nov 19, 2009, at 6:46 AM, Ashish
> Vijaywargiya wrote:
> >>>>
> >>>>> Hello Jacques,
> >>>>>
> >>>>> The following changes are good:
> >>>>> -    <request-map
> uri="FindSubscriptionResource"><security 
> https="true"
> >>>>> auth="true"/><response
> name="success" type="view"
> >>>>>
> value="FindSubscriptionResource"/></request-map>
> >>>>> -    <request-map
> uri="EditSubscriptionResource"><security 
> https="true"
> >>>>> auth="true"/><response
> name="success" type="view"
> >>>>>
> value="EditSubscriptionResource"/></request-map>
> >>>>> +    <request-map
> uri="FindSubscriptionResource">
> >>>>> +       
> <security https="true" auth="true"/>
> >>>>> +       
> <response name="success" type="view"
> >>>>> value="FindSubscriptionResource"/>
> >>>>> +    </request-map>
> >>>>> +    <request-map
> uri="EditSubscriptionResource">
> >>>>> +       
> <security https="true" auth="true"/>
> >>>>> +       
> <response name="success" type="view"
> >>>>> value="EditSubscriptionResource"/>
> >>>>> +    </request-map>
> >>>>
> >>>> I disagree. That change turns one line
> into four, and the pattern  for those entries is
> generally consistent enough that reading beyond  the
> first 50 characters or so it totally redundant information.
> >>>>
> >>>> -David
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>
> >>>>> *But* I don't like the changes for
> moving "invoke" attribute to the  new
> >>>>> line:
> >>>>>
> >>>>> -        <event
> type="java" 
> path="org.ofbiz.product.product.ProductEvents"
> >>>>>
> invoke="updateProductQuickAdminShipping"/>
> >>>>> +        <event
> type="java" 
> path="org.ofbiz.product.product.ProductEvents"
> >>>>> +         
>   invoke="updateProductQuickAdminShipping"/>
> >>>>>
> >>>>> And for view map entries - +1.
> >>>>>
> >>>>>
> >>>>> -- Ashish
> >>>>>
> >>>>>
> >>>>> On Thu, Nov 19, 2009 at 6:44 PM,
> Jacques Le Roux <
> >>>>> [hidden email]>
> wrote:
> >>>>>
> >>>>>>
> >>>>>> Hi devs,
> >>>>>>
> >>>>>> I often found myself in
> difficulties when reading controllers files.
> >>>>>>
> >>>>>> I would like to format them all as
> it's done on the attached example
> >>>>>> http://n4.nabble.com/file/n623986/controller.patch 
> controller.patch , but
> >>>>>> the view-maps which I would prefer
> to keep on one line.
> >>>>>>
> >>>>>> Opinions ?
> >>>>>>
> >>>>>> Thanks
> >>>>>>
> >>>>>> Jacques
> >>>>>> -- View this message in context:
> >>>>>> http://n4.nabble.com/Formatting-controllers-tp623986p623986.html
> >>>>>> Sent from the OFBiz - Dev mailing
> list archive at Nabble.com.
> >>>>>>
> >>>>
> >>>
> >>>
> >>
> >>
> >>
> >
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Formatting controllers

Jacques Le Roux
Administrator
Label Manager, yes ! I will have a look

Thanks Adrian,

Jacques

From: "Adrian Crum" <[hidden email]>

> Yes. Look at the Label Manager code - it outputs well-formed XML.
>
> Some day this will be easy to do in mini-language, but it's not quite there. You can read and write XML files, but there is no way
> to add the Apache license header in mini-language.
>
> -Adrian
>
> --- On Fri, 11/20/09, Jacques Le Roux <[hidden email]> wrote:
>
>> From: Jacques Le Roux <[hidden email]>
>> Subject: Re: Formatting controllers
>> To: [hidden email]
>> Date: Friday, November 20, 2009, 1:36 PM
>> Do you mean I could even easily
>> format with this code ?
>> Like what I did in http://svn.apache.org/viewvc?rev=882536&view=rev
>>
>> Jacques
>>
>> From: "Adrian Crum" <[hidden email]>
>> > Don't forget the framework includes code to read and
>> write XML files, and you can specify the indentation level.
>> >
>> > -Adrian
>> >
>> > Jacques Le Roux wrote:
>> >> Thanks David, Tim,
>> >>
>> >> Yes, actually I'd like to have them consistent.
>> >> Not for the sake of consistency but because it's
>> easier to read when there is a sole pattern used.
>> >> Your eyes don't have to adapt from a line to the
>> other, less eyeballs work.
>> >> And I find it easier to not have all on one line.
>> >>
>> >> This said, I was expecting to use Oxygen in
>> Eclipse to format blocks, but this seems not possible, I
>> found only Ctrl+Shft+F which formats all the file
>> >> Using regexp is then the solution but much more
>> harder and risky...
>> >>
>> >> I will see, I have some issues with Oxygen and
>> it's hard to get them fixed.
>> >> You have to make a lot of exchange and to explain
>> all things wich much much details.
>> >> To such an extent that the work is almost done...
>> >>
>> >> I'm good to find frustration :/
>> >>
>> >> Jacques
>> >>
>> >> From: "Tim Ruppert" <[hidden email]>
>> >>> "consistent enough" is tough when it slips
>> thru the crack and it's not always consistent. I
>> have to admit to liking it being explicit - but it's
>> really trivial enough to go either way. Some people
>> put the bracket on the same line - some the
>> next. You really just have to pick a guideline
>> and stick to it as far as I'm concerned.
>> >>>
>> >>> Cheers,
>> >>> Ruppert
>> >>>
>> >>> On Nov 19, 2009, at 11:44 PM, David E Jones
>> wrote:
>> >>>
>> >>>>
>> >>>> On Nov 19, 2009, at 6:46 AM, Ashish
>> Vijaywargiya wrote:
>> >>>>
>> >>>>> Hello Jacques,
>> >>>>>
>> >>>>> The following changes are good:
>> >>>>> - <request-map
>> uri="FindSubscriptionResource"><security
>> https="true"
>> >>>>> auth="true"/><response
>> name="success" type="view"
>> >>>>>
>> value="FindSubscriptionResource"/></request-map>
>> >>>>> - <request-map
>> uri="EditSubscriptionResource"><security
>> https="true"
>> >>>>> auth="true"/><response
>> name="success" type="view"
>> >>>>>
>> value="EditSubscriptionResource"/></request-map>
>> >>>>> + <request-map
>> uri="FindSubscriptionResource">
>> >>>>> +
>> <security https="true" auth="true"/>
>> >>>>> +
>> <response name="success" type="view"
>> >>>>> value="FindSubscriptionResource"/>
>> >>>>> + </request-map>
>> >>>>> + <request-map
>> uri="EditSubscriptionResource">
>> >>>>> +
>> <security https="true" auth="true"/>
>> >>>>> +
>> <response name="success" type="view"
>> >>>>> value="EditSubscriptionResource"/>
>> >>>>> + </request-map>
>> >>>>
>> >>>> I disagree. That change turns one line
>> into four, and the pattern for those entries is
>> generally consistent enough that reading beyond the
>> first 50 characters or so it totally redundant information.
>> >>>>
>> >>>> -David
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>>
>> >>>>> *But* I don't like the changes for
>> moving "invoke" attribute to the new
>> >>>>> line:
>> >>>>>
>> >>>>> - <event
>> type="java"
>> path="org.ofbiz.product.product.ProductEvents"
>> >>>>>
>> invoke="updateProductQuickAdminShipping"/>
>> >>>>> + <event
>> type="java"
>> path="org.ofbiz.product.product.ProductEvents"
>> >>>>> +
>> invoke="updateProductQuickAdminShipping"/>
>> >>>>>
>> >>>>> And for view map entries - +1.
>> >>>>>
>> >>>>>
>> >>>>> -- Ashish
>> >>>>>
>> >>>>>
>> >>>>> On Thu, Nov 19, 2009 at 6:44 PM,
>> Jacques Le Roux <
>> >>>>> [hidden email]>
>> wrote:
>> >>>>>
>> >>>>>>
>> >>>>>> Hi devs,
>> >>>>>>
>> >>>>>> I often found myself in
>> difficulties when reading controllers files.
>> >>>>>>
>> >>>>>> I would like to format them all as
>> it's done on the attached example
>> >>>>>> http://n4.nabble.com/file/n623986/controller.patch
>> controller.patch , but
>> >>>>>> the view-maps which I would prefer
>> to keep on one line.
>> >>>>>>
>> >>>>>> Opinions ?
>> >>>>>>
>> >>>>>> Thanks
>> >>>>>>
>> >>>>>> Jacques
>> >>>>>> -- View this message in context:
>> >>>>>> http://n4.nabble.com/Formatting-controllers-tp623986p623986.html
>> >>>>>> Sent from the OFBiz - Dev mailing
>> list archive at Nabble.com.
>> >>>>>>
>> >>>>
>> >>>
>> >>>
>> >>
>> >>
>> >>
>> >
>>
>>
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Formatting controllers

Adam Heath-2
In reply to this post by Adrian Crum-2
Adrian Crum wrote:
> Yes. Look at the Label Manager code - it outputs well-formed XML.
>
> Some day this will be easy to do in mini-language, but it's not quite there. You can read and write XML files, but there is no way to add the Apache license header in mini-language.

It's not that simple.

Files that already exist, that already have the header, should keep
the header.

New files should not have it.

The idea being that the client/user/company using ofbiz may have it's
own restrictions on the data that is created.

Besides, applying the Apache license to *data* doesn't really make sense.