This project is read-only.

What Can a Plugin Do

A plugin can register css files contained within it.

A plugin can register JS files contained within it, external JS files with a full URL, or JS code blocks. JS can be placed in the header or at the bottom of the page, just before the closing body tag.

A plugin can define a controller action to be a widget, which can be displayed via it’s id. One or more widgets can be displayed in a widget container on the site. Widgets can have options when placed on a page. This is very similar to WordPress and its widgets and sidebars.

A widget can register an ActionFilter object against a named controller action, which will be dynamically attached. These ActionFilters can modify the content of the response, and multiple results from the filters can be combined in one output. This allows plugins to append, prepend, wrap, or completely replace the output of the original controller action. Only controller actions that allow this behavior can be extended this way.

A plugin can register a new MVC route, which it would typically handle itself. As an example, the SharePoint plugin can show SharePoint wiki pages directly. Wiki pages can contain links to images which have relative URLs such as “Shared Documents/MyDog.jpg”. The SharePoint plugin will register a custom route for “Shared Documents/” so that it can handle the image request to properly display the image.

A plugin can be enabled or disabled. When a plugin is not enabled it will never have any of the above registered items rendered into the page. For example, none of its JS or CSS would be included in the page output.

Overview

The base MVC plugin framework provides the core functionality outlined above, which is fairly powerful and extensible. However, the framework was designed such that a real application would extend the BaseMvcPluginApplication class and provide additional resources that a plugin can register into. The plugin demo project is a class library that does just that.

The Plugin Demo Application adds the ability for a plugin to register menu items. As with the other resources, if the plugin is not enabled, its menu items would not be included in the given menu.
The Plugin Demo Application allows there to be an unlimited number of named menus that a plugin can add into.

If you intend to use the MVC Plugin Framework, you will need to build a class that inherits from BaseMvcPluginApplication just like the PluginDemoApplication class does. You should consider what other resource you want to expose for your plugins to hook into. For example, a mapping system might add the ability for a plugin to add a map layer, and the map might have a list of checkboxes for each defined layer that the user can turn the visibility on and off for.

Last edited Nov 9, 2013 at 2:13 AM by MattFromGA, version 6