Create a plugin

Updated at 1701533517000

Installing EzyPlatform

You can find installation instructions here.

Installing EzyPlatform SDK

  1. Download the EzyPlatform SDK here.
  2. Unzip the downloaded SDK, for example, into the directory: app/ezyplatform-sdk.
  3. Set up the EZYPLATFORM_SDK environment variable to point to the directory app/ezyplatform-sdk.
  4. Add the $EZYPLATFORM_SDK/bin directory to the PATH environment variable, so you can use the ezy.sh tool.

Building necessary libraries

  1. Clone the ezyplatform-development repository.
  2. Navigate to the cloned ezyplatform-development directory and run the command: bash build.sh.

Creating a plugin project

  1. Move to the directory containing your projects.
  2. You can run the command: ezy.sh and see the project creation guide as follows:
create, create-project, cp, -cp <project name> 
    -g <group name, example: com.your_company> 
    -p [package name, example: com.your_company.my_project] 
    -v [version, example: 1.0.0] 
    -i [inclusive modules: *,admin-plugin,socket-app,socket-plugin,theme,web-plugin] 
    -e [exclusive modules: admin-plugin,socket-app,socket-plugin,theme,web-plugin] 
    -a [author] 
    -o [output directory]: to create a project

Running the plugin project

Make sure you're using Java 8.

Suppose you have just created a project named hello-world.

  1. Navigate to the hello-world directory.
  2. Import the hello-world project into IntelliJ IDE. Note that if your IntelliJ does not recognize the EZYPLATFORM_HOME path variable, you may need to follow the instructions to fix the IntelliJ not recognizing the path variable.
  3. Run the command: bash export.sh to export the project components to EZYPLATFORM_HOME.
  4. Locate the HelloWorldAdminPluginStartupTest file in the hello-world-admin-plugin module within the src/test/[package name]/ directory.
  5. Run this file.
  6. Open a web browser and access the URL: http://localhost:9090 - this is the admin interface.
  7. In the admin interface, navigate to Plugins/Admin, find the hello-world plugin, and activate it.
  8. Restart HelloWorldAdminPluginStartupTest.
  9. Additionally, if you want to start socket-app, socket-plugin, theme, or web-plugin, find the corresponding XxxStartupTest classes in their respective directories.

Configuring the working directory on IntelliJ

By default, IntelliJ will have the working directory set to the root directory, for example, hello-world. However, to enable ezyplatform-tools to automatically reload HTML, CSS, JavaScript, or other static files, we need to specify the correct working directory to the module being executed.

  1. In IntelliJ, go to the run section and select Edit Configurations...
  2. In the Working directory section, point it to the corresponding module where the XxxStartupTest file you want to run is located.

If IntelliJ can not recognize path variable, you can look at here to see how to fix.

Exporting a plugin

To publish a plugin on ezyplatform.com or install a plugin for EzyPlatform on your server, you need to navigate to your plugin project, for example, hello-world, and then export it using the command bash export.sh for Linux or export.bat for Windows.

Check the logs and ensure that no errors are thrown. After that, you will have a zip file located in the hello-world/target/project/hello-world.zip directory. You can use this zip file for publishing or installation.