Gavin Cornwell created CMIS-928:
-----------------------------------

             Summary: Inconsistent date formats used in AtomPub binding
                 Key: CMIS-928
                 URL: https://issues.apache.org/jira/browse/CMIS-928
             Project: Chemistry
          Issue Type: Bug
          Components: opencmis-server
    Affects Versions: OpenCMIS 1.0.0
            Reporter: Gavin Cornwell
            Priority: Minor


The date format used is different in a children response compared to a type 
definition response.

When requesting a type, "cmis:document" for example the following date format 
is used:

{code}
  ...
  <app:edited>Tue, 30 Jun 2015 10:22:34 GMT</app:edited>
  <atom:updated>Tue, 30 Jun 2015 10:22:34 GMT</atom:updated>
  ...
{code}

whereas the children response is:
{code}
  ...
  <app:edited>2015-03-31T17:11:26.813+01:00</app:edited>
  <atom:updated>2015-03-31T17:11:26.813+01:00</atom:updated>
  ...
{code}

According to the AtomPub spec (https://tools.ietf.org/html/rfc4287#section-3.3) 
the format seen in the children response is correct.

This is a result of some date handling changes made for the 0.9.0 release 
(r1454377) in AtomDocumentBase.java. The {{writeUpdated(long updated)}} method 
is converting the time in millis to a HTTP formatted date whereas 
{{writeUpdated(GregorianCalendar updated)}} defers to {{XMLUtils.write}} which 
converts the date to an XML date (as expected).

I think the solution is to change {{writeUpdated(long updated)}} and 
{{writePublished(long published)}} to call 
{{DateTimeHelper.formatXmlDateTime}}. I have attached a patch with these 
changes.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to