[jira] Created: (OFBIZ-1127) Modify the form widget to support user locales

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

[jira] Created: (OFBIZ-1127) Modify the form widget to support user locales

Nicolas Malin (Jira)
Modify the form widget to support user locales
----------------------------------------------

                 Key: OFBIZ-1127
                 URL: https://issues.apache.org/jira/browse/OFBIZ-1127
             Project: OFBiz
          Issue Type: Improvement
          Components: framework
            Reporter: Daniel Martínez
            Priority: Minor


Modify the form widget to support user parametrized user locales. To support the local dates formats I propose a new Entity LocaleDateFormat which will used by the user to choose his preferred date/time format. This entity will have at least three columns:

- PK
- locale, a good list for this the CLDR (http://unicode.org/cldr/)
- Varchar with date format , as described in javadoc of SimpleDateFormat

Also, a parameter should be passed to the javascript calendar for it to use the correct format

--
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-1127) Modify the form widget to support user locales

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-1127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510443 ]

Adrian Crum commented on OFBIZ-1127:
------------------------------------

A couple of thoughts on this...

1. Would it be better to make this a server setting or a user setting? A server setting could be configured in general.properties or something similar. A user preference could be added to the UserLogin entity.

2. There is already a list of available locales - see UtilMisc.java in the framework/base folder. There is no need to create an entity.

3.  The java.text.DateFormat class will format a date/time string appropriate for a given locale. So, this improvement would be quite simple to implement: If the server (or user) has specified a locale-dependent date/time format, then use the DateFormat class and the user's locale to format dates/times. Else, use the descending format (yyyy-mm-dd...).


> Modify the form widget to support user locales
> ----------------------------------------------
>
>                 Key: OFBIZ-1127
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1127
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Daniel Martínez
>            Priority: Minor
>
> Modify the form widget to support user parametrized user locales. To support the local dates formats I propose a new Entity LocaleDateFormat which will used by the user to choose his preferred date/time format. This entity will have at least three columns:
> - PK
> - locale, a good list for this the CLDR (http://unicode.org/cldr/)
> - Varchar with date format , as described in javadoc of SimpleDateFormat
> Also, a parameter should be passed to the javascript calendar for it to use the correct format

--
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-1127) Modify the form widget to support user locales

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

    [ https://issues.apache.org/jira/browse/OFBIZ-1127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510485 ]

Daniel Martínez commented on OFBIZ-1127:
----------------------------------------

Thanks for your comments Adrian,

1. I think it would be better to make a user setting. This is more flexible and I believe is not much more work (i.e. adding it to the userlogin related forms and widget). Default will be the current sortable format.

2 and 3. Yes, you are right :)

Then UserLogin should be modified adding the user preference. There is another detail, date formats can be SHORT, MEDIUM and LONG. Guess it should be better to leave SHORT as default (as it is always numeric) or let the user choose?

> Modify the form widget to support user locales
> ----------------------------------------------
>
>                 Key: OFBIZ-1127
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1127
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Daniel Martínez
>            Priority: Minor
>
> Modify the form widget to support user parametrized user locales. To support the local dates formats I propose a new Entity LocaleDateFormat which will used by the user to choose his preferred date/time format. This entity will have at least three columns:
> - PK
> - locale, a good list for this the CLDR (http://unicode.org/cldr/)
> - Varchar with date format , as described in javadoc of SimpleDateFormat
> Also, a parameter should be passed to the javascript calendar for it to use the correct format

--
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-1127) Modify the form widget to support user locales

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

    [ https://issues.apache.org/jira/browse/OFBIZ-1127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510486 ]

Adrian Crum commented on OFBIZ-1127:
------------------------------------

You could run all conversions through UtilDateTime.stringToTimeStamp(...) and UtilDateTime.timeStampToString(...), or use them as a guide for your own code.


> Modify the form widget to support user locales
> ----------------------------------------------
>
>                 Key: OFBIZ-1127
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1127
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Daniel Martínez
>            Priority: Minor
>
> Modify the form widget to support user parametrized user locales. To support the local dates formats I propose a new Entity LocaleDateFormat which will used by the user to choose his preferred date/time format. This entity will have at least three columns:
> - PK
> - locale, a good list for this the CLDR (http://unicode.org/cldr/)
> - Varchar with date format , as described in javadoc of SimpleDateFormat
> Also, a parameter should be passed to the javascript calendar for it to use the correct format

--
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-1127) Modify the form widget to support user locales

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

    [ https://issues.apache.org/jira/browse/OFBIZ-1127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510617 ]

David E. Jones commented on OFBIZ-1127:
---------------------------------------

Can we close this issue? It seems pretty clear that the approach to use needs more discussion, and a Jira issue isn't the best way to handle that.

What I'm hoping to avoid is anything happening that would:

1. solve problems that don't exist
2. get in the way of solving problems that DO exist

> Modify the form widget to support user locales
> ----------------------------------------------
>
>                 Key: OFBIZ-1127
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1127
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Daniel Martínez
>            Priority: Minor
>
> Modify the form widget to support user parametrized user locales. To support the local dates formats I propose a new Entity LocaleDateFormat which will used by the user to choose his preferred date/time format. This entity will have at least three columns:
> - PK
> - locale, a good list for this the CLDR (http://unicode.org/cldr/)
> - Varchar with date format , as described in javadoc of SimpleDateFormat
> Also, a parameter should be passed to the javascript calendar for it to use the correct format

--
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-1127) Modify the form widget to support user locales

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

    [ https://issues.apache.org/jira/browse/OFBIZ-1127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510695 ]

Adrian Crum commented on OFBIZ-1127:
------------------------------------

David,

I would prefer to keep it open. You are alone in the opinion that this isn't a problem. On the contrary, the problem with the OFBiz framework assuming that the user is in the server's locale and timezone has been discussed at length and I believe the consensus is that the problem does indeed exist. Instead of wasting time and energy arguing over which place is the best forum to work out the details, I would prefer to spend that time and energy moving the poject forward.

Daniel and I are collaborating on this issue - something Jira is well suited for.  Working out implementation details in Jira has been done before - I see no reason to stop the practice now.


> Modify the form widget to support user locales
> ----------------------------------------------
>
>                 Key: OFBIZ-1127
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1127
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Daniel Martínez
>            Priority: Minor
>
> Modify the form widget to support user parametrized user locales. To support the local dates formats I propose a new Entity LocaleDateFormat which will used by the user to choose his preferred date/time format. This entity will have at least three columns:
> - PK
> - locale, a good list for this the CLDR (http://unicode.org/cldr/)
> - Varchar with date format , as described in javadoc of SimpleDateFormat
> Also, a parameter should be passed to the javascript calendar for it to use the correct format

--
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-1127) Modify the form widget to support user locales

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

    [ https://issues.apache.org/jira/browse/OFBIZ-1127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510705 ]

Daniel Martínez commented on OFBIZ-1127:
----------------------------------------

Adrian,

I was checking last trunk's code and your timezone patchs following until ObjectType.simpleTypeConvert, and I was surprised that it already took care of the locale format.

I was even more surprised to see that locale format is already accepted as input at least in the workeffort and tax authority forms (p.e. write 6/07/07 00:00:00 in my spanish locale) which is exactly what I was trying to do.

It does not work in the order creation forms (order item ship dates p.e.) though. I have not had time yet to check for the difference.

Maybe you already knew and I missed something :-P

Thanks

> Modify the form widget to support user locales
> ----------------------------------------------
>
>                 Key: OFBIZ-1127
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1127
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Daniel Martínez
>            Priority: Minor
>
> Modify the form widget to support user parametrized user locales. To support the local dates formats I propose a new Entity LocaleDateFormat which will used by the user to choose his preferred date/time format. This entity will have at least three columns:
> - PK
> - locale, a good list for this the CLDR (http://unicode.org/cldr/)
> - Varchar with date format , as described in javadoc of SimpleDateFormat
> Also, a parameter should be passed to the javascript calendar for it to use the correct format

--
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-1127) Modify the form widget to support user locales

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

    [ https://issues.apache.org/jira/browse/OFBIZ-1127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510735 ]

Daniel Martínez commented on OFBIZ-1127:
----------------------------------------

The problem with the order, p.e. with the request

setOrderCurrencyAgreementShipDates

is that it does not use a service call but a direct call to a java method:

<event type="java" path="org.ofbiz.order.shoppingcart.ShoppingCartEvents" invoke="setOrderCurrencyAgreementShipDates"/>

and so it is not wrapped as a service and doesn't use simpleTypeConvert. Searching with eclipse for <event type="java"

org.ofbiz.order.shoppingcart.ShoppingCartEvents (Order appl)
org.ofbiz.product.product.ProductSearchEvents (catalog appl)
org.ofbiz.product.product.ProductEvents (catalog appl)
org.ofbiz.manufacturing.bom.BOMHelper (manufacturing appl)
org.ofbiz.content.cms.CmsEvents (cms specialpurpose)

Also I found LoginWorker methods, org.ofbiz.webapp.event.CoreEvents, org.ofbiz.common.CommonEvents ...

The methods that use dates/times should either made aware of the locale (and the timezone) or be wrapped as services (if it is possible). This is quite a work but I will be willing to do it. WDYT?

> Modify the form widget to support user locales
> ----------------------------------------------
>
>                 Key: OFBIZ-1127
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1127
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Daniel Martínez
>            Priority: Minor
>
> Modify the form widget to support user parametrized user locales. To support the local dates formats I propose a new Entity LocaleDateFormat which will used by the user to choose his preferred date/time format. This entity will have at least three columns:
> - PK
> - locale, a good list for this the CLDR (http://unicode.org/cldr/)
> - Varchar with date format , as described in javadoc of SimpleDateFormat
> Also, a parameter should be passed to the javascript calendar for it to use the correct format

--
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-1127) Modify the form widget to support user locales

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

    [ https://issues.apache.org/jira/browse/OFBIZ-1127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510740 ]

Adrian Crum commented on OFBIZ-1127:
------------------------------------

It seems you're getting a little off track. I thought you created this issue to address how the form widget handles date/time data and user locales. Improving the services would be another issue.


> Modify the form widget to support user locales
> ----------------------------------------------
>
>                 Key: OFBIZ-1127
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1127
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Daniel Martínez
>            Priority: Minor
>
> Modify the form widget to support user parametrized user locales. To support the local dates formats I propose a new Entity LocaleDateFormat which will used by the user to choose his preferred date/time format. This entity will have at least three columns:
> - PK
> - locale, a good list for this the CLDR (http://unicode.org/cldr/)
> - Varchar with date format , as described in javadoc of SimpleDateFormat
> Also, a parameter should be passed to the javascript calendar for it to use the correct format

--
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-1127) Modify the form widget to support user locales

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

    [ https://issues.apache.org/jira/browse/OFBIZ-1127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510755 ]

Daniel Martínez commented on OFBIZ-1127:
----------------------------------------

Adrian,

Maybe you are right. I am creating now a patch for forms to display dates/times in localized format. Anyway it will not be very useful if services do not accept them

> Modify the form widget to support user locales
> ----------------------------------------------
>
>                 Key: OFBIZ-1127
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1127
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Daniel Martínez
>            Priority: Minor
>
> Modify the form widget to support user parametrized user locales. To support the local dates formats I propose a new Entity LocaleDateFormat which will used by the user to choose his preferred date/time format. This entity will have at least three columns:
> - PK
> - locale, a good list for this the CLDR (http://unicode.org/cldr/)
> - Varchar with date format , as described in javadoc of SimpleDateFormat
> Also, a parameter should be passed to the javascript calendar for it to use the correct format

--
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-1127) Modify the form widget to support user locales

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

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

Daniel Martínez updated OFBIZ-1127:
-----------------------------------

    Attachment: localedateformats1.patch

This patch modifies HtmlFormRenderer to display dates/times in localized format. It should be regarded as a test as IMO has its drawbacks:

1- Nanoseconds are lost in timestamp as SimpleDateFormat does not have support for them
2- It only works for widget forms, .ftl screens show dates in the current sortable format
3- It can cause conflicts when form and not-a-service as the java method/minilang will surely only recognize dates/times in sortable format

> Modify the form widget to support user locales
> ----------------------------------------------
>
>                 Key: OFBIZ-1127
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1127
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Daniel Martínez
>            Priority: Minor
>         Attachments: localedateformats1.patch
>
>
> Modify the form widget to support user parametrized user locales. To support the local dates formats I propose a new Entity LocaleDateFormat which will used by the user to choose his preferred date/time format. This entity will have at least three columns:
> - PK
> - locale, a good list for this the CLDR (http://unicode.org/cldr/)
> - Varchar with date format , as described in javadoc of SimpleDateFormat
> Also, a parameter should be passed to the javascript calendar for it to use the correct format

--
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-1127) Modify the form widget to support user locales

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

    [ https://issues.apache.org/jira/browse/OFBIZ-1127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510766 ]

David E. Jones commented on OFBIZ-1127:
---------------------------------------

Adrian you wrote "I would prefer to keep it open. You are alone in the opinion that this isn't a problem." However, I think I've been pretty clear that I DO agree that this is a problem and should be resolved, hence my participation in it.

Whatever the case, this issue is way too chaotic. The stuff in the original description (I believe) has been invalidated already. You yourself mentioned "getting a little off track". On the other hand you also mentioned opening this issue, so perhaps you're thinking of another one as Daniel Martinez is the one who opened this one?

Anyway, my point is for the sake of clarity and to start fresh and because the original premise of this issue has been rejected, it should be closed.

It's great that you and Daniel are working on this, but these sorts of things (low level, global changes) should be discussed in the larger group as transparently as possible, and we shouldn't be in a hurry to get a solution in place. I'm not saying this stuff is kind of a good idea, I'm saying it's the way we should always do things in OFBiz.

> Modify the form widget to support user locales
> ----------------------------------------------
>
>                 Key: OFBIZ-1127
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1127
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Daniel Martínez
>            Priority: Minor
>         Attachments: localedateformats1.patch
>
>
> Modify the form widget to support user parametrized user locales. To support the local dates formats I propose a new Entity LocaleDateFormat which will used by the user to choose his preferred date/time format. This entity will have at least three columns:
> - PK
> - locale, a good list for this the CLDR (http://unicode.org/cldr/)
> - Varchar with date format , as described in javadoc of SimpleDateFormat
> Also, a parameter should be passed to the javascript calendar for it to use the correct format

--
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-1127) Modify the form widget to support user locales

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

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

Daniel Martínez closed OFBIZ-1127.
----------------------------------

    Resolution: Later

Closing this issue due to good arguments by David E. Jones. Created a new one with a better, more general description (OFBIZ-1127)

> Modify the form widget to support user locales
> ----------------------------------------------
>
>                 Key: OFBIZ-1127
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1127
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Daniel Martínez
>            Priority: Minor
>         Attachments: localedateformats1.patch
>
>
> Modify the form widget to support user parametrized user locales. To support the local dates formats I propose a new Entity LocaleDateFormat which will used by the user to choose his preferred date/time format. This entity will have at least three columns:
> - PK
> - locale, a good list for this the CLDR (http://unicode.org/cldr/)
> - Varchar with date format , as described in javadoc of SimpleDateFormat
> Also, a parameter should be passed to the javascript calendar for it to use the correct format

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