As
OpenEdit grows, it accumulates an amazing number of features. It owes this success to its powerful and flexible tools. By tools I mean the essential elements of the OE framework, including xconf configuration files, layouts, page streaming, request parameter handling, session variables, permissions, etc... The flexibility is obvious-- we build complete file managers, blogs, and
image archives using those same tools. The power comes from the fact that each of these tools encapsulates behavior that we use again and again to make these features. And yet there is still more possible extraction. Not only do we often use these tools in similar ways, but we also link them together in similar ways.
Today I'm working on another feature to add to OpenEdit: A picture carousel. It will display a subset of pictures from a search along with inline pagination. The essential carousel functionality is new, but it will have many tried and true behaviors and characteristics:
--It will be embedded in some existing page.
--It should only appear if the user has the proper permissions.
--It should only appear if the site designer wants the feature.
--It will probably operate within itself using ajax (for instance, to switch pages).
--It has some variable input (the search results to use).
Many other features in OE share this description, like the file manager, result voting, permission editor, asset upload, detail editor...
Others share many of these behaviors, but instead of acting as their own contained box, they have a interface that operates on another part of the screen, like the search bar, category browser...
I believe it would be of great benefit to combine all these behaviors into one mechanism. The primary benefit would be to make ajax and variable passing much easier, but it would also create a consistent and easy way to implement permissions, and it would greatly improve the readability of our html.
Each of these "plugins" (for lack of a better term) would have their own folder with some standard files that help OE load them. Then, using velocity, you would write something like $pages.includePlugin("/path/, $context, "canviewcarousel"). That method would decide whether to render anything (according to the permission) and would also handle the creation of 'local session variables', which exist inside the entire plugin (which would really help things like generictable.html). Inside the plugin's html pages, you can call something like $pages.gotoPluginPage("index.html", $context), which would handle all the ajax code to switch to the plugin's index.html page and pass the parameters along properly.
While this would be a fair amount of work to implement, I believe that this, or something similar, would speed up OE development in the long run.
Let
OpenEdit know what your thoughts are about this development technique.