UI Plugin Application
A UI plugin application in Bloomreach Content is a web application configured entirely from the repository. Each application consists of a single page, "Home," and is built from a set of plugins defined in the repository at /hippo:configuration/hippo:frontend.
Example
The following example shows two application configurations, "foo" and "bar," defined in YAML format:
/hippo:configuration: jcr:primaryType: hipposys:configuration /hippo:frontend: jcr:primaryType: hipposys:applicationfolder /foo: jcr:primaryType: frontend:application /bar: jcr:primaryType: frontend:application
Each application must include a plugin that registers an IRenderService under the name service.root. The Home page for the application adds the Wicket component from this service (see IRenderService.getComponent()) when the service is registered. To implement this, create a plugin that implements IRenderService. The recommended approach is to extend the RenderPlugin class. This class registers the plugin as the service and provides the Wicket component for the UI hierarchy.
public class RootPlugin extends RenderPlugin { public RootPlugin(IPluginContext context, IPluginConfig config) { super(context, config); addExtensionPoint("extension"); } }
When instantiated and configured, this plugin registers itself as the service.root render service. It listens for other render services registered under the service name that "extension" references. When such a service is registered, the plugin adds it to the component hierarchy. If no service is registered under "extension," the plugin displays an empty panel.
The plugins defined in the repository must match the Wicket components expected in the HTML template for RootPlugin. For example, if the root component uses the following HTML:
<html xmlns:wicket="http://wicket.apache.org/"> <wicket:panel> <p> <div wicket:id="extension">[sub plugin will be rendered here]</div> </p> </wicket:panel> </html>
the corresponding repository structure to generate the correct component hierarchy is:
/hippo:configuration: jcr:primaryType: hipposys:configuration /hippo:frontend: jcr:primaryType: hipposys:applicationfolder /application: jcr:primaryType: frontend:application /cluster: jcr:primaryType: frontend:plugincluster /RootPlugin: jcr:primaryType: frontend:plugin plugin.class: org.example.RootPlugin wicket.id: service.root wicket.extension: service.extension /subPlugin: jcr:primaryType: frontend:plugin plugin.class: org.example.subPlugin wicket.id: service.extension
Both frontend:plugin nodes, RootPlugin and subPlugin, require a plugin.class property that specifies the fully qualified class name of the plugin.