Defining the Menu and the Toolbar

In the menuBar.xml and toolBar.xml files, the menu and the toolbar of the Content Navigator are composed from individual menu items (beans). The items available are listed in the itemRegistry.xml file. Other content-specific menu items and buttons on the toolbar can be defined in the contentMenu.xml file (see Configuring Custom Commands). Take a look at this example from the menuBar.xml file:

<menu name="file">
  <title lang="en">File</title>
  <title lang="de">Datei</title>
  <group name="object" contexts="object, select.object">
    <group name="new">
      <title lang="en">New</title>
      <title lang="de">Neu</title>
      <title lang="fr">Nouveau</title>
      <item>create_object_document</item>
      <item>create_object_publication</item>
      <item>create_object_image</item>
      <item>create_object_generic</item>
      <item roles="admin">create_object_template</item>
    </group>
    <item separated="true">import_file</item>
  </group>
  <item contexts="bookmark">create_bookmark_folder</item>
  <group separated="true" name="search" contexts="*.object">
    <item contexts="object, select.object">search_objects</item>
    <!-- insert saved searches here-->
  </group>
  <item contexts="object" separated="true">logout</item>
</menu>

The definitions of the items on the toolbar is specified analogously. However, it does not include a hierarchy (submenu) because the toolbar has no subitems:

<toolBar>
  <group name="object" contexts="object">
    <item>create_object_document</item>
    <item>create_object_publication</item>
    <item roles="admin">import_file</item>
    <item separated="true">finish_tasks</item>
    <item separated="true">search_panel</item>
  </group>
  <group name="edit" separated="true">
    <item>cut_into_clipboard</item>
    <item>copy_into_clipboard</item>
    <item contexts="object">paste_objects</item>
    <item contexts="bookmark">paste_bookmarks</item>
    <item contexts="object">delete_object</item>
    <item contexts="bookmark">delete_bookmarks</item>
  </group>
  <group name="view" separated="true" roles="admin">
    <item contexts="object">browser_preview</item>
    <item>browser_tree</item>
    <item>browser_columns</item>
    <item>browser_list</item>
    <item contexts="object">browser_icons</item>
    <separator/>
    <item contexts="object">preview</item>
    <item>view_mode</item>
    <item>refresh</item>
  </group>
  <separator/>
  <item>online_help</item>
  <item>logout</item>
</toolBar>

Each item in a menu or in a toolbar refers to a bean in the beans element of itemRegistry.xml. For example

<item>about_nps</item>

refers to the following item in itemRegistry.xml and includes it in the toolbar:

<bean id="about_nps"
    class="com.infopark.cm.htmlgui.browse.menuaction.OpenSubpage">
  <property name="titles"><map>
    <entry key="de"><value>Über Infopark CMS Fiona</value></entry>
    <entry key="en"><value>About Infopark CMS Fiona</value></entry></map>
  </property>
  <property name="subpage"><value>AboutNPS</value></property>
  <property name="selectionType"><value>none</value></property>
  <property name="dialogSize"><value>large</value></property>
</bean>

The group element gives you the possibility to group elements together without making this grouping visible in the menu or toolbar. If the group contains a dividing line (separator), and none of the items it contains (see below) can be selected (due to restrictions), the group will be completely hidden, i. e. including the separator. This helps to avoid two adjacent separators (without menu items between them).

Furthermore, the group element can be used to restrict the visibility of the items it contains to particular Content Navigator pages. This can be achieved by means of the contexts attribute that can have the following values:

  • object: the items in this group are visible if a file has been selected in the main window of the Content Navigator.
  • bookmark: the elements in this group are visible if bookmarks are being edited in the Content Navigator.
  • select.object: the elements in the group are visible if a file is selected using the file selection dialog in the Content Navigator.
  • search.object: the elements in the group are visible if a file is being searched for on the search page.

Using the roles attribute, groups of menu commands as well as individual menu commands can be restricted to particular user interfaces. See also the gui.roles system configuration entry in the gui.xml file.

The properties of beans of the class com.infopark.cm.htmlgui.browse.menuaction.OpenSubpage have the following meaning.

  • titles determines the multi-language titles of dialog pages.
  • subpage determines the names of a dialog page.
  • selectionType determines the selection of files to which a menu command can be applied: none = globally (no file), single = a single file, extended = a list of files.
  • dialogSize determines the size of the dialog window. Permitted values are small, medium, and large.