Hi,

Ian Boston schrieb:
> Felix,
> I am not absolutely certain about this but I think the description is
> not in sync with the examples.
> I tried [1] in /devwidgets.json and when accessing
> http:/..../devwidgets.html I got [2] back, indicating that the example
> files are correct but the doc is not.
> (ignore the content, I have almost certainly got it wrong at the moment)
> 
> Does that make sense, or am I doing something completely wrong ?

Sounds correct.

BTW: If you request a resource with the .json extension, you may get the
result which is valid input for the .json importer. The generic format
for JSON export is

   http://host/path.tidy.level.json

where tidy is a marker selector (you may omit it) to render the JSON
pretty printed. Otherwise it is send as a single line of text.

The level selector is an int number indicating the number of child
levels to include in the export. The special level "-1" may be used to
indicate the complete subtree (take care if using this on the root !).

And, while we are at it, there is a nice plugin for Firefox to render
JSON data in a similar way as XML: JSONView [1].

Regards
Felix

[1] https://addons.mozilla.org/de/firefox/addon/10869

> 
> Ian
> 
> [1]
> ==================================================
> {
>   "nodes":[
>      {
>         "name" : "rep:Policy",
>         "primaryNodeType" : "rep:ACL",
>         "nodes" : [
>            {
>              "name" : "grantAdmin",
>              "primaryNodeType" : "rep:grantACE",
>              "properties" : {
>                "rep:principalName" : "admin",
>                "rep:privilages" : [
>                   "jcr:all"
>                ]
>              }
>            },
>            {
>              "name" : "grantEveryone",
>              "primaryNodeType" : "rep:grantACE",
>              "properties" : {
>                "rep:principalName" : "everyone",
>                "rep:privilages" : [
>                   "jcr:read"
>                ]
>              }
>            }
>         ]
>      }
>   ]
> }
> ================================================
> 
> [2]
> ================================================
> Resource dumped by HtmlRendererServlet
> 
> Resource path: /devwidgets
> 
> Resource metadata: {sling.resolutionPath=/devwidgets,
> sling.resolutionPathInfo=.html}
> Resource properties
> nodes:
> [{"name":"rep:Policy","primaryNodeType":"rep:ACL","nodes":[{"name":"grantReadEveryone","primaryNodeType":"rep:grantACE","properties":{"rep:principalName":"admin","rep:privilages":["jcr:all"]}},{"name":"grantOwnerWrite","primaryNodeType":"rep:grantACE","properties":{"rep:principalName":"everyone","rep:privilages":["jcr:read"]}}]}]
> 
> jcr:primaryType: nt:unstructured
> ================================================
> 
> 
> On 15 May 2009, at 21:03, Felix Meschberger wrote:
> 
>> Hi Mike,
>>
>> You might want to look at the initial content of the simple-sample
>> module which you find at
>> https://svn.apache.org/repos/asf/incubator/sling/trunk/samples/simple-demo/src/main/resources/SLING-INF/content
>>
>>
>> This also contains sample_readme.txt file, which in fact contains a
>> rough description of the xml and json formats along with samples.
>>
>> HTH
>>
>> Regards
>> Felix
>>
>> Mike Müller schrieb:
>>> Hi Ian, hi Felix
>>>
>>> I would like to update the docs on the content loader feature with
>>> the JSON and XML
>>> part. Can someone send me rough information on that, so that I have
>>> the ability to
>>> extend the docs. Maybe also some longer sample file than
>>> initial-content-folder.json
>>> (with some subnodes) and also a sample xml.
>>>
>>> best regards
>>> mike
>>>
>>>> -----Ursprungliche Nachricht-----
>>>> Von: Ian Boston [mailto:ianbos...@googlemail.com]im Auftrag von Ian
>>>> Boston
>>>> Gesendet: Freitag, 15. Mai 2009 11:37
>>>> An: sling-dev@incubator.apache.org
>>>> Betreff: Re: Content Loading question.
>>>>
>>>>
>>>> Ok thanks,
>>>> I will take a look and see if I really need the manipulation of file
>>>> properties or not.
>>>> I have a feeling, not, since resource types generally refer for non
>>>> nt:file nodes.
>>>> Thanks
>>>> Ian
>>>>
>>>> On 15 May 2009, at 10:10, Felix Meschberger wrote:
>>>>
>>>>> You mean, you your initial content contains:
>>>>>
>>>>>  .../thefile.json
>>>>>  .../thefile
>>>>>
>>>>> and the thefile node should be created according to the thefile.json
>>>>> file and then the jcr:content/jcr:data should be loaded from
>>>>> thefile ? I
>>>>> don't think, that this currently works.
>>>>>
>>>>> But this would probably be a good extension like being able to load
>>>>> initial content from a single file instead of a directory
>>>> as it is the
>>>>> case now (see SLING-694 [1]).
>>>>>
>>>>> Regards
>>>>> Felix
>>>>>
>>>>> [1] https://issues.apache.org/jira/browse/SLING-694
>>>>
>>>
>>
> 
> 

Reply via email to