You are looking at documentation for an older release. Not what you want? See the current release documentation.
This section details how to add a Contextual menu enty which is an action that could be accessed via a right click.
For example, a
button will be displayed in Sites Explorer when right click on a content. Clicking on this button will display a message in the log.To add that button, please follow these steps:
Create a Maven project having the following directory structure:
Where:
pom.xml: The project's POM file.
TestButtonActionComponent.java: The simple action to show the log message.
configuration.xml: The configuration file in which you should register your action with org.exoplatform.webui.ext.UIExtensionManager service.
Create a new action class TestButtonActionComponent which should extend from UIAbstractManagerComponent. You should also create its corresponding listener TestButtonActionListener which extends from UIActionBarActionListener.
You can view the complete class here.
In the configuration.xml
file, register the new action under UIExtensionManager target-component as a component-plugin
as follows.
Some notes should be respected for the java class TestButtonActionComponent:
TestButton will be used to label the action.
TestButtonActionComponent is the class name of your action.
There is a matching rule between the action name (TestButton) and the listener class name (TestButtonActionListener): The listener class name = the action name + ActionListener.
Build your project using this command: mvn clean install
Copy the .jar file (target/action-example-1.0.jar) to the lib folder of eXo Platform.
Restart the server.
Testing the added Rightclick action
Log in to the platform and go to Sites Explorer.
Upload a document.
Right click on this document, the
is added to the action list and the message log is displayed after clicking on it.