Edit the configuration.xml
file as below:
<configuration xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
<external-component-plugins>
<target-component>org.exoplatform.webui.ext.UIExtensionManager</target-component>
<component-plugin>
<name>add.action</name>
<set-method>registerUIExtensionPlugin</set-method>
<type>org.exoplatform.webui.ext.UIExtensionPlugin</type>
<init-params>
<object-param>
<name>ViewSource</name>
<object type="org.exoplatform.webui.ext.UIExtension">
<field name="type"><string>org.exoplatform.wiki.webui.control.MoreExtensionContainer</string></field>
<field name="rank"><int>1000</int></field>
<field name="name"><string>ViewSource</string></field>
<field name="component"><string>com.acme.ViewSourceActionComponent</string></field>
</object>
</object-param>
</init-params>
</component-plugin>
</external-component-plugins>
</configuration>
Pay attention to the action name (ViewSource) and the component name (com.acme.ViewSourceActionComponent).
The configuration for UIExtension is explained here.
As noticed before, your action listener extends the MoreExtensionContainer
class. Here you see it is
passed to the type field. You can decide which menu your action is plugged in, by choosing one of types below:
Type | Description |
---|---|
org.exoplatform.wiki.webui.control.UIPageToolBar | Actions will be placed in Toolbar in the View mode. |
org.exoplatform.wiki.webui.control.AddExtensionContainer | Actions will be plugged in the Add Page menu in the View mode. |
org.exoplatform.wiki.webui.control.MoreExtensionContainer | Actions will be plugged in the More menu in the View mode. |
org.exoplatform.wiki.webui.control.UISubmitToolBar | Actions will be placed in Toolbar in the Edit mode. |
org.exoplatform.wiki.webui.control.UIEditorTabs | Actions will be placed in the Editor tabs. |
org.exoplatform.wiki.webui.control.BrowseExtensionContainer | Actions will be plugged in the Browse menu in the View mode. |
org.exoplatform.wiki.webui.popup.UIWikiSettingContainer | Actions will be placed in the Setting tabs. |