Showing posts with label innovation. Show all posts
Showing posts with label innovation. Show all posts

Sunday, May 04, 2008

Jaxer - An innovative paradigm

Jaxer is an open-source web application development framework providing an consistent Javascript based programming model between the cloud (server) and client. In this post I will provide an architectural overview of this technology and provide a conceptual mobile strategy that this framework can be used for.

Architectural Overview

The core of Jaxer is written in C/C++ and is powered by the same Mozilla engine that powers Firefox 3. There is a wrapper Javascript framework which can be easily extended by developers if needed.

Jaxer provides a plugin as post-processor to the web server and receives an static HTML as input. The core framework is responsible for parsing the input, executing scripts (server-side) and generating proxies.

The framework allows the developer to mark Javascript functions to be executed in the server using - runat="server" attribute in the script tag. There is also runat="server-proxy" where when the client calls are redirected to be executed in the server, the framework is responsible for injecting the methods.

From the server-side code there is also access to the Jaxer library and hence access to session, file system, database, network sockets, etc.

Thanks to Aptana for the image.

Mobile in Minutes

Here I would like to outline an use-case which will enable web properties to quickly create a mobile flavored output using Jaxer. This is intended to be a proof-of-concept and an example for the possibilities enabled by this framework. Lets say you have an existing simple web application and want to enable mobile flavored version modifying the existing application. This solution levereges the server-side processing of Jaxer to identify elements of interest from the HTML and renders a modified output.

Here the idea is to annotate on the HTML elements of the original output. It could be id="mobile-????". This step is just to identify elements of interest and construct a modified html. Here is a brief code snippet which should provide some direction and simply by injecting this script and marking ids mobile should do the job. This is no way intended to be a full-fledged implementation but to give a direction and server as a proof-of-concept:


var k = document.getElementById("b");
var m = document.createElement("body");
var e = document.getElementsByTagName("a");
m.innerHTML = 'Mobile rendering: ';
for ( var i = 0 ; i < style="font-style: italic;">
{

var l = e[i];
if (l.id == 'mobile') {
m.innerHTML = m.innerHTML + ' ' + l + ' +'';
}
}

k.innerHTML = m.innerHTML;

Infrastructural Support

Jaxer can "peacefully" co-exists with your open source technology stack. Jaxer can work with your existing Apache installation and have IIS support in their roadmap. Presently MySQL database is supported but definitely this is an area for improvement. There is also support Tomcat based deployment model and out-of-box support for running in EC2.

Conclusion

Emerging programming models such as Jaxer provide possibilities for more innovative web application extensions. This form of web extensions is extremely useful in enterprise and consumer environments to try-out in a plugin in on-demand.

Technorati Tags: ,

Thursday, August 09, 2007

Data Services in Spring

In today's web applications the need for returning model data from controllers in XML/JSON format is quite common. Mostly these requirements are met by writing custom code in controllers. In this post I will present technical approach that would enable your applications to return data model in XML/JSON or data format of your choice to the web tier using Spring MVC without modifying your applications.

Basically the idea is to return XML(or JSON, etc) whenever we encounter a request to the controller with parameter returnData=XML. This can be accomplished by writing a HandlerInterceptorAdapter with postHandle method to do the following:

void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)
{

if ( request.getParamter("returnData") != null && request.getParamter("returnData")="XML" )
{

// add a XML Serializer to the model
// Find the model object names and add the list to model attribute "xmlModules"
// Set the view name to "xmlView"

}

}


In your xmlView (JSP or Velocity Template) for each attribute in xmlModules use the XML Serializer to generate XML and render it. There are few applications for this approach:

1. Enable front-end to readily use AJAX for existing controllers
2. Use this as a strategy to get a debug view of model data during development
3. Based on some additional key use this to get debug view from production for troubleshooting purpose

Resources:

1. XStream for XML Serialization

Tags: java spring ajax

Saturday, January 20, 2007

Video Hyperlinking

Today, I stumbled upon Video Hyperlink demo from Microsoft adLabs. I find this to be a very important step in online video though this innovation seems to be natural progression.


I feel the emergence of technology with the ability to instrument code (possibly through plugins) to customize players during playback will be seen. In other words, player runtime will have a programmable context within player component to execute some code during playback. I think Adobe Flex framework provides this today and Scott Guthrie of Microsoft gave some hint of video based techonology being part of XAML might be shown during Mix 07. Also, quite naturally the need for metadata at a frame level either with inherent support in video format or through external DAM systems. For example, Canto Video Suite allows video metadata annotation at a frame level.

IBM alphaWorks has a tool which allows MPEG-7 video sequences to be annotated.
Lets wait and watch the digital excitement!

Disqus for techtalk