When you create a node via the REST service, if you don't specify a primary type, it will default to "nt:unstructured". If you want any other type, you must explicitly add it to the JSON request.
See REST Service 3.x - ModeShape 3 - Project Documentation Editor for an example.
Thanks for pointing out, however I don't actually create a Node object,
I simply do a 'publish' of the file the jcr via the JsonRestClient API.
I don't see an option to set the primary type. Should I be publishing artifacts to jcr in a different manner?
The RestClient was never meant for these kinds of usage. It has extremely limited purposes (mainly used from JBoss Developer Studio via the JBoss Integration Tools stack).
It will become deprecated in 3.8.1 and has been removed altogether from ModeShape 4.
So if you plan on inserting data into ModeShape 3.x using one of the services, I'd suggest you use the REST Service.
Just noticed that
have been removed in Modeshape 4.0
But modeshape-web-jcr-rest is still available.
Any reason for this?
Does this mean - Clients can't access Modeshape via HTTP using a API? starting from 4.0, or can this still be achieved with modeshape-web-jcr-rest?
If yes - can you pls point me to some test classes.
modeshape-web-jcr-rest is the implementation of the REST service (server). Its documentation is the one from the link I posted previously and you interact with it via HTTP requests containing JSON bodies.
There is no dedicated Java client API atm
Instead, you interact with a ModeShape server using one of the following:
- REST service (RW)
- WebDAV service (RW but limited to files & folders only)
- CMIS (RW)
- JDBC (R)