Fork me on GitHub

Developer's How-to: Folder Flat List Picker

Configuring Custom Folder Context Menu Items

You should add a custom folder context menu item configuration like the example in YAML 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:

/exdocCategories:
  jcr:primaryType: frontend:plugin
  wicket.id: ${item}

  // menu item plugin
  plugin.class: org.onehippo.forge.exdocpicker.impl.folder.ExternalDocumentFolderActionWorkflowMenuItemPlugin
  exdocfield.menu.icon: folder-configure.png
  exdocfield.menu.label: Add External Documents...

  // facade implementation
  external.document.service.facade: org.onehippo.forge.exdocpicker.demo.field.ExampleExternalDocumentServiceFacade
  example.external.docs.field.name: exdocpickerbasedemo:exdocs

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