Plugins
What is a Site Manager plugin?
A code project that contains views, dialog, logic and data access for some limited functionality to be added and used in the Site Manager.
The Site Manager is composed of plugins. Everything you see in it comes from a plugin. Removing a plugin simply removes that features from the Site Manager
On this image:
- The Customer plugin creates the view adding it to the ribbon: Customer > [Customers] Customers
- The Infocode plugin adds the Infocode tab to the view and the link to the Infocode setup in the related button.
- The Label printing plugin adds the Actions box with the link to the Label printing setup.
What defines a plugin
The only thing that a code project needs in order to be a Site Manager plugin is to include a single class that implements the IPlugin interface.
This is usually done in the class PluginEntry but as long as you have a class that implements the interface you have a legal plugin.
Plugin Architecture
Whether you are modifying existing plugins or creating your own there are some things you need to keep in mind.
- Each plugin should be self contained in the sense that they cannot reference other plugins. If a plugin is adding functionality to other plugins that should be done through special framework messages.
- Only plugins copied to the plugin folder of the site manager will get loaded and all the plugins copied will get loaded. That means if there are copies in the folder that plugin will get loaded twice.
Customization possibilities
To Extend the current system you can both create a new plugin and extend plugins that already exist (It is not recommended but more about that later).
Here is a list of the things you can have your plugin do:
- Create a new view;
- Add it to the ribbon and operation search;
- Add a tab to an existing view;
- Add a tab to an existing dialog;
- Add links to the context bar of an existing view;
- Add to the Site Manager operation search.
Basically everything that you already see in the Site Manager your plugin can add to it as well.
Plugins can hook into other plugins, to be in the contet of those plugins. For an example the Label printing plugin adds a link to the items view.
Should you change existing plugins?
Changing existing plugins developed by LS Retail is possible but not recommended. Keeping your plugins separate from the LS One plugins provides the maximum isolation from LS Retail code changes. So when ever possible let your new plugins extend the functionality of existing plugins by for an example letting your plugin add a tab to an existing view.
But sometimes the only way to do the required customizations is to change existing plugins so if absolutely needed you can customize existing plugins and add or modify some functionality. If you do this you need to look at the Diff reports published with each release to identify possible merge issues.
Existing plugins should be considered in active development and subject to change. LS Retail might change existing plugins and they might no longer with compatible with your changes.
Should we link to this topic? Adding Functionality To Other Plugins
Next you can familiarize yourself with existing plugins and what they do: Open source plugins