Start page / Plug-In Development / ContentCreator Extensions / Interactive Features / Toolbar Menu Items / Functional Overview
Toolbar Menu Items: Functional Overview
The toolbar menu “Actions” can include both plug-in actions as well as scripts and make these available to users.
When one item is selected from the menu, the associated Java action or Beanshell script is executed within the context of the currently displayed page reference.
Some (or all) of these menu items can be assigned to a project-specific action menu which can be found under a special icon in the menu bar.
See also page Requirements in Chapter “ContentCreator”.
Functionality
Custom menu actions are inserted into the toolbar menu “Actions”.
- Beanshell scripts that exist in the Template Store folder “Scripts” and are configured with the script type “Menu” (see Chapter about Scripts).
- Menu actions installed via FirstSpirit Modules
- Additionally, workflows (defined in the Template Store folder “Workflows”) that can operate outside of a web page context (“context-free”) are displayed in this menu (see Chapter about Workflows).
When a menu item is selected, the Beanshell script or operational method of the corresponding Java class is called. This action will then work within the context of the page reference currently displayed in the preview pane.
Example Implementation
The ContentCreator Examples module source code includes one implementation of a toolbar menu item plug-in:
- PageInfoToolbarActionsItemsPlugin
provides a menu item in the “Actions” toolbar menu that is always visible: - The menu item “Direct link address to this page” uses JavaScript to display a message box with a URL that may be selected and copied. This link provides a deep link towards the current preview page and will enable another browser instance to load this page inside ContentCreator's interface directly, including a redirect to the authentication page if necessary.
This example is located in the module's package de.espirit.firstspirit.opt.example.webedit.toolbar.
Code Example
The Toolbar Menu Item Code Example introduces and documents the implementation workflow and points out general considerations in designing menu item plug-ins.