Web Info & Tutorials

February 19th, 2007

ZK NOW SUPPORTS JAVASCRIPT, GROOVY, RUBY

As promised, the latest release of ZK (ZK 2.3 RC) now supports more languages in zscript than just Java. It now supports Javascript, Groovy and Ruby. Futhermore, you can easily add support for a new language in half a day (maybe with some practice, no?) by extending a simple interpreter class. That's assuming, of course, that a Java-based interpreter already exists for the language.

For those of you not familiar with ZK, it is a Ajax framework that has you write your application logic on the server-side and treats the browser as a simple display server (as opposed to client-side frameworks that implement lots of application logic in the browser and treat the server more as a collection of web services). You write your application using ZUML, an XML-based markup language, assembling interface components in a way very similar to the desktop GUI component/event driven model. You tie your app logic into the markup language using zscript statements:

CODE:
  1. <window title="Fileupload Demo" border="normal">
  2.     <image id="image"/>
  3.     <button label="Upload">
  4.         <attribute name="onClick">{
  5.             Object media = Fileupload.get();
  6.             if (media instanceof org.zkoss.image.Image)
  7.                 image.setContent(media);
  8.             else if (media != null)
  9.                 Messagebox.show("Not an image: "+media, "Error",
  10.                     Messagebox.OK, Messagebox.ERROR);
  11.         }</attribute>
  12.     </button>
  13. </window>

In the sample above, we are using Java as the scripting language. Now you can use Ruby, Javascript or Groovy in it's place. Realize that scripts written in these languages are executed on the server, not the browser.

February 19th, 2007

3D RENDERER USING CANVAS

Hans Schmucker has created a proof of concept for 3D Renderer using Canvas.

I've written another 3D Renderer for the Canvas element... however it is differet to the existing implementations, this one loads a standard Alias Wavefront OBJ file and renders it. It's not as far as it could be so far (mainly because the Canvas element seems to have a pretty poor clipping system implemented, so that even if the majority of a shape is outside the canvas it will still try to draw the whole shape and then clip it against the window on a per-pixel basis), but it's definitely usable. Shading (each triangle gets a color based on its distance from the viewport) and collision detection (it only detects if there is a triangle below the viewport and will move the view to that position) are primitive, but still, I think this is pretty impressing for standard JS.

3D Demo

The demo does the following:

  • Load a model
  • Set up controls to modify a view object
  • Find the nearest triangle below the player
  • Move the player down to that triangle
  • Rotate the model
  • Clip it against Z=0 so you only render what's in front of you
  • Split partially visible triangles against Z=0
  • Project all vertices, so that they get smaller the farther away they are
  • Draw them, with the distance dictating the color

3D Canvas Demo

February 19th, 2007

SECTION 508 UNDER REVISION

Joe Hanink permit us undergo that Section 508 is low revision via the W3C Roadmap for Accessible Rich cyberspace Applications (WAI-ARIA).

As a developer of Rich webapps, Section 508 deference is a anxiety since its most past update occurred in 2001. I am awaiting feedback from access-board.gov on whether there module be some provisioning for transitional deference for webapps shapely after the declaration but before the newborn rules verify effect.

The w3c WAI-ARIA plan indicates what mechanisms module be standard to earmark webapps to transmit semantic info to API unvoluntary concealment readers, but there I’ve been unable to encounter some open aggregation most the specifics of the newborn 508 rules.