Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-12909

NodeVisitor value representation should return Calendar instead of a String

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Normal
    • Resolution: Unresolved
    • None
    • None
    • site-toolkit
    • None

    Description

      When Date values are returned by  org.hippoecm.hst.restapi.content.visitors.AbstractNodeVisitor#getValueRepresentation(Value), Strings are returned instead of Calendar objects. The benefit of returning Calendar instead is described by wko in the forum:

      "I think org.hippoecm.hst.restapi.content.visitors.AbstractNodeVisitor#getValueRepresentation(Value) should have handled date property in a better way.
      At the moment, the method simply converts JCR date property value to string and pushes the value to the response object.
      If it pushes a Calendar object instead (which should be an obvious choice since JCR returns Calendar object anyway), the ObjectMapper of Jackson2 could have serialized it to epoch number by default, with an option to change it by spring bean configuration to something like ISO8601 string.
      Anyway, as it's hard-coded to convert Calendar to string by default, it's almost impossible or too hard to change it at the moment.
      I would rather fix the logic of AbstractNodeVisitor#getValueRepresentation(Value) to put Calendar object, and let Jackson2 handle it in serialization."
       
      This may be a non backwards compatible change.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bleunis Bert Leunis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: