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
  nodeNameProperty: name
  describeByProperty: lastName # will display a contact's last name instead of its JCR path
  sortBy:
    lastName: ascending
    firstName: descending

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.

workspace

required

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

preview

optional

Specifies the parameters for info.magnolia.ui.contentapp.preview.JcrPreviewProvider.

See JCR preview definition for more information.

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. When false, Only nodes and subnodes are displayed.

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 componentColumn 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.

sortBy

optional

List of properties the data source sorts by. Possible values for SortDirection are ascending and descending.

If you set jcrName as a property, you can sort an item by its JCR node name. Setting jcrPath allows you to sort items by their JCR path.

app.yaml
datasource:
   $type: jcrDatasource
   sortBy:
      jcrName: ascending (1)
1 Item sorted by its JCR node name.

jcrObservation

optional

Specifies the parameters for info.magnolia.ui.datasource.jcr.JcrObservationDefinition.

See JCR observation definition for more information.

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 info.magnolia.ui.api.availability.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, info.magnolia.ui.contentapp.JcrDataProvider supports filtering by:

  • Node name (info.magnolia.ui.contentapp.column.jcr.JcrTitleColumnDefinition)

  • Node path (info.magnolia.ui.contentapp.column.jcr.JcrPathColumnDefinition)

  • Publication status (info.magnolia.ui.contentapp.column.jcr.JcrStatusColumnDefinition)

  • Any other JCR property value

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

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the DX Core docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules