|
Replies:
3
-
Last Post:
Mar 31, 2008 7:58 PM
by: kaplanj
|
|
|
|
|
|
|
Wonderland module questions
Posted:
Mar 18, 2008 12:30 PM
|
|
|
Hi!
I have two questions concerning the wonderland modules.
First, what's the difference between the modules directory in the lg3d-wonderland code base and the wonderland-modules project? As far as I have seen, they contain distinct modules, but the modules itself are structured in the same way. Is it anticipated to move all the modules to the wonderland-modules project?
Second, what exactly can modules be used for? Most of the modules are related to additional widgets for use within the 3D Virtual World. These modules also have a certain directory structure (client, common, server) - does this structure have to be followed in general? If want to write some custom functionality, is it a good idea to put the code into a module? If so, how can the principal structure for a module (build files) be created? Copy it from another module and adapt it to your needs?
thanks, iS
|
|
|
|
|
|
|
Re: Wonderland module questions
Posted:
Mar 18, 2008 12:38 PM
in response to: iseidel
|
|
|
Good questions!
On Mar 18, 2008, at 12:30 PM, wonderland@javadesktop.org wrote: > > First, what's the difference between the modules directory in the > lg3d-wonderland code base and the wonderland-modules project? As > far as I have seen, they contain distinct modules, but the modules > itself are structured in the same way. Is it anticipated to move > all the modules to the wonderland-modules project?
Modules are extensions to Wonderland. Originally, all modules were in lg3d-wonderland/modules but as we developed more modules we realized that we needed a way to distinguish core modules from non-core modules. We also wanted a place for developers to create Wonderland extensions with licenses that might not be compatible with Wonderland. That's why we have wonderland-modules. We're actually in the process of further modularizing Wonderland, and you'll see that in the 0.5 re-architecture. We want to make the Wonderland core quite extensible, so that new functionality can be integrated dynamically, perhaps even at run-time. There are some rough notes on what we're thinking here:
http://docs.google.com/View?docid=ajdd3hhvtszh_10gtw7s6fn
> Second, what exactly can modules be used for? Most of the modules > are related to additional widgets for use within the 3D Virtual > World. These modules also have a certain directory structure > (client, common, server) - does this structure have to be followed > in general? If want to write some custom functionality, is it a > good idea to put the code into a module? If so, how can the > principal structure for a module (build files) be created? Copy it > from another module and adapt it to your needs?
Most of the modules in the wonderland-modules are 2D and 3D applications. These are non-core extensions to Wonderland. We'll be adding more modules to this project over time.
The wonderland-modules directory structure is important. The build scripts will automatically build and package any module with this directory structure. The client/server/common split is deliberate. Most applications will have client and server components as well as common classes which both the client and server need (such as message) classes.
The best way to get started developing an application module is to clone one of the existing modules. The pdfviewer in wonderland- modules might be a good starting point for a 2D application.
|
|
|
|
|
|
|
|
Re: Wonderland module questions
Posted:
Mar 31, 2008 11:16 AM
in response to: Nigel Simpson
|
|
|
Great, thanks for the elaborate answer.
I am still unsure whether it is a good idea to use the modules space for non visual enhancements. In my case I want to write a small communication adapter such that the Wonderland server can receive and send JSON messages. I do use a custom package structure com.mycompany.communication. Would it be a good idea to write this functionality in a module? I have been trying to write it as a module but was not able to integrate it correctly - when I build the wonderland project, the classes under com.mycompany.communication are not found. Do the wonderland build files have to be modified? Is it actually intended that code in a module gets directly called from the wonderland project, or should they always be included via wfs files?
|
|
|
|
|
|
|
|
Re: Wonderland module questions
Posted:
Mar 31, 2008 7:58 PM
in response to: iseidel
|
|
|
Currently, the Wonderland module system is designed to support new cell types loaded from WFS. There is no way right now for the core Wonderland code to use module code other than in custom cells, so you will have to modify the core of Wonderland to do what you are suggesting.
Given you are extending the Wonderland server, which is based on Project Darkstar, it might be worth looking into structuring your add-on as a Darkstar service. Darkstar has a built-in mechanism for plugging in new services, such as our Wonderland voice service. These services are isolated from the rest of the system, but can be accessed using AppContext.getManager() from anywhere in the Wonderland server. If you structure your plugin this way, most of the code will be in the Darkstar service, and it should only require minimal changes to the core of Wonderland to access these services.
|
|
|
|
|