ghellman (1) [Avatar] Offline
#1
Roo -> Extjs frontend
I was wondering if you all had tried and had any examples of using Roo to generate all that it does - but using mostly back-end -- then using Javascript frontend in Extjs 4?

The Json data should work - but it might need some kind of wrapper...
ken.rimple (246) [Avatar] Offline
#2
Re: Roo -> Extjs frontend
> I was wondering if you all had tried and had any
> examples of using Roo to generate all that it does -
> but using mostly back-end -- then using Javascript
> frontend in Extjs 4?

No, we didn't have time in our writing schedule to dig
in to every framework, but that sounds like an interesting
combination.

> The Json data should work - but it might need some
> kind of wrapper...

If you get something working and want to share it, let
us know here on the forum and we can put a link to it
in a document on our user-contrib examples directory.
MikB (202) [Avatar] Offline
#3
Re: Roo -> Extjs frontend
If you search to springsource forum, I think you will find some other people interested in this. I am, but I'm using JQuery at the moment for my needs.
I've abandoned jspx completely in the final productions stage, though the base is built with the basic Roo-type patterns.
If we were a bigger unit I'd contemplate writing a Roo add-on for this, but the reward is very small or even negative for us at the moment.
delgad9 (45) [Avatar] Offline
#4
Re: Roo -> Extjs frontend
@MiB,

I'm glad you finally see my point...
jQuery is very-very cool isn't .

Bottom line: Open source as great-as-it-is... It has room for improvement. Specially when already sponsored open source power houses stick you their own agenda without including new emergent technologies or new players that would like to contribute in a sustainable way.

At the end market preferences would rule. Just wait to see it.

B. Roograds
jD
ken.rimple (246) [Avatar] Offline
#5
Re: Roo -> Extjs frontend
> I've abandoned jspx completely in the final
> productions stage, though the base is built with the
> basic Roo-type patterns.

I completely see this happening for some projects on Roo. I almost think that it would be better long term if they gave you a one-time forward generation of JSPs rather than JSPX files as an option. It would be very useful if they had:

web mvc setup --viewType JSP|JSPX --progressiveEnhancement true|false

If the progressiveEnhancement flag would be off, then no dojo - just a simple tag library with minimal features. And on JSP I'd just use the Spring MVC tag library directly rather than abstracting it a level.

It would be better if the web mvc module were refactored so there was a guts / core and then you could hang implementation add-ons for various configurations / view types. Such as:

addon-webmvc-base

then

addon-webmvc-jspx-dojo
addon-webmvc-jsp-dojo
addon-webmvc-jspx-jquery
addon-webmvc-jsp-jquery

You could even defer the configuration of the view layer (such as whether to use tiles or sitemesh) this way. Roo could deliver the addon-webmvc-jspx-dojo as a reference plug-in and then solicit the community to donate others.

I know this seems crazy, but then you could more easily push out ext.js, mobile with things like sencha touch, and give people a choice of view types. I find jspx very clunky and difficult to work with.

> If we were a bigger unit I'd contemplate writing a
> Roo add-on for this, but the reward is very small or
> even negative for us at the moment.

If the guts were really figured out with a base web tools services add-on, maybe this could be made more trivial. But for now, I completely agree - it would be a lot of work and may be a rat hole.
ken.rimple (246) [Avatar] Offline
#6
Re: Roo -> Extjs frontend
Also, my current obsession - a quizzo written in Roo, has taken a turn toward an all-Javascript UI. I'm using Dojo 1.7.2 with the AMD loader (since it's what I am most familiar with and I am thinking of getting server push going with Web Sockets and cometd). I smell a cometd add-on coming out of that research.

I'm blogging about it on rimple.com... It's a complete mess at the moment, but as I am giving a presentation at Philly Emerging Tech on add-on development, I need some new add-ons to exercise some of the add-on developer features.
ken.rimple (246) [Avatar] Offline
#7
Re: Roo -> Extjs frontend
> I was wondering if you all had tried and had any
> examples of using Roo to generate all that it does -
> but using mostly back-end -- then using Javascript
> frontend in Extjs 4?

So, back to your original question:

look at

github.com/krimple/quizzo - look at the controllers. I'm using JSON and @RequestBody / @ResponseBody. The views are messy in terms of organization at the moment, but take a look views/admin/moderator and views/quizzo for two all-javascript UIs.

Again, they don't work quite right yet, are ugly, and under development, but I'm using Ajax with the dojo xhr.get/put/post model to very thin Spring MVC controllers.

They are, however, functional, which means that you can lift the code/concepts and go with it. I know that I could probably convert the forms to true models and inject the models directly in the Spring MVC methods, but for now I'm doing it manually with the @RooJson generated methods for arrays of results and single results.

Hope this helps you - then you can load extjs in load-scripts.tagx and disable dojo if you want. If you look at my tiles configs in the layout and view.xml files, you'll see me nesting tiles to separate pieces of the UI as well.

>
> The Json data should work - but it might need some
> kind of wrapper...

Message was edited by:
ken.rimple
ken.rimple (246) [Avatar] Offline
#8
Re: Roo -> Extjs frontend
> The Json data should work - but it might need some
> kind of wrapper...

While I'm on the subject, I have some purely view-layer JSON objects I compose via the controllers. There is a blog post coming on that pattern at some point once quizzo is truly clean.

It's just fine to expose a bean as json without it being an entity. And maybe safer in the same way value objects are:

@RooJavaBean
@RooJson
@RooToString
public class OrderSummary {
// only the things that matter across a number of relations, even summarized.
}

That way you don't serialize the whole graph by accident, and can dig into THAT object's hierarchy since you put it together in the web tier.
MikB (202) [Avatar] Offline
#9
Re: Roo -> Extjs frontend
Ken, I agree wholeheartedly on your vision of how Roo could work with JSP and other view technologies. I'll most likely get back to this issue someplace else in the future. I'll let you know.