Fork me on GitHub

Developer's How-to (Flat List View)

Configuring Custom Folder Context Menu Items

You should add a custom folder context menu item configuration like the example (in System View XML format) shown below, under each of the following configuration nodes:

  • /hippo:configuration/hippo:workflows/threepane/folder/frontend:renderer
  • /hippo:configuration/hippo:workflows/threepane/folder-extended/frontend:renderer
  • /hippo:configuration/hippo:workflows/threepane/folder-permissions/frontend:renderer

This is an example with ExampleExternalDocumentServiceFacade having embedded external XML data in a classpath resource:

<?xml version="1.0" encoding="UTF-8"?>
<sv:node sv:name="exdocDocs" xmlns:sv="http://www.jcp.org/jcr/sv/1.0">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
    <sv:value>frontend:plugin</sv:value>
  </sv:property>
  <sv:property sv:name="plugin.class" sv:type="String">
    <sv:value>org.onehippo.forge.exdocpicker.impl.folder.ExternalDocumentFolderActionWorkflowMenuItemPlugin</sv:value>
  </sv:property>
  <sv:property sv:name="wicket.id" sv:type="String">
    <sv:value>${item}</sv:value>
  </sv:property>
  <sv:property sv:name="exdocfield.menu.icon" sv:type="String">
    <sv:value>folder-configure.png</sv:value>
  </sv:property>
  <sv:property sv:name="exdocfield.menu.label" sv:type="String">
    <sv:value>Add External Documents ...</sv:value>
  </sv:property>
  <sv:property sv:name="external.document.service.facade" sv:type="String">
    <sv:value>org.onehippo.forge.exdocpicker.demo.field.ExampleExternalDocumentServiceFacade</sv:value>
  </sv:property>
  <sv:property sv:name="example.external.docs.field.name" sv:type="String">
    <sv:value>exdocpickerbasedemo:exdocs</sv:value>
  </sv:property>
</sv:node>
          

Implementing your ExternalDocumentServiceFacade class

See an example ExternalDocumentServiceFacade implementation code here: https://github.com/bloomreach-forge/external-document-picker/tree/master/demo/cms/src/main/java/org/onehippo/forge/exdocpicker/demo/field/ExampleExternalDocumentServiceFacade.java

Put your own implementation class in your CMS module project.

See Javadocs for detail about the ExternalSearchServiceFacade.

Plugin Parameters

You may configure the following plugin parameters in the folder workflow's frontend:renderer configuration node. e.g, /hippo:configuration/hippo:workflows/threepane/folder/frontend:renderer.

Parameter name Description Example value(s) Default value(s)
exdocfield.menu.icon Icon image name for the custom folder context menu item. The icon image will be looked up from the classpath:org/onehippo/forge/exdocpicker/impl/folder/. So, if this parameter is set to "folder-configure.png", then you should put the image file into the corresponding path in your CMS authoring web application. e.g, cms/src/main/resources/org/onehippo/forge/exdocpicker/impl/folder/folder-configure.png "Add External Documents ..."
exdocfield.menu.label Lable for the custom folder context menu item. "Add External Documents ..."
external.document.service.facade org.onehippo.forge.exdocpicker.api.ExternalDocumentServiceFacade implementation class FQN. "org.onehippo.forge.exdocpicker.demo.field.ExampleExternalDocumentServiceFacade"
selection.mode External document selection mode. Either 'single' or 'multiple'. If this is 'single', then users can select only one external document item in the UI. Otherwise, users can select multiple external document items. "single" or
"multiple"
"multiple"
dialog.size The size of the picker popup dialog. "width=600,height=400" "width=835,height=650"
initial.search.enabled Flag whether the popup dialog box will search external documents initially when opening up. true false
initial.search.query Search query string or search term when the initial search is made in the dialog box when opening up if initial.search.enabled is set to true.

Note: it's up to the ExternalDocumentServiceFacade implementation to determine how to deal with the search query argument.
"*" ""
page.size The page size (item count per page) in the popup dialog. 10 5

Plugin Specific Parameters of ExampleExternalDocumentServiceFacade

The following parameters are set for the ExampleExternalDocumentServiceFacade implementation additionally.

Parameter name Description Example value(s) Default value(s)
example.external.docs.field.name The physical node property name to read from or store to when selection an external document. exdocpickerbasedemo:relatedexdocids