After much work, I completed the rewrite of Rhizosphere initialization sequence. This was badly needed because the previous version imposed to much burden whenever a new piece of functionality was to be added. However, this rewrite is not 100% backward-compatible with the previous version, and you may have to apply very small fixes to your codebase. What Changed Previously, the implementation of Rhizosphere widgets and components (such as the layout manager, the dynamic filters and so on) was heavily fragmented. The static UI used to reside in the html file containing Rhizosphere chrome (rhizo.html or ig.xml depending on the case) and all the dynamic pieces were scattered through a number of javascript files (mostly in rhizo.ui.js, but not only there). Having all the widgets chrome in an html file imposed serious limitations. For example rhizo.html used to contain the chrome for both the 'normal' rendering and the 'mini' one, with the javascript initialization logic removing part of the DOM depending on the current rendering mode. It also made very difficult to have optional widgets, with the user deciding what to have or not. It was not easy (or entirely not possible) to customize the set of functionalities provided by a Rhizosphere desktop (for example, removing 'actions' support, which is still in its early stage). The current rewrite introduces a modular initialization sequence, where the final rendering is defined by the assembly of multiple components. A component represents a piece of the Rhizosphere UI (for example: the layout engine selector, or the debug console) and is implemented as a single javascript object that knows a) how to render the component and b) how to react to the events it generates and, in general, how to handle its dynamic nature. The user can then choose what components to include in its Rhizosphere UI. So, for example, it is extremely simple to have a Rhizosphere deployment with no Actions, or no Console, or without layout management. For futher informations, look at rhizo.ui.component.js ( in particular at the StandardTemplate and MiniTemplate objects). This rewrite includes several benefits. The init sequence now includes a progress bar, making the user aware of the different loading steps to bootstrap Rhizosphere and improving load-time debugging. More importantly, the Rhizosphere UI can now be rendered inside any DIV element. It doesn't require a full html page anymore! Starting Rhizosphere in a custom DIV is as simple as this: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd"> <html> <body> .... your html page ... <div id="rhizosphere-container"> </div> <!-- include jquery and rhizosphere js code here --> <script src="jquery-1.3.2.min.js" /> <script src="..." /> <!-- Start rhizosphere --> <script type="text/javascript" charset="utf-8"> $(document).ready(function() { var options = {autoSize: true}; var model = "http://yoursite.com/yourmodel.js"; rhizo.bootstrap.go($('#rhizosphere-container'), options, model); }); </script> </body> </html> et voila'! For a complete example, look at rhizo.html . A few caveats apply:
Both these items are currently being worked on. What changes do I need to apply to my code?Because of the changes in the initialization sequence, you might need to change your code a bit. First, the miniRender option (see Developer Docs) has been renamed to miniLayout . Update any references you have in your code. If you use plain javascript files as your models, you need to change the way you initialize rhizo.Project objects. Before you used something like this: var metamodel = ... var renderer = ... var models = ... new rhizo.Project(metamodel, renderer, globalOptions); $p.deploy(models); Now change your code to behave like this: rhizo.bootstrap.setRenderer(renderer); rhizo.bootstrap.setMetaModel(metamodel); rhizo.bootstrap.deploy(models); As an example, look at changelist 137. Is the old version still available?Yes. The old version has been frozen in the v1 tag. But be aware that such version is no longer maintained and new features will only be released on top of the new architecture. |
