Magnolia 5.3 reached end of life on June 30, 2017. This branch is no longer supported, see End-of-life policy.

Page tree
Skip to end of metadata
Go to start of metadata

Workbench is a view that displays a list of content items in a workspace. It is part of the content app framework, typically defined in the browser subapp. The workbench can display the workspace content in three views: tree, list and thumbnail. It also provides a search box.

Here is an example workbench definition from the Contacts app. This workbench operates on the contacts workspace and displays contacts and folders.

(warning) Magnolia 5.3+: The nodeTypes, defaultOrder, includePropertiespath and workspace nodes moved from the workbench definition to the new content connector definition. The path property was renamed to rootPath.

Node nameValue

 browser

 

 workbench

 

 contentViews

 

 tree

 

 list

 

 columns

 

 class

info.magnolia.ui.workbench.list.ListPresenterDefinition

 thumbnail

 

 search

 

 dragAndDrop

false

 dropConstraintClass

info.magnolia.contacts.app.main.tree.ContactDropConstraint

 editable

false

Properties:

  • contentViews: Defines the views how the content is displayed.
    • <content view name>: The available views are treelistthumbnail and search.
      • columns: Column definitions for tree, list and search views. You don't need to define columns for the thumbnail view.
      • class: A presenter class that displays the content in a tree, list, thumbnail or search view. The options are  TreePresenterDefinition ListPresenterDefinition ThumbnailPresenterDefinition  and  SearchPresenterDefinition . Use the fully-qualified class name. If you write your own presenter, look at the  ConfiguredContentPresenterDefinition  which implements the  ContentPresenterDefinition  interface.
      • viewType: Element of the  ViewType  enumeration: TREE, LIST, THUMBNAIL or SEARCH. You only need this property when you write your own view presenter.
      • implementationClass: In a workbench, the implementation class responsible for creating, configuring and updating the view. Typically a default implementation class is already hard-coded in the definition class. You only need to add this property if you want to override the default implementation with your own.

      • icon: CSS class that identifies an icon used on the view tab. For available names see Icons.
      • active: Defines whether the view is active. Default is true.
  • dragAndDrop: (warning) Magnolia 5.3.16+ Set to false to disable drag and drop operations in the workbench. Default is true.
  • dropConstraintClass: Drag and drop constraint class. By restricting the nodes that a user can move you can enforce a hierarchy. For example, you might want to allow moving of content nodes under folders but not under other content nodes. If the class is not defined, the tree view will have no drag and drop capability. When you write your own class, implement the  DropConstraint  interface.
  • editable: Makes the data displayed in the workbench editable inline. When the user double-clicks the cell it becomes an editable field.

(warning) Magnolia 5.2 and earlier:

Node nameValue

 browser

 

 workbench

 

 nodeTypes

 

 contact

 

 icon

icon-user-public

 name

mgnl:contact

 folder

 

 icon

icon-folder-l

 name

mgnl:folder

 contentViews

 

 tree

 

 list

 

 columns

 

 class

info.magnolia.ui.workbench.list.ListPresenterDefinition

 thumbnail

 

 search

 

 defaultOrder

jcrName

 dropConstraintClass

info.magnolia.contacts.app.main.tree.ContactDropConstraint

 editable

false

 includeProperties

false

 path

/

 workspace

contacts

Properties:

  • nodeTypes:  The types of content displayed in the workbench. For example, the workbench in the Contacts app displays contacts and folders.
    • <node type name>
      • icon:CSS class name of the icon displayed on the workbench. See the default icons that ship with Magnolia or create your own.
      • nameNode type the workbench operates on. These are Magnolia or JCR node types such as mgnl:contact.
  • contentViews: Defines the views how the content is displayed.
    • <content view name>: The available views are treelistthumbnail and search.
      • columns: Column definitions for tree, list and search views. You don't need to define columns for the thumbnail view.
      • class: A presenter class that displays the content in a tree, list, thumbnail or search view. The options are  TreePresenterDefinition ListPresenterDefinition ThumbnailPresenterDefinition  and  SearchPresenterDefinition . Use the fully-qualified class name. If you write your own presenter, look at the  ConfiguredContentPresenterDefinition  which implements the  ContentPresenterDefinition  interface.
      • viewType: Element of the  ViewType  enumeration: TREE, LIST, THUMBNAIL or SEARCH. You only need this property when you write your own view presenter.
      • implementationClass: In a workbench, the implementation class responsible for creating, configuring and updating the view. Typically a default implementation class is already hard-coded in the definition class. You only need to add this property if you want to override the default implementation with your own.

      • icon: CSS class that identifies an icon used on the view tab. For available names see Icons.
      • active: Defines whether the view is active. Default is true.
  • defaultOrder: Default sort order for the content items in list views. The value is the name of the property you want to sort by, such as jcrName.
  • dropConstraintClass: Drag and drop constraint class. By restricting the nodes that a user can move you can enforce a hierarchy. For example, you might want to allow moving of content nodes under folders but not under other content nodes. If the class is not defined, the tree view will have no drag and drop capability. When you write your own class, implement the  DropConstraint  interface.
  • editable: Makes the data displayed in the workbench editable inline. When the user double-clicks the cell it becomes an editable field.
  • includeProperties: Displays also the JCR properties of the node when set to true. Only nodes and subnodes are displayed when false.
  • path: Path configured as root for this workspace. Only content below the path is operated on. If not specified, defaults to workspace root (/).
  • workspace: The workspace in the magnolia repository where the content resides.