Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

1. Load Widget Library. a widget is imported into the system, either at runtime or was previously imported and is loaded at app init time. in this step some kind of WidgetManager would inspect all of the widget archive files, parse their XML descriptors, and construct Widget objects to represent them which while the system is running.

2. Associate widgets to a weblog. to make use of widgets they need to be attached to a weblog via a panel. this is done either by a theme or directly by a weblog owner on the UI. the end result is that a WeblogPanel is defined and any number of WeblogWidgets is associated to the panel. The WeblogWidgets simply defines an association indicating that widget "foo" is attached to panel "sidebar" in weblog "myWeblog". The actual "foo" widget is maintained by the WidgetManager.

3. Rendering a widget. when a weblog page is being rendered it would indicate that it wants to render a specific panel using a macro call like #showPanel("sidebar"). that macro would perform the necessary logic to lookup the panel from the weblog, $model.weblog.getPanel("sidebar"), then render each widget in the panel using a loop over $panel.widgets. For each widget being rendered the process would be slightly different depending on the rendering approach chosen, but the outcome would be the same. The rendered output from the widget is inserted into the page.

Issues

  • how to access widget resources? Roller takes the approach that all components used by a weblog should be accessed via that weblogs urls, but this creates some issues for resources that are meant to be shared across weblogs.
    • option 1, use the existing resource servlet the same way we do for theme resources.
    • option 2, pick a url location outside of the weblog url space (/roller-ui/) to use for accessing widget resources, such as /roller-ui/widgets/<widget>/