Skip to content

Widgets and plugins

coreframework edited this page Sep 14, 2011 · 4 revisions

Plugins

Module(plugin) is an independent part of the system. It can be installed and used in the application. Module will provide the following features:

  • Modules files (one or several projects that implements module logic);
    
  • Installation / deinstallation script. Could be implemented using a standardized Interface.
    
  • Widget collection. Could be implemented using a standardized Interface.
    

Widgets

Implementation

Each widget should implement ICoreWidget interface for successful registration in the system. This interface contains:

  • Title: the widget title
  • ICorePlugin plugin: the module that widget belongs
  • Identifier: unique widget identifier
  • IWidgetActionVerb ViewAction: describes the action for access to widget's content
  • IWidgetActionVerb EditAction: the action for access to widget's settings
  • IWidgetActionVerb SaveAction: the action for saving widget settings

If any module contains mentioned class, the system automatically registers it on the application start.

IWidgetActionVerb interface is located in Core.Framework.Plugins project and has the following structure:

  • Action
  • Controller
  • Area

Widget positioning and re-ordering engine

Widget positioning is implemented using customized inettuts.js, which in turn depends on JQuery UI library.

Widget positioning occurs with the bounds to tag with attribute class="column" (see UI Engine). Each widget should have attribute class="widget" (provided by widget holder).

Initialization

iNettuts.init('<%=Url.Action(MVC.Pages.ShowSettings())%>?pageWidgetId=', '<%=Url.Action(MVC.Pages.UpdateWidgetsPositions()) %>');

First param is URL template for ShowSettings action. Second - URL to UpdateWidgetsPositions action.

Clone this wiki locally