Hi Ole, On Tue, Sep 3, 2013 at 10:07 PM, Ole Ersoy <[email protected]> wrote: > ...hopefully it's possible to do something like this: > > curl -u admin:admin -F"sling:resourceType=foo/bar" > -F"jcr:primaryType":"foo:bar" -F"title=some title" > http://localhost:8080/content/mynode
Yes that would work, assuming you have registered the foo namespace and bar nodetype before. This can be done with cnd files embedded in bundles, see the jcr/resource bundle for example. > > So now mynode would be of type foo:bar and would contain the default content > in the content property that I would have specified... Default content specified in the node type? Yes that should work, and this as well: > <div id="content"><%= currentNode.content %></div> > ...Incidentally I'd like to have a simple way of defining new node types like > foo:bar with custom content on them. If this already exists, super! If not > I'd like to contribute if the community is interested.... So your only use of those node types is the default content? Not sure if it's worth the effort of defining all those node types, and if it's just static default content it can also be injected at rendering time. For example by calling adaptTo to transform your content into higher-level objects that provide the default content. http://wiki.apache.org/jackrabbit/DavidsModel has a good explanation of the general view on node types here - we usually use them as little as possible. -Bertrand
