Versions Compared

Key

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

...

Also, before spending too much time drawing up a UI I'd like to get general approval from the community with regards to the functional aspects of the proposal. It would be wasted time to design a nice UI only to have it discarded because we decided to use a different approach to the problem. Once we are committed to this general approach then we would spend more time flushing out the UI design and discussing that specifically. The main point is that users would have a wysiwyg style UI for choosing widgets and organizing them in panels which would alleviate the need for direct template editing.

Design (Object and Data Model)

how are widgets represented in the code?

Similar to the way themes work now, widgets will be defined using a new Widget pojo which will describe all elements of a widget as defined by the widget XML descriptor as well as provide access to all resources defined in the widget. The Widget pojos would look something like ...

No Format

public class Widget {
  String id
  String name
  String description
  List templates
  List resources

  WidgetTemplate getTemplate("path/inside/widget");

  WidgetResource getResource("path/inside/widget");
}

public class WidgetTemplate {
  String id
  String name
  String description
  
  InputStream getInputStream();
}

public class WidgetResource {
  String path

  InputStream getInputStream();
}

how are widgets associated with a weblog? how do panels fit in?

a weblog may define 0 or more Panels which are layout containers for widgets. to associate a widget with a weblog requires a Panel and to access a panel you would use a weblog such as, weblog.getPanels() or weblog.getPanel("name")

a Panel may contain 0 or more Widgets organized in some kind of layout. Most of the time it would be vertical, but we could also allow for other layout options such as horizontal, grid, etc. to access the widgets associated with a panel you would use panel.getWidgets()

The code would look something like ...

No Format

// Java objects
WeblogPanel {
  String id
  WebsiteData weblog
  String name
  String description
  String layout (some way to describe a layout)
  List widgets (reference to widgets configured in this panel)
}

// A WeblogWidget only represents the association between a real Widget
// and a WeblogPanel, it does not contain any actual Widget information
WeblogWidget {
  String id
  WeblogPanel panel (panel this is attached to)
  String widgetId (id of the actual widget this represents)
  int ordering (some way to order the widgets within the panel)
}


-- sql tables
roller_weblogpanels(
  varchar(48) panelid not null primary key, 
  varchar(48) weblogid not null,
  varchar(64) name not null,
  varchar(255) description,
  varchar(64) layout not null
);

roller_panelwidgets(
  varchar(48) id not null primary key,
  varchar(48) panelid not null, 
  varchar(64) widgetid not null, 
  integer position not null
);

Design (Rendering)

what actually happens to render a widget and insert it into a template?

...