You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Hippo自定义Essential插件开发:如何添加并自研可安装插件

Hey there! Since you're new to Hippo, let's break down both how to add custom add-ons/plugins and how to develop them from scratch—no jargon overload, promise.

1. How to Install a Custom Hippo Add-on

Getting your custom add-on up and running in your Hippo instance is straightforward:

  • First, confirm your add-on is packaged correctly—Hippo typically uses .jar files, or sometimes a bundled archive with required metadata.
  • Navigate to your Hippo CMS Console (usually at /cms/console for local instances).
  • Find the Add-ons section in the console menu.
  • Click Upload Add-on and select your custom add-on file from your machine.
  • Follow the on-screen prompts: you may need to confirm dependencies, set configuration parameters, and restart the CMS for changes to take effect.
  • After restarting, check the Installed Add-ons list to verify it's active, then start using your new features!
2. Developing a Custom Hippo Add-on: Step-by-Step

Let's walk through building an add-on from the ground up:

2.1 Prep Your Dev Environment

First, make sure you have Java 8+/Maven installed (Hippo relies heavily on these). Then use the Hippo Archetype to create a base project structure—run this in your terminal:

mvn archetype:generate -Dfilter=org.onehippo.cms7:

Pick the hippo-project-archetype (or the one that fits your use case) to set up your project.

2.2 Define Your Add-on's Scope

Be clear on what your add-on will do—e.g., a custom content editor widget, a new workflow action, or an external service integration. This keeps your development focused and avoids scope creep.

2.3 Create the Add-on Module

In your Hippo project, add a new Maven module (conventionally named like my-custom-addon). Update its pom.xml to include key Hippo dependencies:

  • For CMS backend features: org.onehippo.cms7:hippo-cms-api
  • For delivery tier (HST) components: org.onehippo.cms7.hst:hst-core
  • For workflow extensions: org.onehippo.cms7:hippo-addon-workflow

2.4 Build the Core Functionality

Depending on your add-on type, here's a quick overview:

  • Backend Workflow/Service: Extend Hippo's base classes. For example, a custom workflow action:
    public class CustomContentWorkflow extends AbstractWorkflow implements CustomWorkflowInterface {
        @Override
        public void markAsReviewed(Node contentNode) throws RepositoryException {
            // Your custom logic here—update node properties, trigger alerts, etc.
            contentNode.setProperty("custom:review-status", "approved");
            contentNode.save();
        }
    }
    
  • Frontend CMS Widget: Use Hippo's Wicket framework (classic) or Angular-based Essentials. For Wicket, extend Panel to build your UI component.
  • HST Delivery Component: Extend AbstractHstComponent to handle request processing and render custom content on your frontend site.

2.5 Add Configuration & Metadata

Hippo needs to recognize your add-on, so:

  • Create an addon.xml in src/main/resources/META-INF to define your add-on's name, version, dependencies, and config parameters. Example:
    <addon xmlns="http://www.onehippo.org/cms7/addon"
           name="my-custom-addon"
           version="1.0.0">
        <dependencies>
            <addon>org.onehippo.cms7:hippo-addon-workflow</addon>
        </dependencies>
        <configurations>
            <configuration name="custom.review.config">
                <parameter name="notification.email" type="string" required="false"/>
            </configuration>
        </configurations>
    </addon>
    
  • Register backend components (like workflows) in hippoecm-extension.xml so Hippo loads them on startup.

2.6 Package & Test

  • Run mvn clean install in your add-on module to package it into a .jar file.
  • Upload the jar to your local Hippo instance using the steps in Section 1 to test it.
  • Debug issues using Hippo's log files (logs/cms.log or logs/hst.log) or your IDE's debugger.
Pro Tips for New Hippo Developers
  • Always leverage the Hippo core API docs (available in your IDE or bundled with the CMS) for detailed class references—this will save you tons of time when extending base components.
  • Test edge cases, like dependency conflicts or invalid config inputs, to make your add-on robust.
  • Start small! Build a minimal viable version of your add-on first, then iterate with more features.

内容的提问来源于stack exchange,提问作者Gaurav Mulay

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.09 12:27:58