Introduction
As with XX-9311, plugins (that is any jar file placed in sipXconfig classpath - share/java/sipXecs/sipXconfig) can contribute with own menu items and pages to admin interface.
Adding pages
If you want your plugin to add new pages in admin interface you have to:
- add plugin Tapestry page class underĀ org.sipfoundry.sipxconfig.siteweb.plugin package
- add Tapestry page specification, page template and properties files under "plugin" directory inside jar file
...
---- PluginTestPage.html
---- PluginTestPage.pa</span>gepage
---- PluginTestPage.properties
...
------ sipxconfig
-------- siteweb
---------- plugin
------------ PluginTestPage.class
Such page can be accessed from a browser as https://localhost:8443/sipxconfig/plugin/PluginTestPage.html
Adding menu items
Plugins can contribute menu items at the top or at the bottom of existing menus (User, Devices, System, Features, System, Diagnostics) or with its own menu. In order to add such menu items a plugin should contain a Tapestry page named PluginMenu (added as explained in section above), with one or more of the following Tapestry Block components:
...
Code Block |
---|
<span jwcid="pluginMainMenu@Block"> <li> <div class="roundedMainSectionBoxTopLeft"></div><div class="roundedMainSectionBoxTopRight"></div> <div class="roundedMainSectionBoxInside"> <a class="heading"><span key="menu.plugin">Plugin Menu</span></a> <ul> <li><a jwcid="@PageLink" page="plugin/PluginTestPage">Menu1</a></li> </ul> </div> </li> </span> |
Plugin sample
The attached Eclipse project can be used to build a custom plugin - it contains a plugin page and plugin menu items samples and should be imported in the same workspace with the rest of sipXconfig projects. For deploying the plugin Right Click on project name, choose Export > Java > JAR file and on the Select the export destination specify INSTALL_DIR/share/java/sipXecs/sipXconfig/plugin.jar. Restart sipXconfig process in order to consider the plugin.
Plugin PluginProj.zip
For a quick demo you can copy the jar file below and restart sipXconfig: