JCR data source

The JCR data source provides a flat or hierarchical structure of JCR nodes from a given JCR workspace in a specified root path.

The JCR data source is part of the Magnolia 6 UI framework. The fully qualified class name is info.magnolia.ui.datasource.jcr.JcrDatasourceDefinition.

If you work with the Magnolia 5 UI framework, see Content connector instead.

Example definition

datasource:
  $type: jcrDatasource
  workspace: contacts
  includeProperties: true
  preview:
    nodeName: photo
  allowedNodeTypes:
    - mgnl:contact
    - mgnl:folder
  describeByProperty: lastName #will display a contact last name instead of its JCR path, e.g. Bach instead of /jsbach

List of properties

Property Description

class or $type

required

Use info.magnolia.ui.datasource.jcr.JcrDatasourceDefinition for the class property or jcrDatasource for the $type shortcut.

preview

required

Specifies the parameters for JcrPreviewProvider.

See JCR preview definition for more information.

workspace

required

Name of the workspace in the magnolia repository you want to browse.

allowedNodeTypes

optional

List of node types the data source operates on. If no value is specified, the data source will operate on all node types.

describeByProperty

optional

Value must be a JCR property present on the nodes of the corresponding workspace. If the node does not contain the given property, the node path will be used instead.

includeProperties

optional, default is false

When true, shows JCR properties of the node. Only nodes and subnodes are displayed when false.

includeSystemNodes

optional, default is false

When true, shows system nodes.

includeSystemProperties

optional, default is false

When true, shows system properties.

name

optional, default is jcr

Name of the data source.

nodeNameProperty

optional

Name of a JCR property displayed by jcrTitleColumn that stores node names including special characters.

When configuring nodeNameProperty, make sure you have a field with the same name for the node names to be handled correctly.

rootPath

optional, default is /

Path configured as the root of the workspace. Only content below the path is operated on.

sortable

optional, default is false

When true, the list of nodes can be sorted.

sortByProperties

optional

List of JCR properties the data source sorts by. For this to work, you have to set sortable to true. If no value is specified, describeByProperty will be used instead.

Data source components

Module component mappings can be defined in the context of the current data source (a component section should have an id in the form of <id>datasource-<ds-name></id>, where <ds-name> is configured in the definition).

Type Implementation Description

info.magnolia.ui.field.SelectFieldSupport

info.magnolia.ui.field.JcrSelectFieldSupport

Provides delegates required by select fields.

info.magnolia.ui.datasource.ItemResolver

info.magnolia.ui.contentapp.JcrNodeResolver

Converts path to actual item and back.

info.magnolia.ui.contentapp.version.VersionResolver

info.magnolia.ui.contentapp.version.JcrVersionResolver

Looks up version of selected item.

info.magnolia.ui.contentapp.browser.preview.PreviewProvider

info.magnolia.ui.contentapp.preview.JcrPreviewProvider

Provides preview of selected item (for example, content of a binary node or link to an image).

info.magnolia.ui.datasource.PropertySetFactory

info.magnolia.ui.contentapp.JcrPropertySetFactory

Reads and writes properties from/to item in form.

info.magnolia.ui.contentapp.Datasource

info.magnolia.ui.datasource.jcr.JcrDatasource

Modifies items in grid for JCR data source.

info.magnolia.ui.availability.AvailabilityChecker

info.magnolia.ui.availability.JcrAvailabilityChecker

Checks whether items comply with the criteria defined in AvailabilityDefinition.

info.magnolia.ui.observation.DatasourceObservation

info.magnolia.ui.contentapp.observation.JcrDataSourceObservation

Observation utility wrapper used in UI framework.

info.magnolia.ui.contentapp.browser.ItemInteractionAvailability

info.magnolia.ui.contentapp.JcrItemInteractionAvailability

Checks whether item is available for interaction (selection, editing, etc).

info.magnolia.ui.contentapp.ItemDescriber

info.magnolia.ui.contentapp.JcrItemDescriber

Displays description for selected item(s) at the bottom of app.

info.magnolia.ui.contentapp.browser.ListPresenter

info.magnolia.ui.contentapp.browser.TreePresenter

info.magnolia.ui.contentapp.browser.ThumbnailPresenter

info.magnolia.ui.contentapp.JcrListPresenter

info.magnolia.ui.contentapp.JcrTreePresenter

info.magnolia.ui.contentapp.JcrThumbnailPresenter

Displays items as list, tree or thumbnails. See also JCR component filtering.

Component mappings in module descriptor
<components>
  <id>datasource-jcr</id>
  <component>
    <type>info.magnolia.ui.field.SelectFieldSupport</type>
    <implementation>info.magnolia.ui.field.JcrSelectFieldSupport</implementation>
  </component>
  <component>
    <type>info.magnolia.ui.datasource.ItemResolver</type>
    <implementation>info.magnolia.ui.contentapp.JcrNodeResolver</implementation>
  </component>
  <component>
    <type>info.magnolia.ui.contentapp.version.VersionResolver</type>
    <implementation>info.magnolia.ui.contentapp.version.JcrVersionResolver</implementation>
  </component>
  <component>
    <type>info.magnolia.ui.contentapp.browser.preview.PreviewProvider</type>
    <implementation>info.magnolia.ui.contentapp.preview.JcrPreviewProvider</implementation>
  </component>
  <component>
    <type>info.magnolia.ui.datasource.PropertySetFactory</type>
    <implementation>info.magnolia.ui.contentapp.JcrPropertySetFactory</implementation>
  </component>
  <component>
    <type>info.magnolia.ui.contentapp.Datasource</type>
    <implementation>info.magnolia.ui.datasource.jcr.JcrDatasource</implementation>
  </component>
  <component>
    <type>info.magnolia.ui.availability.AvailabilityChecker</type>
    <implementation>info.magnolia.ui.availability.JcrAvailabilityChecker</implementation>
  </component>
  <component>
    <type>info.magnolia.ui.observation.DatasourceObservation</type>
    <implementation>info.magnolia.ui.contentapp.observation.JcrDataSourceObservation</implementation>
  </component>
  <component>
    <type>info.magnolia.ui.contentapp.browser.ItemInteractionAvailability</type>
    <implementation>info.magnolia.ui.contentapp.JcrItemInteractionAvailability</implementation>
  </component>
  <component>
    <type>info.magnolia.ui.contentapp.ItemDescriber</type>
    <implementation>info.magnolia.ui.contentapp.JcrItemDescriber</implementation>
  </component>
  <type-mapping>
    <type>info.magnolia.ui.contentapp.browser.ListPresenter</type>
    <implementation>info.magnolia.ui.contentapp.JcrListPresenter</implementation>
  </type-mapping>
  <type-mapping>
    <type>info.magnolia.ui.contentapp.browser.TreePresenter</type>
    <implementation>info.magnolia.ui.contentapp.JcrTreePresenter</implementation>
  </type-mapping>
  <type-mapping>
    <type>info.magnolia.ui.contentapp.browser.ThumbnailPresenter</type>
    <implementation>info.magnolia.ui.contentapp.JcrThumbnailPresenter</implementation>
  </type-mapping>
</components>

JCR component filtering

In columns, JcrDataProvider supports filtering by:

Because filter objects are shared between views, the same filter components should be available in both tree and list views (except for JcrPathColumnDefinition, which is expected to be only in the list view).
Feedback