incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [CONF] Apache Sling > Sling Initial Content Loader - JSON Descriptor Files
Date Wed, 25 Nov 2009 00:31:00 GMT
    <base href="">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=SLING&amp;forWysiwyg=true"
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="">Sling
Initial Content Loader - JSON Descriptor Files</a></h2>
    <h4>Page  <b>added</b> by             <a href="">Hakim
    <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="" rel="nofollow"></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>


    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href=""
class="grey">Change Notification Preferences</a>
       <a href="">View
       <a href=";showCommentArea=true#addcomment">Add

View raw message