You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by fm...@apache.org on 2014/11/27 13:36:15 UTC
svn commit: r1642125 -
/sling/site/trunk/content/documentation/bundles/content-loading-jcr-contentloader.mdtext
Author: fmeschbe
Date: Thu Nov 27 12:36:14 2014
New Revision: 1642125
URL: http://svn.apache.org/r1642125
Log:
Fix JSON sample to reflect reality after switching to supporting the JSON export format with SLING-266
Modified:
sling/site/trunk/content/documentation/bundles/content-loading-jcr-contentloader.mdtext
Modified: sling/site/trunk/content/documentation/bundles/content-loading-jcr-contentloader.mdtext
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/content-loading-jcr-contentloader.mdtext?rev=1642125&r1=1642124&r2=1642125&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/bundles/content-loading-jcr-contentloader.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/content-loading-jcr-contentloader.mdtext Thu Nov 27 12:36:14 2014
@@ -158,53 +158,54 @@ The my-transform.xsl file is then respon
Nodes, Properties and in fact complete subtrees may be described in JSON files using the following skeleton structure (see [http://www.json.org](http://www.json.org) or information on the syntax of JSON) :
{
- // optional node name on top level, default is file name without .json ext.
- "name": "nodename",
+ // child node name
+ "nodename" : {
// optional primary node type, default "nt:unstructured"
- "primaryNodeType": "sling:ScriptedComponent",
+ "jcr:primaryType": "sling:ScriptedComponent",
// optional mixin node types as array
- "mixinNodeTypes": [ ],
+ "jcr:mixinTypes": [ ],
- // the "properties" property is an object indexed by property name whose
- // value is either the string property value, array for multi-values or
- // an object whose value[s] property denotes the property value(s) and
- // whose type property denotes the property type
- "properties": {
- "sling:contentClass": "com.day.sling.jcr.test.Test",
- "sampleMulti": [ "v1", "v2" ],
- "sampleStruct": {
- "value": 1,
- "type": "Long"
+ // additional properties as name value pairs.
+ // Multi-value properties are defined as JSON array.
+ // Property type is derived from the value
+
+ // String value (default)
+ "sling:contentClass": "com.day.sling.jcr.test.Test",
+
+ // Multi-value String
+ "sampleMulti": [ "v1", "v2" ],
+
+ // Long value, single and multi
+ "sampleStruct": 1,
+ "sampleStructMulti": [ 1, 2, 3 ],
+
+ // Date follows pattern yyyy-mm-ddTHH:MM:SS.sss±HH:MM
+ "sampleDate": "2014-11-27T13:26:00.000+01:00",
+
+ // JCR Node Reference with name prefix (removed to derive node name)
+ "jcr:reference:sampleRef": "386b0f48-49c3-4c58-8735-ceee6bfc1933",
+
+ // JCR Path with name prefix (removed to derive node name)
+ "jcr:path:samplePath": "/content/data",
+
+ // JCR Name with name prefix (removed to derive node name)
+ "jcr:name:sampleName": "data",
+
+ // URI with name prefix (removed to derive node name)
+ "jcr:uri:sampleUri": "http://sling.apache.org/",
+
+ // Child nodes are simple JSON objects
+ "sling:scripts": {
+ "jcr:primaryType": "sling:ScriptList",
+ "sling:Script": {
+ "jcr:primaryType": "sling:Script",
+ "sling:name": "/test/content/jsp/start.jsp",
+ "sling:type": "jsp",
+ "sling:glob": "*"
}
- "sampleStructMulti": {
- "value": [ 1, 2, 3 ],
- "type": "Long"
- }
- },
-
- // the "nodes" property is an array of objects denoting child nodes. Nodes
- // may be further nested.
- "nodes": [
- {
- // the name property is required on (nested) child nodes
- "name": "sling:scripts",
-
- "primaryNodeType": "sling:ScriptList",
-
- "nodes": [
- {
- "primaryNodeType": "sling:Script",
- "properties": {
- "sling:name": "/test/content/jsp/start.jsp",
- "sling:type": "jsp",
- "sling:glob": "*"
- }
- }
- ]
- }
- ]
+ }
}