We're looking at adding javascript/css based shading of portlets to SloanSpace. The idea is to provide a way to shade and unshade portlets without requiring a round trip to the server.
Our initial implementation works great but raises some architectural issues.
Most importantly, the current shading system performs the "am I shaded?" check down in the portlets themselves. Hence in the portlet .adp files you'll typically see this construct:
<if @shaded_p@ ne "t">
*** portlet content goes here***
</if>
This presents a problem for client-side shading. Namely, if shaded_p is true, the portlet's content is never shipped to the client, so can't be unshaded without a roundtrip. To make this work on the client, we must always set shaded_p to true.
Now, we'd still like to keep track of the shading state with client-side shading, we just can't use shaded_p, at least as currently coded. We have a few options. The first is to add a new portal parameter "cshaded_p" to track the client-side shading state. Adding this would require touching a lot of SQL, and doesn't quite feel right since we already have a parameter for tracking shade state.
A second option would be to rearchitect the portal system slightly to make shaded_p more flexible. Suppose, for example, that we moved the shaded_p check out of the portlets and moved it up to the theme level, and left it up to the theme to decide whether and how to handle the shading.
A third option would be to track shading state via cookies. This has the benefit of requiring very little refactoring(it can be done almost entirely in the theme .adp file), but like the first solution, has the odor of solving the same problem in two places that could potentially interact to bad effect.
My gut says the second option is the way to go. How would this affect your .LRN installation, if it all?
Also, which of the options (or others) would you support? To sum them up:
1. Add a new parameter and track client-side shading separately from the old-style server-side shading. Requires lots of new SQL, upgrade scripts. Adds a second, parallel shading system.
2. Move control of the shading to the theme level and let the theme decide how to handle it. Portlets lose control over what they can hide or not hide (should they have that control?).
3. Control client side shading via cookies. Minimal changes to existing code. Adds a second, parallel shading system.