Skip to content

A Sample module that connects to an external web service (REST) to register users in a database

Notifications You must be signed in to change notification settings

josmas/OWL_REST_sample_module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

------------------------
-- REST module sample --
------------------------

This is a sample Open Wonderland module that displays a cell. On right-click it displays
a 'register' option that when selected, it registers the user against an external
webservice that follows a REST interface.

Please note that you will have to provide that webservice!

----------------------------------------------
Classpaths and expected structure for Netbeans
----------------------------------------------

This module will need little modifications if it is downloaded (or cloned) in a structure 
that resembles the following 'my-own-wonderland-modules' directory.  Please note that for 
module development, the sources of Open Wonderland have to be available locally.

If you have your Wonderland sources in your user directory, the expected structure should
look like:

~/wonderland
	| [loads of stuff here]

~/wonderland-modules
	|
	--> stable
	|	| [modules here]
	|
	--> unstable
		| [modules here]

~/my-own-wonderland-modules
	|
	--> unstable
		|
		--> rest-module-sample

If you drop the module in that last directory (or a similar strucutre but with your own names)
then all the classpaths should be ready to go. If not, follow the instructions in the tutorial
to change your settings for Netbeans.

Link to the tutorial: http://faithhold.dyndns.org:8080/JSPWiki/Wiki.jsp?page=REST%20client%20sample%20module

-----------------------
The external webservice
-----------------------
The URL at which the webservice is running has to be configured in the Bundle file.
It should not really be there but I don't have a 'big enough' need for a properties file right now,
so it's ok there for now.

------------------------------
The internal webservice Client
------------------------------
This module was conceived to try and demonstrate the facilities that Open Wonderland provides to connect to
external resources. The REST realted client code is the simplest solution I could find so it does not
interfere with the understanding (and simplicity) of the module.

In the following blog post, this code is categorised as 'Raw Data Communication':
http://www.jroller.com/Solomon/entry/java_restful_clients_and_jax
A lot more can be done with the code, and as the post suggests, JAXB2 could be a great alternative in this 
case because it is already used in Wonderland. Feel free to expand the example as you think fits.

-----------------------------------------
Cleaning up git references after cloning
-----------------------------------------
If you have cloned this project, you will want to clean up the remote references to the original git project.
To do so just delete the .git folder. You can also delete the .gitigore file if you are not going to be using 
git. After cleaning these files up, you can initialise your own git repo if you want to do so (git init).


____
TODO
----
Testing is unfinished, but the module should deploy normally and connect to the service provided (by you!)

Jos (Feb 2011)

About

A Sample module that connects to an external web service (REST) to register users in a database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages