Link a Plugin
Updated at 1709015293000Overview
EzyPlatform allows you to use other plugins through linking, where "use" means utilizing the APIs and source code of those plugins. The linking process involves the following:
- Adding dependencies to the project's
pom.xml
file. - Adding the linked plugin's package to the list that needs scanning.
The steps to link a plugin include:
- Install the plugin to be linked.
- Link the plugin.
Install the Plugin to be Linked
Suppose we want to link with the EzyArticle plugin to use its features related to articles and page management. We can follow these steps:
- Start EzyPlatform.
- Download EzyArticle from the marketplace: Go to the
Plugins/Admin
section, click onAdd New
, and search for the plugin. Then install the desired plugin, for example, EzyArticle. If your plugin is not available in the marketplace, you will need to install it via the upload or export section.
Link the Plugin
Ensure that you have installed EZYPLATFORM_SDK
, if not, refer to the instructions here.
Go to the root directory of the project, for example: hello-world
.
Run the command: ezy.sh link [lowercase project name]
, for example: ezy.sh link ezyarticle
.
You can double-check if the pom.xml
files have been added with the necessary dependencies and if the XxxStartupTest
classes have been added to the package to @ComponentsScan annotation to ensure everything is set up correctly.
What will happen when you run the project?
For Admin
If the linked plugin contains an admin plugin, when you run the project, you will see additional menus added to the admin's sidebar.
For Web
If the linked plugin contains a web plugin and exposes APIs, when you run the project, you will be able to use these APIs.
For Socket
If the linked plugin contains a socket app and socket plugin with pre-defined controllers, you can use these controllers.
Next step
You can take a look the structure of a plugin project.