jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Bocanegra <tri...@apache.org>
Subject Re: Pushing specific nodetype in oak
Date Thu, 13 Feb 2014 18:27:22 GMT
Hi Davide,

On Thu, Feb 13, 2014 at 2:48 AM, Davide Giannella
<giannella.davide@gmail.com> wrote:
> On 13/02/2014 10:22, Davide Giannella wrote:
>> ...
>> It will fire an http servlet from which I can post JSON payload for
>> creating nodes but it manages all the nodes as String.
> Sorry my bad. Wrong information. It won't treat all the items as string
> but it doesn't consider the Date case
> https://github.com/apache/jackrabbit-oak/blob/trunk/oak-http/src/main/java/org/apache/jackrabbit/oak/http/OakServlet.java?source=c#L186

The problem is, that JSON does not really specify a date type. there
are several way to solve this.

1) invent a way to transport the desired extended type. e.g. the
@TypeHint mechanics of the sling post servlet, or include the type in
the json value or name eg:
"lastModified": "1.1.1970",
"lastModified@TypeHint": "Date",


"lastModified@Date": "1.1.1970",


"lastModified": "{Date}1.1.1970",

2) try to parse the string value into a date..and assume it's date if
parsing succeeds

3) use a nodetype with a property that is required to have a date
type, eg add a mix:LastModified to your node and then use

Regards, Toby

View raw message