Using the webdav for ScriptingComponent
> Morris Ford writes:
> I would love to be using webdav and have been waiting for information about its readiness
> and how to utilize it for some months now. Do you have information about how to implement
> it? I would be happy to utilize it instead of a separate web server.
The webdav stuff is integrated and in regular use as part of Wonderland as part of dev5. There are lots of different ways to use it, but here are a few that might be useful to you:
1. the easiest thing for startes would be for you to use webdav to serve files in the same way you do today with jetty. If you copy files into the ~/.wonderland-server/0.5-dev/run/content directory, those files will automatically be served by the Wonderland web server from the URL http://:8080/webdav/content. You should be able to point a browser there, and also to use these URLs in your scripting tutorials.
2. rather than copying files, you can use the "official" web UI for the repository by clicking on "content repository" in the Wonderland web administration page. This may be easier for tutorial users than finding the .wonderland-server directory3. From the content repository web UI, you can upload files, create directories and so on. You can do the same from the client using the "content repository" menu item on the tools menu (it's been moving around, but it's there somewhere).
3. you can use the content repository programatically from the client. To do this, you module must depend on the contentrepo module in modules/foundation. This module includes the client classes you need to read and write content in the repository. It also lets you programatically retrieve URLs for files in the repository, so it should be compatible with your current approach. From the scripting component, you can get the repository for the current session by calling:
<br /> ContentRepository repo = ContentRepositoryRegistry.getInstance().getRepository(cell.getCellCache().getSession());<br />
From there, you will be able to use the repository API to create files (ContentResource) and directories (ContentCollection).