incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Sling > Sling Initial Content Loader - JSON Descriptor Files
Date Wed, 25 Nov 2009 00:31:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=SLING&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="http://cwiki.apache.org/confluence/display/SLING/Sling+Initial+Content+Loader+-+JSON+Descriptor+Files">Sling
Initial Content Loader - JSON Descriptor Files</a></h2>
    <h4>Page  <b>added</b> by             <a href="http://cwiki.apache.org/confluence/display/~sadhakim">Hakim
Sadikali</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h3><a name="SlingInitialContentLoader-JSONDescriptorFiles-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/" rel="nofollow">http://www.json.org</a>
or information on the syntax of JSON) :</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">{

	<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">// create properties like you would any other property within
the repository
</span>	<span class="code-quote">"property1"</span>  : <span class="code-quote">"myproperty"</span>,

	<span class="code-comment">// To create multi value properties use
</span>	<span class="code-comment">// Property types are best guesses based on
the content they contain
</span>	<span class="code-quote">"property2"</span> : [<span class="code-quote">"value1"</span>,
<span class="code-quote">"value2"</span>]

	<span class="code-comment">// To create sub nodes, make json objects
</span>	<span class="code-quote">"childNode"</span> : {

		<span class="code-comment">//All the same config as the parent node are availble to
the childe node, <span class="code-keyword">for</span> example you can set the
primary type
</span>		<span class="code-quote">"primaryNodeyType"</span> : <span class="code-quote">"nt:folder"</span>

	}


}
</pre>
</div></div>
    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>
       <a href="http://cwiki.apache.org/confluence/display/SLING/Sling+Initial+Content+Loader+-+JSON+Descriptor+Files">View
Online</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/SLING/Sling+Initial+Content+Loader+-+JSON+Descriptor+Files?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message