Author: buildbot Date: Tue Feb 19 04:42:35 2013 New Revision: 851099 Log: Staging update by buildbot for sling
Modified: websites/staging/sling/trunk/content/ (props changed) websites/staging/sling/trunk/content/site/content-loading-jcrcontentloader.html Propchange: websites/staging/sling/trunk/content/ ------------------------------------------------------------------------------ --- cms:source-revision (original) +++ cms:source-revision Tue Feb 19 04:42:35 2013 @@ -1 +1 @@ -1447159 +1447587 Modified: websites/staging/sling/trunk/content/site/content-loading-jcrcontentloader.html ============================================================================== --- websites/staging/sling/trunk/content/site/content-loading-jcrcontentloader.html (original) +++ websites/staging/sling/trunk/content/site/content-loading-jcrcontentloader.html Tue Feb 19 04:42:35 2013 @@ -1,4 +1,3 @@ - <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML> <HEAD> @@ -296,58 +295,27 @@ primary node type "nt:file". U <H3><A name="ContentLoading%28jcr.contentloader%29-JSONDescriptorFiles"></A>JSON Descriptor Files</H3> -<P>Nodes, Properties and in fact complete subtrees may be described in JSON files using the following skeleton structure (see <A href="http://www.json.org/" class="external-link" rel="nofollow">http://www.json.org</A> or information on the syntax of JSON) :</P> +<P>Nodes, Properties and in fact complete subtrees may be described in JSON files using the following skeleton structure (see <A href="http://www.json.org/" class="external-link" rel="nofollow">http://www.json.org</A> or information on the syntax of JSON). +The name of parent node is taken from the file name. :</P> <DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent"> <PRE class="code-java"> { - <SPAN class="code-comment">// optional node name on top level, <SPAN class="code-keyword">default</SPAN> is file name without .json ext. -</SPAN> <SPAN class="code-quote">"name"</SPAN>: <SPAN class="code-quote">"nodename"</SPAN>, - - <SPAN class="code-comment">// optional primary node type, <SPAN class="code-keyword">default</SPAN> <SPAN class="code-quote">"nt:unstructured"</SPAN> -</SPAN> <SPAN class="code-quote">"primaryNodeType"</SPAN>: <SPAN class="code-quote">"sling:ScriptedComponent"</SPAN>, - - <SPAN class="code-comment">// optional mixin node types as array -</SPAN> <SPAN class="code-quote">"mixinNodeTypes"</SPAN>: [ ], - - <SPAN class="code-comment">// the <SPAN class="code-quote">"properties"</SPAN> property is an object indexed by property name whose -</SPAN> <SPAN class="code-comment">// value is either the string property value, array <SPAN class="code-keyword">for</SPAN> multi-values or -</SPAN> <SPAN class="code-comment">// an object whose value[s] property denotes the property value(s) and -</SPAN> <SPAN class="code-comment">// whose type property denotes the property type -</SPAN> <SPAN class="code-quote">"properties"</SPAN>: { - <SPAN class="code-quote">"sling:contentClass"</SPAN>: <SPAN class="code-quote">"com.day.sling.jcr.test.Test"</SPAN>, - <SPAN class="code-quote">"sampleMulti"</SPAN>: [ <SPAN class="code-quote">"v1"</SPAN>, <SPAN class="code-quote">"v2"</SPAN> ], - <SPAN class="code-quote">"sampleStruct"</SPAN>: { - <SPAN class="code-quote">"value"</SPAN>: 1, - <SPAN class="code-quote">"type"</SPAN>: <SPAN class="code-quote">"<SPAN class="code-object">Long</SPAN>"</SPAN> - } - <SPAN class="code-quote">"sampleStructMulti"</SPAN>: { - <SPAN class="code-quote">"value"</SPAN>: [ 1, 2, 3 ], - <SPAN class="code-quote">"type"</SPAN>: <SPAN class="code-quote">"<SPAN class="code-object">Long</SPAN>"</SPAN> - } - }, - - <SPAN class="code-comment">// the <SPAN class="code-quote">"nodes"</SPAN> property is an array of objects denoting child nodes. Nodes -</SPAN> <SPAN class="code-comment">// may be further nested. -</SPAN> <SPAN class="code-quote">"nodes"</SPAN>: [ - { - <SPAN class="code-comment">// the name property is required on (nested) child nodes -</SPAN> <SPAN class="code-quote">"name"</SPAN>: <SPAN class="code-quote">"sling:scripts"</SPAN>, - - <SPAN class="code-quote">"primaryNodeType"</SPAN>: <SPAN class="code-quote">"sling:ScriptList"</SPAN>, - - <SPAN class="code-quote">"nodes"</SPAN>: [ - { - <SPAN class="code-quote">"primaryNodeType"</SPAN>: <SPAN class="code-quote">"sling:Script"</SPAN>, - <SPAN class="code-quote">"properties"</SPAN>: { - <SPAN class="code-quote">"sling:name"</SPAN>: <SPAN class="code-quote">"/test/content/jsp/start.jsp"</SPAN>, - <SPAN class="code-quote">"sling:type"</SPAN>: <SPAN class="code-quote">"jsp"</SPAN>, - <SPAN class="code-quote">"sling:glob"</SPAN>: <SPAN class="code-quote">"*"</SPAN> - } - } - ] - } - ] - } + <SPAN class="code-comment">// Properties are represented as json properties</SPAN> + "jcr:createdBy":"admin", + "jcr:primaryType":"nt:folder", + <SPAN class="code-comment">// Child nodes are named json Objects. This will create a node named "childOne" </SPAN> + "nodeName": { + "jcr:primaryType": "nt:unstructured", + "jcr:mixinTypes": [ + "mix:referenceable" + ], + "propOne" : "propOneValue", + + "childOne" : { + "childPropOne" : true + } + } +} </PRE> </DIV></DIV>