ModeShape does not offer a way to obtain a JCR Session connected to a remote JCR repository. It's been on the roadmap for a long time, but the level of effort of implementing this has simply been too high. Many (most?) of the JCR API features are very difficult to make work over a remote connection. The result would be that we'd likely have to maintain a long list of which methods worked remotely and which didn't.
So for ModeShape, Sessions can only be used locally within the ModeShape cluster. Remote processes can interact with ModeShape through our provided RESTful service, WebDAV, JDBC (just for JCR-SQL2 queries, and no create, update or delete statements), or via your own custom web service that exposes exactly the methods/operations/procedures that you need.
Ok, what I really need is to create a repository that is accessible for WebDAV-clients. That is why I wanted to connect to the remote repository, since it's WebDAV accessible.
The goal is to create repository that manageable via a web ui, the repository will mainly contain documents. Most of those documents will, if possible, enter the repository via WebDAV.
This section: ModeShape in web applications - ModeShape 3 - Project Documentation Editor, describe how I can solve half the equation. I'm having trouble figuring out the WebDAV part.
First of all, have you tried using our existing WebDAV service? It already works, and is simply a web application that runs in the same process as ModeShape, but allows remote clients to read/write content over WebDAV.
If it does not suit your needs, then we'd be interested in hearing why it does not. There are always options to expand our functionality, and that's something that could be done by you so the rest of the community can benefit. But if the changes you would make are not general purpose, then we still might have the option of making our WebDAV service such that you can provide custom extensions.
Implementing a new WebDAV service is always an option, but as you can see by ours its fairly complex. It'd be a shame if you had to start over from scratch.