So I think I'm asking too specific a question. 

What I want to do is load up a resource that when viewed through webdav will be 
seen as a file with content. 

I saved a file using a text editor into the webdav system, when I browse this 
url:

http://localhost:8080/sling/content/SimpleData.xml

I get this xml:

<SimpleData jcr:primaryType="nt:file" 
jcr:created="2010-06-14T11:58:44.686-04:00" jcr:createdBy="admin">
<jcr:content jcr:primaryType="nt:resource" 
jcr:uuid="6506b4c2-ad52-4ff2-bf16-90c17311e8ad" 
jcr:data="VGVzdCBvZiBkYXRhIGluIGEgZmlsZS4g" 
jcr:lastModified="2010-06-14T11:58:44.750-04:00" jcr:lastModifiedBy="admin" 
jcr:mimeType="text/plain"/>
</SimpleData>

When I loaded a node using this curl

curl -F"sling:resourceType=foo/bar" -F"title=some title" 
http://admin:ad...@localhost:8080/sling/content/mynode

It looks like this:
<mynode jcr:primaryType="nt:unstructured" sling:resourceType="foo/bar" 
title="some title"/>


I'd like to get the XML to look like this:

<mynode jcr:primaryType="nt:file" sling:resourceType="foo/bar" title="some 
title"/>

So I tried this:

curl -F"sling:resourceType=foo/bar" -F"jcr:primaryType=Sling:file" 
-F"jcr:title=node3" http://admin:ad...@localhost:8080/sling/content/node3 > 
foo.html

but still got this:

<node3 jcr:primaryType="nt:unstructured" jcr:title="node3" 
sling:resourceType="foo/bar"/>


In each case the jcr:primaryType stayed nt:unstructured, obviously I'm missing 
some important point. 



Tony

On Jun 14, 2010, at 12:41 PM, Justin Edelson wrote:

> On 6/14/10 12:37 PM, Tony Giaccone wrote:
>> 
>> 
>> I notice when I use curl to insert a new record, it always ends up with 
>> jcr:primaryType="nt:unstructured".
>> 
>> 
>> Is it possible to set that value when using curl?
>> 
>> 
>> 
>> Tony Giaccone
> -Fjcr:primaryType=[your primary type]
> 
> i.e.
> curl -Fjcr:primaryType=sling:Folder
> http://admin:ad...@localhost:8888/test/content
> 
> mixins are the same:
> 
> curl -Fjcr:primaryType=sling:Folder -Fjcr:mixinTypes=mix:referenceable
> http://admin:ad...@localhost:8888/test/content2
> 
> Justin

Reply via email to