2009/3/19 Juan José Vázquez Delgado <[email protected]> > > > We want to use these reserved properties (jcr:created, jcr:createdBy, etc.) > > because they are autocompleted by the SlingPostServlet and we are always to > > create content using the SlingPostServlet. > > > > How can initalize the jcr:created with a long in a json? > > I don´t know why but "jcr:created" is ignored by "JsonReader" [1]. > Anyone knows the reason? > > [1] > http://svn.apache.org/repos/asf/incubator/sling/trunk/bundles/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/readers/JsonReader.java
jcr:created is autocreated and protected by the JCR implementation, at least for all cases where it is used by built-in nodetypes such as nt:file and nt:folder (see http://www.day.com/specs/jcr/1.0/6.7.22.5_nt_hierarchyNode.html). That's why you would get an error when you try to set it. One could improve the JsonReader to check for the property definition (ie. if the property to set is protected) before setting it but I think the better solution is to not use jcr:created in custom applications. Regards, Alex -- Alexander Klimetschek [email protected]
