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 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 | ||||
---|---|---|---|---|---|
|
required Use |
||||
|
required Name of the workspace in the |
||||
|
optional Specifies the parameters for info.magnolia.ui.contentapp.preview.JcrPreviewProvider. See JCR preview definition for more information. |
||||
|
optional List of node types the data source operates on. If no value is specified, the data source will operate on all node types. |
||||
|
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. |
||||
|
optional, default is When |
||||
|
optional, default is When |
||||
|
optional, default is When |
||||
|
optional, default is Name of the data source. |
||||
|
optional Name of a JCR property displayed by
|
||||
|
optional, default is Path configured as the root of the workspace. Only content below the path is operated on. |
||||
|
optional List of properties the data source sorts by.
Possible values for
|
||||
|
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 |
---|---|---|
|
|
Provides delegates required by select fields. |
|
|
Converts path to actual item and back. |
|
|
Looks up version of selected item. |
|
|
Provides preview of selected item (for example, content of a binary node or link to an image). |
|
|
Reads and writes properties from/to item in form. |
|
|
Modifies items in grid for JCR data source. |
|
|
Checks whether items comply with the criteria defined in info.magnolia.ui.api.availability.AvailabilityDefinition. |
|
|
Observation utility wrapper used in UI framework. |
|
|
Checks whether item is available for interaction (selection, editing, etc.,). |
|
|
Displays description for selected item(s) at the bottom of app. |
|
|
Displays items as list, tree or thumbnails. See also JCR component filtering. |
<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). |