Matt RaibleMatt Raible is a writer with a passion for software. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.
You searched this site for "la blue girl episodesorgasm denial web tease". 1,368 entries found.

You can also try this same search on Google.

[DJUG] Portlets and Portal Architecture with Scott Ryan

The genesis of this talk is Scott's has talked to a lot of developers about web development and most don't understand all the features you get from portal servers. A lot of developers don't know how to sell them to upper management. Typically, they're very expensive, but you get a lot of functionality and features for the price. Portal servers are not just glorified web applications.

You all know what portals are, right? Yahoo is probably the most famous. RockyMountainNews.com uses a portal server, so does Denver Post. The top commercial offerings are BEA WebLogic, IBM WebSphere, Plumtree, Vignette, ATG and Microsoft Sharepoint. The first version of WebSphere was based on Jetspeed 1 and it was a pretty bad implementation. Plumtree was bought by WebLogic and is apparently a combination of .NET and SOA. Microsoft claims they're adding more portal-like stuff, but currently it's very document-management centric (reminds me of Alfresco).

On the open source side, the players are Liferay, Jetspeed, JBoss Portal, Exo, Metadot, Plone, PHP-Nuke and Magnolia. I didn't know Magnolia was a portal server, must be a new feature. Liferay is Scott's favorite, Jetspeed is pretty good, but not much out of the box.

Portals all started because companies had disparate websites and wanted a way of combining them into a single dashboard. Pieces of a portal:

  • Single Sign-on with a unified security model.
  • Security/Administration: Portals usually have a content-management component, which allow delegated administration. It's difficult to organize this initially, because of the need to create a hierarchical organizational structure of permissions.
  • Personalization: out-of-the-box you can customize the look-n-feel. A lot of times these are driven by rules engines, particularly in the open source arena. Content can often be customized so you can add/remove items that you're interested in.
  • Content Management: always comes with a portal because a portal is usually responsible for displaying content. Some include workflow and administration features, like locking, version and administration. JSR-170 defines an interface for accessing CMS systems.
  • Collaboration: this is the hot thing this year. Forums, discussions, blogs, RSS feeds, real-time chat, etc.
  • Administration: Creation of users, groups and roles. Page and portal layouts, themes, skins and CSS. Selective rights to users to modify desktops and portal attributes.
  • Search: Federated search, content repository and meta data search. Web page, database and file system search.
  • Interaction Management: Rule-based personalization, campaign execution and management. Event and behavior tracking. Content/Product centric marketing.
  • Commerce: Catalog, shopping cart, etc.

For doing portlet development, Scott recommends using a more native technology (i.e. Struts, JSF, PHP, JSP, etc.) and enabled it as a portlet using bridges. Development interfaces are offered via the web or many commons IDEs. You will need some XML, HTML, JSP, CSS and graphics experience to totally enable a portal. Sounds similar to the stuff you need to know for Ajax, eh?

Portals require a mix of development and configuration skill sets. The mix of configuration and development is determined by the platform. Try to lean away from the proprietary features but don't run away from them. Look for pre-build portlets, themes, skins, etc.

One big gotcha of portlet development is source code management. When Scott started developing with portlets, there was no such dev/test/prod setup - vendors just expected him to modify prod. Vignette has a "car" file archive, Liferay has a "lar" archive. These files allow you to easily deploy the changes required for a portlet to work. Apparently, this is still a space that needs a lot of work to allow good source-code control and the ability to rollback updates.

When rolling out a portal for an organization, it's important to start small and build features incrementally.

At this point, my laptop died - as in it went completely black. I hit the power button and it started up again, complete with the loud "bong" for all to hear. A few seconds after restarting, it went black again, so I gave up. After Scott's talk finished, I opened up and tried again - and now it's working.

The rest of Scott's presentation was very cool - he did demos of Liferay's and WebLogic's portals. Liferay looks very cool and a lot of their features remind me of Netvibes.com.

Posted in Java at Jun 14 2006, 07:15:31 PM MDT 4 Comments

Seam 1.0

I've posted my thoughts on Seam 1.0 to my Virtuas blog. What are your thoughts?

It's great to see the release of Seam 1.0. Seam is similar to many full-stack frameworks like Rails, Rife and AppFuse in that it gives you all the pieces you'll need to build a kick-ass web application.

I've blogged my thoughts on Seam before, so there's no need to do that again. I like the idea, especially the lack of interfaces and the 3-files-for-each page idea. However, I don't know that this concept will fly with Java developers. I agree there's a need to simplify, but many of us are mesmerized by the de-coupling that Spring gives us. So now we're programming to interfaces, and every-so-often swapping implementations. I don't know that we can switch to this simpler model. And then there's the "EJB" thing. I think there will be a fair amount of developers that don't use EJB3 simply because it has the "EJB" name. The best thing the EJB Expert Group could have done for EJB3 would be to give it a new name.

The other thing I worry about with Seam is that it wasn't developed from an existing application. AFAIK, it didn't get extracted from a real-world application that had all the problems that Seam solves. I know that Gavin is a smart guy, and he's probably seen these problems in the real world, but there's nothing like developing a real-world application with a technology - and then extracting the framework from that.

In reality, I'm probably jealous. Seam has some really cool features, JBoss has done a great job of marketing it, and it seems to be a really cool way to develop applications. If I'm going to make AppFuse a direct competitor to Seam, it's gonna be quite the uphill battle.

Posted in Java at Jun 13 2006, 04:45:48 PM MDT 5 Comments

[ANN] AppFuse 1.9.2 Released

This release includes CSS Framework integration, EMMA code-coverage support and AppGen sub-package support. Thanks to the CSS Framework Design Contest Winners, Doug Hays and Mika Göckel for their help with this release.

To install and configure AppFuse for development, see the QuickStart Guide. Thanks to all the sponsors who have contributed products and free hosting to the AppFuse project.

To see how AppFuse works, please see the following demos (username: mraible, password: tomcat):

TIP: If you login as an administrator, you can change the theme by appending ?theme=themename to the URL. The default theme can be set in web/WEB-INF/web.xml.

Comments and issues can be sent to the mailing list or posted to JIRA.

NOTE: This release contains Acegi Security 1.0 RC2 rather than the recently released 1.0. This is because a couple issues were found with the 1.0 release. When Acegi Security 1.0.1 (or 1.1) is released, all AppFuse users are encouraged to upgrade.

This (hopefully) marks the last release from AppFuse 1.x. AppFuse 2.0 development should start shortly. See the roadmap for more details. I'd like to say it'll be done in the fall, but I already said it'd be done two months ago. ;-)

P.S. For those of you that won the CSS Framework Design Contest, I'll be contacting you within the week to get you your prizes.

Update: If you're building AppFuse on Linux, you should be aware of some non-English encoding issues. The solution is to add something like the following to your ~/.bashrc file.

export LC_CENGINE=en_US
export LANG=en_US
export LANGUAGE=en_US

Posted in Java at Jun 06 2006, 03:24:59 PM MDT 15 Comments

[ANN] AppFuse 1.9.2 RC1 Released

AppFuse The primary reason for this release is to integrate Mike Stenhouse's CSS Framework. Since this involves many UI changes, we're publishing a release candidate that uses Herryanto Siatono's "simplicity" theme. For the final 1.9.2 release, we hope to offer themes from all the CSS Framework Design Contest Winners.

To install and configure AppFuse for development, see the QuickStart Guide. Thanks to all the sponsors who have contributed products and free hosting to the AppFuse project.

To see how AppFuse in action, please see the following demos (username: mraible, password: tomcat):

Comments and issues can be sent to the mailing list or posted to JIRA (please use version 1.9.2). Hopefully we can release 1.9.2 final in the next week or so.

Update: I've finished a first stab at integrating the puzzlewithstyle and andreas01 themes. I've only tested these in Firefox so far, but you can see them in action on the demo site using the webwork and jsf flavors.

Update 2: 1.9.2 Final has been released.

Posted in Java at Jun 02 2006, 03:54:17 PM MDT 8 Comments

Is there a component like panelGrid that uses ul instead of table?

JSF 1.1 has a problem with JSP in that it can't bind components together when a page first loads. This is well documented in Improving JSF by Dumping JSP by Hans Bergsten.

The easy example of this problem is when you have <h:outputLabel> tags before <h:inputText> tags. The average JSF user might not notice the problem, but if you customize <h:outputLabel> to display "required field" indicators based on the "required" attribute of <h:inputText> - the issue slaps you in the face. The easy solution is to use <h:panelGrid> to layout your form data, and everything magically works. However, table-based forms are ugly and I'd much rather do pretty forms like this one.

In order to create pretty forms and get around the JSF sucks with JSP problem, I'm looking for a component similar to panelGrid - but it spits out <ul> and <li> instead of <table> and <tr>/<td>. Does anyone know of such a component? I asked this question on the MyFaces list this morning, but haven't had much luck.

I'm fully aware that Facelets (or Clay) will solve this problem. However, I'm merely trying to get AppFuse 1.9.2 released without making major changes. I suppose I could always go with ugly table-based forms, but I'd rather not.

Posted in Java at May 23 2006, 12:55:44 PM MDT 13 Comments

RE: Thoughts on the future direction of AppFuse

Sanjiv has some interesting thoughts on the future direction of AppFuse. To summarize: take on Seam head-to-head, but use Spring instead. Get rid of all the other frameworks except for JSF, Spring and Hibernate. Furthermore, focus on making Web 2.0 applications easy to create and use.

I like Sanjiv's ideas, but I'm not so hot on ditching all the other web frameworks in favor of JSF. I'm still not convinced it's the best solution for Java web development. The idea behind JSF is great, but the implementation has warts. Maybe that'll be fixed with JSF 1.2, but it will likely be quite a few months before MyFaces supports it. Yeah, I know there's the RI, but it is an RI and you remember the 1.1 version don't you? ;-)

I'd hate to give up WebWork support because I've used it on a couple of projects and really like it. Ditching Spring MVC would likely be a mistake as well since it's the most popular web framework among AppFuse users today. While I love what Tapestry brings to the table, it is harder (for the newbie) than JSF. Also, it seems to be the least-used web framework in AppFuse, which means I'm doing a lot of maintenance for no reason. AppFuse 2.0 will definitely make things simpler (JDK 5, Maven 2, standard directory layout, better IDE integration), but it will still be difficult to support 5 web frameworks and 2 persistence frameworks.

What do you think about Sanjiv's proposal? It sounds good to me. However, I'd rather see different lead developers for each framework and continue to support them all - except for Struts of course.

Posted in Java at May 22 2006, 08:16:53 PM MDT 28 Comments

JavaOne 2006 Begins

After 3 hours of sleep, I'm up bright and early - attending the JavaOne Keynote. They're still shuffling people in, and have this awesome reggae-type band jamming. They're really good - I hope they're here later this week. The wireless sucks (as usual), so I'm using bluetooth to connect. Watch this post, I'll update it as the good announcements come.

We're starting off with a 10 minute overview of the Schedule Builder and how to use it. For those sessions that are full, apparently they'll schedule a 2nd showing. Most most sessions, there's already available online in PDF. After the show, most sessions should be available online in video form. Everyone should act like a Brazilian at this conference - meet people you don't know and learn as much as you can.

Jonathan Schwartz is on stage, dressed in a suite, talking about how they're offering a now offering a "Free Kit" on their website. Apparently, you can now get their Niagra servers for free. Sounds wierd, who knows if it's true. This JavaOne is the largest JavaOne ever, as apparent from this exhibition hall. "The Java community has never been more vibrant." The JCP has 1052 members. Of these, Jonathan says there aren't enough individuals on this committee. Everyone should go out and join. The community defines the future of Java.

Now there's a guy from Motorola on stage. He's the guy who originally introduced Java at this conference 11 years ago. The next few years will be just as crazy as the last 10 years for Java - only it will happen on a high-speed mobile network. In the mobile space, their are a lot of proprietary things going on. By encouraging and using Java, applications can be developed and deployed easily across many mobile devices. Motorola is selling 200 million phones this year. They've shipped 90 million in the last 6 months. Java needs to stay unified so write-once, run anywhere works on all devices. Motorola is publishing many open source projects for Java and Linux on http://opensource.motorola.com. To summarize, Motorola alone out-ships the PC industry.

Mark Shuttleworth from Canonical, Inc. is now on stage. Mark is deeply involved in the Ubuntu community. As of today, Java will be directly available to Ubuntu, Gentoo, Debian, etc. Apparently, this is because Sun has made some changes that allow it to be distributed with Linux. They're talking about Linux on Niagara - it sounds like there might be some announcements around this during the week. There's still no announcements about open-sourcing Java or re-licensing.

Mark Fluery has now been invited up on stage. He's got a red beret on. The Red Hat deal closes on May 31st. JBoss is joining the NetBeans community. Mark seems to think the next big thing in Java is Tools. Seems like a publicity stunt since they're talking about Netbeans. It will be interesting to see if JBoss becomes heavily involved in IDE development. Expect more innovation. You should expect more from the future, from the companies that provide Java, and from the community that uses it. Jonathan's first act of congress in his new post was to ask someone to return to Sun. Rich Green is the Executive VP of Software for Sun. He's been back at Sun for a week and a half, and he's been in meetings the entire time.

"Are you going to open source Java?", asks Jonathan.

"It's not a question of whether, it's a question of how." replies Rich.

So there you have it. They're going to open source Java, it's simply a matter of getting through all the politics and compatibility-issues to make it happen. Rich is now on stage by himself, encouraging the audience to get more involved in Java. Java EE 5 was recently approved. Now they've invited the Java EE Expert Group on stage. Everyone has a company sign to show. My name is on the slide, but it doesn't look like individuals were invited. Oh well, it's not like I contributed anything.

Jeff Jackson, Senior VP of Java Enterprise Platforms and Developer Products is now on stage. Java EE 5 is the big thing at the conference this year, and has all the right stuff: Ease of Development, simplified programming model with annotations, EJB 3.0 support for POJOs, new Java Persistence API, Web 2.0 Support, .NET Interoperability, Simplified SOA. NetBeans 5.5 supports Java EE today, so Jeff recommends you download it today.

Jeet Kaul is now on stage and he's going to do a demo of developing an application with Java EE 5 and NetBeans. He's using a nightly build from May 10th. I'm not sure if it's a nightly build of NetBeans or Glassfish that he's using. The demo he showed is pretty cheesy. He added an "author" column to a table, added a property to an Entity bean and then added an input field to the UI. This was followed with a web services demo and an Ajax demo. The Ajax demo was kinda cool - NetBeans allows you to drag and drop JSF components into a page. It drops in code rather than using a WYSIWYG view. I'm not sure if a WYSIWYG view is an option, as they didn't demo or mention anything.

Today Sun is donating their Java Message System (JMS) and NetBeans Enterprise Pack (UML, collaboration, etc.) to the open source community.

Craig McClanahan is on stage, He's got a slide with Duke holding a beer stein. The beer stein, and the Sierra Nevada that Craig pulled out are to represent the real reason we're here: The Beer. Craig is doing a demo with Java Studio Creator and creating a Pub Locator application that utilizes built-in GoogleMaps components. Craig deployed and showed a demo locating all the pubs near Moscone center. Then he turned "boss mode" on and clicked on a link to the Thirsty Bear. This took him to the new Java Ajax portal at developers.sun.com/ajax. Craig's demo was followed with a demo of the new Pet Store - with Ajax/Dojo enhancements.

Sun will be donating Java Studio Creator to open source (at netbeans.org) in the near future. In case you're not aware, Sun has recently released a number of other products on netbeans.org: NetBeans Profiler, NetBeans Mobility Pack, NetBeans Matisse.

Now there's a guy from Microsoft on stage talking about .NET and Java EE 5 interoperability. There's a "Tango" project that has a runtime that provides the interoperability between platforms. Now they're doing a demo with NetBeans 5.5 and its BPEL engine; all running on Open ESB. They demonstrating using WFC and Vista on the Windows side to connect to a web service on the GlassFish side. The Tango project has been renamed to Web Services Intererability Technology (WSIT) and is available on java.net at http://wsit.dev.java.net.

There's some new guys on stage now and they're talking about "Simplified SOA" with NetBeans Enterprise Pack using BPEL. While the BPEL tools in NetBeans look cool, they're definitely starting to lose the audience; people have started streaming out of the auditorium. More open source contributions: BPEL Engine into Open ESB and Sun Java System Portal Server.

Big Announcement: all of the technologies mentioned today will be under the umbrella of the OpenJava EE project.

Richard Blair (Swing Engineer from Sun) and Romain Guy have come on stage to demonstrate a Java SE Swing Web 2.0 Mashup. The demo uses Mustang and starts with showing a Swing client that connects to Flickr and allows you to browse photos. The slideshow feature is very cool and allows you to do 3d rendering and angling of images. It's one of the slickest-looking desktop apps I've ever seen. After showing the photo feature, they're showing how you can integrate this will a Google Map-looking service to show pictures on a map. All of the components in this demonstration are open source or simply customized Swing components. They ended the demo with showing a preview feature. The preview creates an applet that runs in a web browser (even when you're disconnected) and draws Roman's trip on a map, playing music and fading in pictures as the trip progresses. I was blown away at this point and would love to get my hands on this application. Hopefully it will be made available online, or maybe as a Flash movie?

There you have it folks. Sun is going to open source Java, just like I predicted a couple of weeks ago. It's not a matter of when, it's a matter of how. ;-)

Posted in JavaOne at May 16 2006, 09:40:33 AM MDT 5 Comments

Ajaxian Faces with David Geary

David wrote both Graphic Java Swing and Core JavaServer Faces (with Cay Horstmann). Both of these were best sellers on Java component frameworks. Not only that, but he's fun to talk to and lives just south of me in Colorado.

Agenda: Ajaxian Faces Essentials, Roadmap, Form Completion, Realtime Validation, Ajaxian Components, Ajax with Shale and Prototype.

Enterprise Java and Ajax: you invoke a URL from the client (XHR), then handle the URL on the server. This handling is usually done by a servlet, filter or a JSF phase listener. These return HTML or XML to the client. Then the client merges the response into the DOM on the client.

JSF and Ajax: JSF is an excellent framework for Ajax. Why? Because of its component model: GET and POST requests are supported and it has custom components and renderers. Furthermore, JSF has lifecycle and event handlers - phase listeners and allows complete control over the lifecycle.

Common Ajaxian use cases: form completion, realtime validation, polling (progress indicators, realtime search, etc.), ajax components and frameworks. In this talk, we'll be covering JSF (POSTs and GETs), JSF and JavaScript, how to control the JSF lifecycle, JSF client ids vs. component ids, accessing view state, and many other things.

Arm yourself with tools: Firefox with the Web Developer Toolbar. Most helpful features: outlining block elements and DOM inspector. Debuggers on client and server: IDEA on the server, Venkman on the server.

Good Resources: Java EE Blueprints, Ajax Magazine and MSDN.

JSF and JavaScript: The HTML component tags have all the event handlers built-in: onclick, onblur, onfocus, etc.

<h:form id="form">
    <h:inputText id="name"/>
    ...
</h:form>

In the above example, the component id is "name" and the client id is "form:name". To do minimal Ajax with JSF, you can use a non-Faces object to handle the Ajax requests with a servlet or filter. All you really need to know is how to reference client ids vs. the ids you code into your view templates.

Realtime validation: to do this, you need access to the view state. Ajax will fire a component's validators, invoke a phase listener (after the Restore View phase), POST a request with XHR and utilize client-side state handling. A typical component tree for a form consists of a UIViewRoot, an HtmlOuputText (instructions for form) an HtmlForm and an HtmlPanelGrid that contains all of the input components.

The JSF Lifecycle: Restore View -> Apply Request Values -> Process Validations -> Update Model -> Invoke Application -> Render Response. You have to do a post with JSF, otherwise the view state won't be available.

To register a phase listener, you merely declare it in your faces-config.xml file. There's a PhaseListener interface that defines 3 methods: getPhaseId(), beforePhase() and afterPhase(). In this example, getPhaseId() returns PhaseId.RESTORE_VIEW and beforePhase() isn't implemented; afterPhase() is used. David then checks for an "ajax" parameter. If it's sent in the request, he grabs the component to validate and invokes all its validators. One of the nice things about JSF is you can modify your client-side components on the server-side. You can also use JavaScript on the client-side to grab the hidden client-side state-saving field and send it with an Ajax request to maintain state.

JSF Ajax Components: To create JSF Ajax components, you'll want to put your JavaScript into a separate file. In the component's renderer, you'll write a <script> tag that uses a JSF page as its "src" element. Then you use a PhaseListener that looks for the URI invoked by "src" and handle it appropriately. Now David is showing us how you need to create a component, a Tag and a Renderer to create an Ajax component. The Tag and the Renderer write out JavaScript functions that do the magic stuff. Finally, you'll need to create a JavaScript file that contains the functions to be called. At this point, ragged on Geary a bit for creating a simple component with 3 Java classes + a .js file.

Rather than writing all this low-level JavaScript code yourself, you can simplify development with JSF and Ajax by using Struts Shale. Features of Shale include.

  • Web flow
  • Remote method calls
  • Tiger extensions
  • Integration with: Spring, Tiles, JNDI
  • View controllers
  • Testing framework
  • HTML views (a.l.a. Tapestry and Facelets)

David gave a quick preview of Shale and showed how much easier it makes Ajax. Basically, you give a specialized URL on your client - and using a syntax of "dynamic/managedBeanName/method", it calls that method on the server. Pretty cool stuff, but doesn't seem a whole lot different from what DWR offers for JSF. "Shale is a proving ground for JSF 2.0, hopefully all its add-ons will make it into the next version of the spec." When David says stuff like this, I'm tempted to use Shale in AppFuse for its JSF support - especially since Shale can work with any JSF implementation (1.1 RI, MyFaces or 1.2 RI).

As usual, this was a good talk by David. He's always entertaining and fun to harass. ;-)

Posted in Java at May 12 2006, 06:06:55 PM MDT 3 Comments

Ajax on Rails with Stuart Halloway

There's a number of presentations I'd like to attend during this time slot. In particular, I'd like to attend Testing with Selenium and Simplified Ajax Development in Java with ICEfaces. However, Stuart Halloway is an excellent speaker and I'd rather hear him talk than learn something in another session. Hopefully other attendees blog about the aforementioned sessions so I can still learn something from them.

Agenda: Ajax, Libraries for Ajax (i.e. Prototype and Scriptaculous), Rails and Ruby.

There's probably 100 people in the room. Stuart did a survey of who is using Rails - I'd say the response was about 10%. He also asked who's considering it for future development. The response seemed to be around 25%. I'm sitting in the front of the room, so I probably didn't see the results as well as Stuart did. Regardless, it's interesting to see that most people in the room won't be using Rails, they're merely interested in it (or they wouldn't be in the room, right?).

The best way to play with Rails on Windows is called InstantRails. For OS X, there's Locomotive.

All the demos given during this session are available in the ajax_labs section at codecite.com.

Things we're going to look at: autocomplete, in-place Editing, searching, sorting, expando, drag and drop, sort, server-side validation, client-side validation, and prototype windows (Stuart prefers to call them divdows).

Stuart is talking a lot about how Rails works at this point, model objects, yml files, tests and sample data. One of the things that I find interesting about most CRUD-generation frameworks is they don't take tests into account. Ruby on Rails generates tests, so does AppFuse. If you work on a CRUD-generation project for web development, do you generate tests too? If not, don't be embarrassed, tell us. There has to be a good reason you're not doing this.

Now the audience is struggling with the concepts in Rails, how ActiveRecord works, etc. For example, one guy asked if it's possible to use JDBC with Rails. It's definitely a humorous question, but Stuart handled it quite well without ridiculing the guy. A couple of notes: Rails doesn't work well with stored procedures or composite keys.

Now we're looking at the view layer, in particular a show.rhtml template. It's pretty simple , but not very HTML-ish. Looks a lot like scriplets in JSPs. Autocomplete with Rails is mostly CSS-driven. To use it in a Rails view, you start with the following line of code at the top of your template.

<%= stylesheet_link_tag 'autocomplete' %>

In Rails, when you want to render an Ajax response in a controller, you use the following at the end of your method.

render :layout=>false

This turns off any page decoration. It'd be nice to have something like this in the Java world - so you could turn off page decoration from SiteMesh, Tiles, etc. It shouldn't be hard to implement this in SiteMesh, but it might take a bit of work for Tiles.

Partials are Rails' way of creating fragments that are designed to be populated and returned by Ajax calls. Their naming convention is to being the filenames with an underscore. For example <%= render :partial=>'search' %> looks for a _search.rhtml template.

For Ajax development with Rails, you're not tied to using Prototype or Scriptaculous. However, since Rails has helper methods that emit the JavaScript, it makes things much easier. If you'd like to use Dojo, you'd have to hand-code the JavaScript into your RHTML templates, or write helper methods for Dojo. Stuart would like to see a Rails plugin that allows you to switch the Ajax helpers from one library to the other.

The last thing Stuart showed was Prototype Windows. This looks similar to lightbox gone wild, except you get better styling around the modal window. If you haven't heard enough of what Stuart has to say, checkout blogs.relevancellc.com. One of the most interesting things lately is he's been posting reviews of the various Ajax books.

Posted in The Web at May 12 2006, 01:35:41 PM MDT 5 Comments

Ajax and Open Laszlo with Max Carlson

Max is the co-founder and Lean Runtime Architect for Laszlo Systems. Max doesn't look at all like I pictured him (do they ever?!). He looks like a heavy-duty engineer, long curly hair, a little rough around the edges. I respect him more already. ;-)

Laszlo Systems Background: company founded in 2000. Laszlo Presentation Server (LPS) released in 2002. Embraced open source; LPS became OpenLaszlo. 2005: it's been widely adopted (130,000 downloads to date). This year, they're extending OpenLaszlo to support multiple runtimes, including DHTML. The company makes money of training and support, as well as developing custom applications (i.e. Laszlo Mail) and modules.

On 2/1/2006, Laszlo Systems joined a select group of tech leaders in establishing the Open Ajax community. Jointly committed to "making it easier for an open source community to form and popularize Ajax."

Demo's: Laszlo Mail, Pandora, Barclay's and Gliffy.

Developing with OpenLaszlo: XML-based, use your favorite XML editor. It's source-control friendly and has a library mechanism (for modularization). It's a familiar methodology for software engineers. It has standard OOP features: attributes and methods, class definitions with inheritance, familiar design patterns apply. There's an emphasis on declarative constructs. Finally, there's an open source Eclipse-based IDE4Laszlo. Originally developed by IBM, among the most popular downloads on alphaWorks. It now contains a WYSIWYG tool and is hosted at http://eclipse.org/laszlo.

LZX: Laszlo's XML Application Description Language: Flash independent tags and APIs (no ActionScript, movieClips, etc.; no need for Flash development). This allowed them to easily port to a different runtime. With OpenLaszlo, you can interface with your server via XML over HTTP, SOAP, XML-RPC and Java RPC. It has a runtime constraint system, hierarchical data binding with XPath. It has media, streaming support (although the Flash runtime seems to load images real slow - see the DHTML vs. Flash demo on http://openlaszlo.org).

Now Max is going through the Laszlo in Ten Minutes tutorial. If you haven't seen this, you should definitely check it out. It's a good quick introduction to OpenLaszlo. One of the unique features of OpenLaszlo is its components are written in LXZ. Compare this to XUL (components written in C) and Flex (components written in Flash) and it seems a lot more open.

In order to solve the nested-for-loops problem with JavaScript and DOM-manipulation, OpenLaszlo uses XPath and turns for loops into simple URL-like expressions. For example:

<text datapath="dset:/employee/firstName/text()"/>

Noticed on Max's Firefox toolbar: a del.iciou.us menu.

For the last 1/2 hour, Max has been talking about LZX, how to handle events, etc. In other words, since I've already worked with OpenLaszlo a bit, I haven't learned anything new.

Now Max is talking about OOP and how you can declare classes with certain attributes and then re-use them. It's kinda like Spring's "abstract beans" where you can declare a template bean and override attributes in child beans. In addition to allowing classes to be declared with no parent, you can create classes that extend an existing class. A common usage is declaring default values and then overriding visual elements (i.e. border size, colors, etc.).

OpenLaszlo 4.0 (with Ajax support) is targeted for a release by the end of the year.

Personally, I think OpenLaszlo is a very cool technology. However, it definitely needs a better IDE IMO. The last time I tried IDE4Laszlo on my Mac, it wasn't even close to useable. From a development perspective, using OpenLaszlo was difficult to work with because I felt like such a moron. With HTML and CSS, I know how to program UIs and it's difficult to give up that knowledge and rely on something else to provide the look and feel of my UI. In reality, I'm simply frustrated with my OpenLaszlo skills and would likely feel different if I was paid to develop a real-world application with it. After all, getting paid to work with a particular technology is almost always the best way to learn it.

Max is a great speaker and did a good job of introducing OpenLaszlo. Furthermore, this was one of the most interactive sessions I've seen at this conference. There's definitely a lot of folks interested in this technology.

Posted in The Web at May 12 2006, 11:50:24 AM MDT 1 Comment