Thanks to James.That's much helpful for my previous work, and I have read
most of the Jersey User Guide page. With Willem's help, I have built the
camel-web and the dependent modules into my workspace, it seems that I can
start my lines of code just now.
Here lists some issues I encountered:
1. I will use the same editor for Groovy route editing support. When I try
the XML editor, I found the route schema in the editor is a little different
from the usual format in route configuration file based on spring. For
instance, in configuration file, the route is as follows:
<camelContext xmlns="http://camel.apache.org/schema/spring";>
    <route>
      <description>This is an example route which you can start, stop and
modify</description>
      
      <from uri="seda:foo"/>
      <to uri="mock:results"/>
    </route>
</camelContext>
But in the editor, it appears like:
<route id="route1" xmlns:ns2="http://camel.apache.org/schema/web";
xmlns="http://camel.apache.org/schema/spring";>
    <description>This is an example route which you can start, stop and
modify</description>
    <from uri="seda:foo"/>
    <interceptor>

        <to uri="mock:results" id="to1"/>
    </interceptor>
</route>
Why are they defferent and how to do the translation ?

2. There are lots of java script in camel-web module, I want to get some
suggestion to understand or work with them. Are they from some open source
js tools?

Thanks,:jumping:



James.Strachan wrote:
> 
> Hi Xueqiang!
> 
> 2009/6/3 alloyer <allo...@gmail.com>:
>>
>> 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
> https://jersey.dev.java.net/documentation/1.1.0-ea/user-guide.html
> 
> and looking at the various examples in Jersey to get your head around
> this programming model. Its a great way to build web applications!
> https://jersey.dev.java.net/
> 
> 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...
> https://svn.apache.org/repos/asf/camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/resources/
> 
> for example here's how the endpoints are viewed and new ones posted
> https://svn.apache.org/repos/asf/camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/resources/EndpointsResource.java
> 
> which is navigated to from the root URI
> https://svn.apache.org/repos/asf/camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/resources/CamelContextResource.java
> 
> 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:
> http://camel.apache.org/web-console.html
> 
> In terms of viewing/editing routes, this is all taken care of by this
> resource...
> https://svn.apache.org/repos/asf/camel/trunk/components/camel-web/src/main/java/org/apache/camel/web/resources/RouteResource.java
> 
> 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!
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://fusesource.com/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/background-on-the-Web-Console-codebase-%28was-Re%3A--jira--Work-started%3A--%28CAMEL-1655%29-Groovy-Route-Editor-for-WebConsole-tp23847302p23883812.html
Sent from the Camel Development mailing list archive at Nabble.com.

Reply via email to