camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Strachan <>
Subject background on the Web Console codebase (was Re: [jira] Work started: (CAMEL-1655) Groovy Route Editor for WebConsole
Date Wed, 03 Jun 2009 08:10:56 GMT
Hi Xueqiang!

2009/6/3 alloyer <>:
> Hi All,
> I am Xueqiang Mi and alloyer is my ID on mailing list and IRC. I am a
> student of China and major in middleware technologies.
> I have been starting my work for about one week. Now I am reading the XML
> rotue editor code and try to learn a overview of the implementation of
> camel-web component.

Here's a quick overview to help you dive into the code. Its basically
written using the JAX-RS specification; I'd recommend reading the
JAX-RS specificatio, the Jersey user guide

and looking at the various examples in Jersey to get your head around
this programming model. Its a great way to build web applications!

The neat thing is a single controller implementation then works for
building RESTful services (serving up XML, JSON, text, csv, DOT files
and so forth) as well as a HTML web application too. We're using
Jersey's support for Implicit Views which basically means for a
resource bean, a JSP file is found in webapp/$className/index.jsp.

(I'm considering porting the JSP/custom tags/JSTL/SiteMesh combination
over to use Lift templates which are way simpler and cleaner - but
thats another discussion and I probably won't get around to doing it
for a while).

Most of the heavy duty work then just takes place in the resource beans...

for example here's how the endpoints are viewed and new ones posted

which is navigated to from the root URI

see the use of @Path("endpoints") etc

You can browse the API of the resource beans automatically as
described here thanks to the WADL support in Jersey:

In terms of viewing/editing routes, this is all taken care of by this

see the @POST methods. So you could start if you like diving straight
into this class and hacking it to support other languages (it kinda
assumes XML payloads currently). The method is postRouteForm() which
takes a form encoded submission and extracts the String and currently
assumes its an XML payload. So we'd need some kind of field to denote
what language the user wants the route to be expressed in etc.

I hope that helps a little! Feel free to shoot any questions you have
on the WebConsole to this list!


Open Source Integration

View raw message