2009/6/5 alloyer <[email protected]>: > > 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 ?
I've never yet managed to figure that out! :) We're just grabbing the Route definitions from the CamelContext and turning them to XML with JAXB - no idea why they get mangled! The code that turns them to XML is RouteResource.getRouteXml() and the RouteDefinition is extracted from the CamelContext by the RoutesResource class in getRoute(String id). We should maybe dump more of the RouteDefinitions to XML from the test cases in org.apache.camel.processor in camel-core to see if its a common issue; the AST of the routes is being mangled somehow? > 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? We're just using Bespin https://bespin.mozilla.com/ ideally, Bespin would be available as a tarball then we'd not need to shove a ton of JS files in our source tree and at build time we could just include Bespin inside the web app - or even load Bespin remotely from the web maybe (though that would not work too well in places where folks lock down the internet). Basically Bespin should pretty much be a black box - we shouldn't need to touch it; other than the link to the JS code in the RouteResource/edit.jsp template which AFAIK is the only place any of Bespin (or all that JS) is used - other than the JS used in the template (decorators/main.jsp) which is mostly just used for table sorting. -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://fusesource.com/
