Reinhardt: a Client-side Web Framework October 9th, 2008 at 9:27 pm by Kevin Dangoor

A typical server-side web framework today includes three main components: a URL dispatching to some controller object scheme, a template engine, and a data mapping facility. Currently in Dojo, you’ll find that the latter two items already exist. dojox.dtl provides the first one, and dojo.data provides the second.

We provide SitePen Support customers with a custom-built user interface for managing their support account. When we started working on this customer interface, we opted to make the entire user interface driven by JavaScript. The server-side provides data and data manipulation functionality via JSON-RPC, but does not dynamically serve up pages as a typical web app would.

Read the rest of this entry »

HTTP Proxying to Solve Web Development Problems October 8th, 2008 at 12:30 am by Sam Foster

An HTTP Proxy server relays requests between the HTTP client (e.g. your browser) and the server—whether it be out on the web, intranet or localhost. When it’s under your control, the proxy is a great place to inspect and debug client-server interactions over HTTP, log and report, tune and tamper with the requests the client makes, and the responses the server(s) produce. In this article I’ll show how to use Charles (one such proxy tool) to help solve a range of common web, and especially RIA, development problems.

Read the rest of this entry »

Ajax Experienced October 7th, 2008 at 1:51 pm by Dylan Schiemann

SitePen recently returned from Beantown, the host city to this year’s Dojo Developer Day (DDD) and The Ajax Experience, the largest annual conference dedicated to Ajax development. SitePenners in attendance included Joe Walker, Kris Zyp, Tom Trenka, Peter Higgins, and Alex Russell, all of whom must be applauded for their great presentations at both events. Kudos to all!

Read the rest of this entry »

Implementing a Web Application Preloading Overlay October 6th, 2008 at 10:01 am by Peter Higgins

A common issue encountered when developing web applications with the Dojo Toolkit is a startup lag caused by the dynamic loading of modules and resources, further aggravated by a flash of unstyled content before the template system kicks in and sets up your widgets. This is especially true when using numerous Dijit components, and even more apparent when not using a custom build (such as loading your files from the Google or the AOL CDN). While it is typically recommended to use a custom build, it isn’t always practical, or even necessary. Perceived speed is speed, and we should do something about it.

Dojo is a very flexible toolkit, and can bend and otherwise be manipulated to handle any use case. Personally, I am a fan of the progressive use case: where JavaScript is used to enhance an otherwise perfectly working collection of clean markup and good styles. Sometimes though, especially in the case of intranet applications or “admin panel” type web interfaces, you will find yourself using many layout widgets and form components. Delivering content quickly in this case is essential, and hiding any ugliness resulting from template substitution is a vital aspect to delivering the best possible user experience. Today, I’m going to go over a common technique to provide at least the perception of perfectly designed full-page layout applications.

Read the rest of this entry »

Jaxer + Persevere via Dojo’s JsonRestStore September 29th, 2008 at 9:43 am by Kris Zyp

perseverejaxerdojo.png With the increasing popularity of JavaScript, and rising usage of JavaScript in the browser, it is becoming very effective to use JavaScript on the server to have a single end-to-end language for both client and server-side development. Options for server-side JavaScript are also increasing.

Jaxer is a new server that uses server-side JavaScript for HTML generation, using the standard browser DOM model (it is actually running Mozilla’s engine on the server) as the API. Persevere is a JavaScript based database system, that integrates a JavaScript based object model with object persistence. Dojo’s new PersevereStore, which is built on the JsonRestStore, allows code running in Jaxer to easily query, manipulate, and interact with data in Persevere by running Dojo on Jaxer’s server-side JavaScript environment. These two JavaScript servers can complement each other, with Jaxer providing HTML presentation/generation and Persevere providing the data object model and persistence, with JsonRestStore as the bridge.

Read the rest of this entry »

CouchDBRestStore September 26th, 2008 at 6:54 am by Kris Zyp

One of the stores built on JsonRestStore and included in Dojo 1.2 is the new CouchDBRestStore. CouchDB server is a JSON-based schema-free database with clustering and fault-tolerance. This new module utilizes the JsonRestStore RESTful capabilities to interact with a CouchDB server. CouchDB has a standards-based REST interface that integrates well with JsonRestStore via a few adaptions from the CouchDBRestStore modules.

Read the rest of this entry »

Security in Ajax September 25th, 2008 at 12:38 am by Kris Zyp

Security in Ajax web applications is of growing importance. While the client-server model is very useful for architecting web applications, the web security is model is not client-server, but rather a client-deputy-server model. Understanding this security model is important for building secure web applications, and it is becoming even more important as we build mashups and web applications that utilize cross-site resources.

In a client-server model, the client acts on behalf of the user, and the server trusts the client to the degree that a user is authorized. In the client-deputy-server model, the deputy (the browser) acts on behalf of the user, with suspicion of the client (web page/JavaScript), taking responsibility for some aspects of security, limiting client to client interaction. By understanding the mechanisms for the deputy boundaries, servers can appropriately participate in the security model with proper trust for the browser to act on behalf of the user. We will look at how to secure resources from being accessed from the wrong clients and protect clients from malicious server code.

Read the rest of this entry »

Effortless Offline with OfflineRest September 23rd, 2008 at 12:01 am by Kris Zyp

offlinerest.png There is growing support in browsers for offline capabilities with the HTML 5 specification for local storage, offline notifications, and offline application cache, but adapting an application to store changes locally and do synchronization when connectivity is restored remains a major challenge for developers. Dojo 1.2’s new dojox.rpc.OfflineRest module automates the local storage of data and synchronization by leveraging the Dojo Data and REST abstractions. The OfflineRest module augments the JsonRest service in Dojo such that requests are cached in local storage for offline access, and modification requests (put, post, and delete) modify the cache and are recorded for delivery to the server; immediately if online, otherwise when connectivity is restored. Furthermore, JsonRest is the core engine used by JsonRestStore. Consequently, you can simply use the standard Dojo Data API with the JsonRestStore and effortlessly add offline capability with no modifications to your data interaction code. The underlying Rest service automates the handling of caching, storing data locally, and syncing changes. In addition the new OfflineRest module has no dependency on plugins, but rather progressively utilizes offline features that are available, while still operating properly on legacy browsers without offline support.

Read the rest of this entry »

Accessibility Experiment September 22nd, 2008 at 12:02 am by Joe Walker

Just back from @media Ajax with a few ideas buzzing around. One based on this comic:

comic about foreignizing a website

It's patently absurd. And yet it's what we do with accessibility all the time, and in some ways the differences between someone with a visual impairment and someone with dexterity difficulties could be greater than the differences between a Spanish and Italian speaker.

Read the rest of this entry »

Dojo at ZendCon September 19th, 2008 at 1:25 pm by Alex Russell

I gave a talk on Dojo Wednesday at ZendCon, and when I walked into the room for the talk, there was some disorder as the conference center staff were taking out the tables to fit more chairs in. Even with the extra space, the room was totally packed, thanks in large part to the amazing Dojo integration work that the Zend team has done.

Read the rest of this entry »