[jboss-dev-forums] [Design of JBoss Portal] - Ajax status
julien@jboss.com
do-not-reply at jboss.com
Sun Apr 8 17:40:07 EDT 2007
The ajax stuff today is mostly finished, the remaining stuff is about writing tests and clarify its how it is configured in the portal object tree. Here is the status of what has been done :
Two features have been implemented :
- Drag and drop, that works mostly with dashboard.
- Asynchronous portlet rendering
About the second one :
Fortunately I have been able to come up with a solution that does not need different URLs: a browser with javascript disabled will work with the same page.
When a portlet window is asynchronously handled, the URLs that target the portal are handled by an even handler and the request is done by an XHR (XmlHttpRequest). On the server the same CommandFactory decodes it and the command is executed as usual.
The main change relies in how the command response is interpreted by the response handler. The ClassicResponseHandler will transform the result usually in a full page rendering sent back to the browser. The AjaxResponseHandler will rather perform the minimal work and send a response to the client browser.
Due to limitations of the theme framework we are able to handle only changes that don't change the window configuration on a page. So maximizing a window or moving from away from maximizing will always perform a full page refresh. That limitation will probably be removed in the future with a smarter client side implementation.
The ajax part is smart enough to detect navigational state changes and is compatible with the IPC api we have. So page events that modify the window state of several portlets on the same page, or transorming an event into another will always update the portlets on the same page.
The protocol between the AjaxResponseHandler and the client side javascript is very simple for now and has 2 basic responses. The first one is making a redirection to the browser, the second one is updating several fragments on the page. Again in the future it will improve and will have richer responses (i.e more UI oriented).
The client side implementation still uses scriptaculous + prototype which is a decent choice so far (it works in IE6, FF, Safari and Opera). I had to make one css hack to support IE6 though. In the future we may use another technology.
The configuration is done either at the portal object level using one property and also at the portlet level. A portlet may want to never be handled asynchronously for some reason so it is possible to prevent a portlet from being handled as such by specifying it in jboss-portlet.xml. A page or portal can be marked as asynchronous using properties there.
Finally this part is of course experimental, so don't blame me too much for issues :-). Please make JIRA tasks for the one you find and I will fix them when I come back next Saturday.
If you want you want to disable ajax stuff, you can try :
1/ put false in the render set used
2/ tag the portlet as async false (look in portlet-samples which has an URLPortlet and AsyncURLPortlet)
3/ set the ajax property on the portal object to false (still in portlet-samples the -object.xml)
The remaining stuff I plan to do upon my return and after CR1 is :
- write documentation about how to configure it
- find good defaults
- improve the configuration
- document it
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035623#4035623
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035623
More information about the jboss-dev-forums
mailing list