Plugins


The plugin architecture is in development. The description is NOT STABLE.

Soda is a data content management system. It enables user to create and edit web pages with content that includes text, graphics, and data. The content on each page is organized in blocks. Javascript code in the client works with Java code in the server to enable creation and editing of blocks by users.

A normal block contains text that can include embedded data views and graphics. Editing of these blocks is supported by the Froala content editor, with some Soda-specific additions.

There can be other kinds of block that provide additional functionality. The first example of this is blocks that support data entry and viewing using forms. Editing of these blocks can be supported by Javascript libraries. Editing of forms blocks is supported by the Jquery formBuilder library, and entry of data is supported by its associated formRender library.

Each page has a button that a user with sufficient access permissions can use to put it into edit mode. A page in edit mode has a button to leave edit mode and can have one or more add buttons that the user can click to add a block. Each block on a page in edit mode has, if the user has sufficient access permissions, an edit button to enable the user to edit the block, a delete button to enable the user to delete the block, and a drag handle to enable the user to move the block. When a block is being edited, it has a proceed button to enable the user to complete the edit and post the changed block content, and a cancel button to enable the user to cancel the edit. These are the common buttons.

When a block is being edited, and the user has made changes, drafts are saved. If the user does not proceed with or cancel the edit, and that or another user subsequently edits the block, they are given the option to edit the saved draft.

All kinds of block have the common buttons described above, and use the drafts mechanism. Blocks can have other buttons, and use other mechanisms, as well.

The Soda Javascript code is invoked when a page is loaded and when a button is clicked. It provides local processing of the blocks and their content, including moving them and re-displaying them after changes. It uses the Soda API to obtain data from the server, request the server to perform actions, and inform the server of changes.

The Soda Javascript code has a plugin architecture. It has a number of backplane modules that provide a common interface to plugins. There is a Froala plugin for normal blocks, and there can be a plugin for each other kind of block. There is a forms plugin for form blocks.

The backplane modules handle common operations, such as moving blocks and saving drafts, and are invoked when one of the common buttons is clicked. The plugins handle processing that is specific to the different kinds of block.

Each plugin must:

  • provide a function that the backplane can call when one of the plugin's blocks is loaded in a page
  • provide functions that the backplane can call when a common button is clicked for one of the plugin's blocks
  • provide a function that the backplane can call when a button specific to the plugin is clicked
  • use a defined namespace for its plugin-specific buttons
  • not expose functions or variables other than the identified functions that the backplane can call
  • not use functions or variables other than those exposed by the backplane modules and its own private functions and variables.