You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Aaron Evans (JIRA)" <ji...@apache.org> on 2009/02/20 22:41:01 UTC

[jira] Created: (SHINDIG-933) JsonSerializer doesn't serialize dates as valid xs:date or xs:dateTime

JsonSerializer  doesn't serialize dates as valid xs:date or xs:dateTime 
------------------------------------------------------------------------

                 Key: SHINDIG-933
                 URL: https://issues.apache.org/jira/browse/SHINDIG-933
             Project: Shindig
          Issue Type: Bug
          Components: Java
    Affects Versions: trunk
            Reporter: Aaron Evans



Parts of the model that represent dates use java.util.Date and are serialized by the JsonSerializer by simply calling toString() on the date.  The result is that dates are serialized as invalid xs:date or xs:dateTime.

One solution would be to replace the use of Date with something like the gdata java client's DateTime so that calling toString() would produce a proper xs:date or xs:dateTime.

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


[jira] Commented: (SHINDIG-933) JsonSerializer doesn't serialize dates as valid xs:date or xs:dateTime

Posted by "Aaron Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677864#action_12677864 ] 

Aaron Evans commented on SHINDIG-933:
-------------------------------------

I'm sorry; I'm just only using the data server and this patch just fixes that component.  I don't think I'm familiar enough all the affected components to properly fix the bug.  Sorry for any confusion.

> JsonSerializer  doesn't serialize dates as valid xs:date or xs:dateTime 
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-933
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-933
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: trunk
>            Reporter: Aaron Evans
>         Attachments: fix-933-bug.patch
>
>
> Parts of the model that represent dates use java.util.Date and are serialized by the JsonSerializer by simply calling toString() on the date.  The result is that dates are serialized as invalid xs:date or xs:dateTime.
> One solution would be to replace the use of Date with something like the gdata java client's DateTime so that calling toString() would produce a proper xs:date or xs:dateTime.

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


[jira] Resolved: (SHINDIG-933) JsonSerializer doesn't serialize dates as valid xs:date or xs:dateTime

Posted by "Adam Winer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-933?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adam Winer resolved SHINDIG-933.
--------------------------------

       Resolution: Fixed
    Fix Version/s: trunk

Fixed on trunk with Aaron's patch.

Added Javascript to preserve Date parsing on the date-of-birth fields.  All other "date" fields are still strings (the old behavior);  we should probably have a separate issue to parse these to Date objects in the json API.

> JsonSerializer  doesn't serialize dates as valid xs:date or xs:dateTime 
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-933
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-933
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: trunk
>            Reporter: Aaron Evans
>            Assignee: Adam Winer
>             Fix For: trunk
>
>         Attachments: fix-933-bug.patch
>
>
> Parts of the model that represent dates use java.util.Date and are serialized by the JsonSerializer by simply calling toString() on the date.  The result is that dates are serialized as invalid xs:date or xs:dateTime.
> One solution would be to replace the use of Date with something like the gdata java client's DateTime so that calling toString() would produce a proper xs:date or xs:dateTime.

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


[jira] Assigned: (SHINDIG-933) JsonSerializer doesn't serialize dates as valid xs:date or xs:dateTime

Posted by "Adam Winer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-933?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Adam Winer reassigned SHINDIG-933:
----------------------------------

    Assignee: Adam Winer

> JsonSerializer  doesn't serialize dates as valid xs:date or xs:dateTime 
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-933
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-933
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: trunk
>            Reporter: Aaron Evans
>            Assignee: Adam Winer
>         Attachments: fix-933-bug.patch
>
>
> Parts of the model that represent dates use java.util.Date and are serialized by the JsonSerializer by simply calling toString() on the date.  The result is that dates are serialized as invalid xs:date or xs:dateTime.
> One solution would be to replace the use of Date with something like the gdata java client's DateTime so that calling toString() would produce a proper xs:date or xs:dateTime.

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


[jira] Updated: (SHINDIG-933) JsonSerializer doesn't serialize dates as valid xs:date or xs:dateTime

Posted by "Aaron Evans (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHINDIG-933?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aaron Evans updated SHINDIG-933:
--------------------------------

    Attachment: fix-933-bug.patch



I've attached a patch for 933.  I added ISO date parsing/formatting to DateUtil and renamed the existing methods to refer to rfc1123.  Interested in any feedback...

> JsonSerializer  doesn't serialize dates as valid xs:date or xs:dateTime 
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-933
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-933
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: trunk
>            Reporter: Aaron Evans
>         Attachments: fix-933-bug.patch
>
>
> Parts of the model that represent dates use java.util.Date and are serialized by the JsonSerializer by simply calling toString() on the date.  The result is that dates are serialized as invalid xs:date or xs:dateTime.
> One solution would be to replace the use of Date with something like the gdata java client's DateTime so that calling toString() would produce a proper xs:date or xs:dateTime.

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


[jira] Commented: (SHINDIG-933) JsonSerializer doesn't serialize dates as valid xs:date or xs:dateTime

Posted by "Adam Winer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12675485#action_12675485 ] 

Adam Winer commented on SHINDIG-933:
------------------------------------

I'd recommend using Joda.  java.util.Date is a badly broken class that we should move off of.

> JsonSerializer  doesn't serialize dates as valid xs:date or xs:dateTime 
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-933
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-933
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: trunk
>            Reporter: Aaron Evans
>
> Parts of the model that represent dates use java.util.Date and are serialized by the JsonSerializer by simply calling toString() on the date.  The result is that dates are serialized as invalid xs:date or xs:dateTime.
> One solution would be to replace the use of Date with something like the gdata java client's DateTime so that calling toString() would produce a proper xs:date or xs:dateTime.

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


[jira] Issue Comment Edited: (SHINDIG-933) JsonSerializer doesn't serialize dates as valid xs:date or xs:dateTime

Posted by "Aaron Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12675557#action_12675557 ] 

aarone edited comment on SHINDIG-933 at 2/21/09 5:10 AM:
--------------------------------------------------------------


I like Joda a lot but I'm not sure if we want to bind the model interfaces for to a third-party library.  There are alternatives: create an interface with an implementation class that uses Joda or create a simple xs:date(Time) class to model xs:date(Time) values.  I'm curious what anybody else thinks.

      was (Author: aarone):
    
I like Joda a lot but I'm not sure if we want to bind the model interfaces for to a third-party library.  There are alternatives: create an interface that with implementation provided using Joda or create a simple xs:date(Time) class to model xs:date(Time) values.  I'm curious what anybody else thinks.
  
> JsonSerializer  doesn't serialize dates as valid xs:date or xs:dateTime 
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-933
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-933
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: trunk
>            Reporter: Aaron Evans
>
> Parts of the model that represent dates use java.util.Date and are serialized by the JsonSerializer by simply calling toString() on the date.  The result is that dates are serialized as invalid xs:date or xs:dateTime.
> One solution would be to replace the use of Date with something like the gdata java client's DateTime so that calling toString() would produce a proper xs:date or xs:dateTime.

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


[jira] Commented: (SHINDIG-933) JsonSerializer doesn't serialize dates as valid xs:date or xs:dateTime

Posted by "Paul Lindner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677101#action_12677101 ] 

Paul Lindner commented on SHINDIG-933:
--------------------------------------

What's the impact of this patch?

Does it change json output for rpc?  If it does change the dates returned will the JS code deal with them appropriately?


> JsonSerializer  doesn't serialize dates as valid xs:date or xs:dateTime 
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-933
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-933
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: trunk
>            Reporter: Aaron Evans
>         Attachments: fix-933-bug.patch
>
>
> Parts of the model that represent dates use java.util.Date and are serialized by the JsonSerializer by simply calling toString() on the date.  The result is that dates are serialized as invalid xs:date or xs:dateTime.
> One solution would be to replace the use of Date with something like the gdata java client's DateTime so that calling toString() would produce a proper xs:date or xs:dateTime.

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


[jira] Commented: (SHINDIG-933) JsonSerializer doesn't serialize dates as valid xs:date or xs:dateTime

Posted by "Aaron Evans (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12675557#action_12675557 ] 

Aaron Evans commented on SHINDIG-933:
-------------------------------------


I like Joda a lot but I'm not sure if we want to bind the model interfaces for to a third-party library.  There are alternatives: create an interface that with implementation provided using Joda or create a simple xs:date(Time) class to model xs:date(Time) values.  I'm curious what anybody else thinks.

> JsonSerializer  doesn't serialize dates as valid xs:date or xs:dateTime 
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-933
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-933
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: trunk
>            Reporter: Aaron Evans
>
> Parts of the model that represent dates use java.util.Date and are serialized by the JsonSerializer by simply calling toString() on the date.  The result is that dates are serialized as invalid xs:date or xs:dateTime.
> One solution would be to replace the use of Date with something like the gdata java client's DateTime so that calling toString() would produce a proper xs:date or xs:dateTime.

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


[jira] Commented: (SHINDIG-933) JsonSerializer doesn't serialize dates as valid xs:date or xs:dateTime

Posted by "Paul Lindner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHINDIG-933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676052#action_12676052 ] 

Paul Lindner commented on SHINDIG-933:
--------------------------------------

An easier fix is to use something like this:


private static final String DATE_FORMAT_8601 = "yyyy-MM-dd'T'HH:mm:ss.SSSZZ";
DateFormatUtils.format(new Date(), DATE_FORMAT_8601)



> JsonSerializer  doesn't serialize dates as valid xs:date or xs:dateTime 
> ------------------------------------------------------------------------
>
>                 Key: SHINDIG-933
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-933
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: trunk
>            Reporter: Aaron Evans
>
> Parts of the model that represent dates use java.util.Date and are serialized by the JsonSerializer by simply calling toString() on the date.  The result is that dates are serialized as invalid xs:date or xs:dateTime.
> One solution would be to replace the use of Date with something like the gdata java client's DateTime so that calling toString() would produce a proper xs:date or xs:dateTime.

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