Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

...

Wiki Markup
h1. 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.

...



h1. 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.site.plugin package

...



\- add Tapestry page specification, page template and properties files under "plugin" directory inside jar file

...



E.g. for a page named PluginPageTest.html, the packaged plugin should have the following structure:

...



*\--\- plugin

...

*

\---\- PluginTestPage.html

...



\---\- PluginTestPage.pa</span>ge

...



\---\- PluginTestPage.properties

...



*\-\- org

...

*

*\---\- sipfoundry

...

*

*\-----\- sipxconfig

...

*

*\-------\- site

...

*

*\---------\- 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:

- topUserMenu / bottomUserMenu for user menu items added by plugin

- topDevicesMenu / bottomDevicesMenu for devices menu items added by plugin

- topFeaturesMenu / bottomFeaturesMenu for features menu items added by plugin

- topSystemMenu / bottomSystemMenu for system menu items added by plugin

- topDiagnosticsMenu / bottomDiagnosticsMenu for diagnostics menu items added by plugin

- pluginMainMenu for new menu added by plugin

As an example, if you want to add a menu item named "Plugin Page" to point to the page created above and placed at the top of User menu, you will need to have the following code inside PluginMenu.html:

Code Block
]

h1. 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:

\- _topUserMenu / bottomUserMenu_ for&nbsp;user menu items added by plugin

\- _topDevicesMenu / bottomDevicesMenu_ for&nbsp;devices menu items added by plugin

\- _topFeaturesMenu / bottomFeaturesMenu_ for&nbsp;features menu items added by plugin

\- _topSystemMenu / bottomSystemMenu_ for&nbsp;system menu items added by plugin

\- _topDiagnosticsMenu / bottomDiagnosticsMenu_ for&nbsp;diagnostics menu items added by plugin

\- _pluginMainMenu_ for&nbsp;new menu added by plugin

As an example, if you want to add a menu item named "Plugin Page" to point to the page created above and placed at the top of User menu, you will need to have the following code inside PluginMenu.html:

{code}
<span jwcid="topUserMenu@Block">
  <li><a jwcid="@PageLink" page="plugin/PluginTestPage">Plugin Page</a></li>
</span>
{code}If you want to place this menu item under a new menu (such User menu), PluginMenu.html should contain a Block named _pluginMainMenu_ as in below example:

...



{code
}
<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

...


{code}

h1. {color:#3d5561}{*}Plugin sample{*}{color}

{color:#000000}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{color} {INSTALL_DIR}{color:#000000}/share/java/sipXecs/sipXconfig/plugin.jar. Restart sipXconfig process in order to consider the plugin.

...

{color}

{color:#000000}[^Plugin.zip]{color}

{color:#000000}For a quick demo you can copy the jar file below and restart sipXconfig:{color}

{color:#000000}[^plugin.jar]{color}