Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: MOTION-157

...

A connector definition specifies the data source. In case of a JCR connector, the definition requires you to specify a workspace and a path in that workspace. Each content app subapp must provide its own content connector definition. If you implement your own connector, extend info.magnolia.ui.vaadin.integration.contentconnector.ContentConnectorDefinition.

enableHighlighting
Localtab Group
Localtab
titleYAML
Code Block
languagejs
subapps:
  browser:
    contentConnector:
      class: info.magnolia.ui.vaadin.integration.contentconnector.JcrContentConnectorDefinition
      implementationClass: info.magnolia.ui.vaadin.integration.contentconnector.JcrContentConnector
Localtab
titleJCR node
Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
false
Node nameValue
Mgnl f
subApps

Mgnl n
browser

Mgnl n
contentConnector

Mgnl p
class

info.magnolia.ui.vaadin.integration.contentconnector.JcrContentConnectorDefinition

Mgnl p
implementationClass

info.magnolia.ui.vaadin.integration.contentconnector.JcrContentConnector

Properties:

class

optional, default is info.magnolia.ui.vaadin.integration.contentconnector.JcrContentConnectorDefinition

Definition class. Only needed if you implement your own, non-JCR content connector. If you store content in the JCR repository this property is not needed but you need to define a number of other properties. See the JCR content connector example below. The value must be a fully-qualified class name.

Examples of definition classes:

  • info.magnolia.ui.vaadin.integration.contentconnector.ContentConnectorDefinition: Basic content connector definition interface. Implement this in your custom definition class.
  • info.magnolia.ui.vaadin.integration.contentconnector.JcrContentConnectorDefinition: Defines a connector that operates on the JCR repository.
implementationClass

optional, default is info.magnolia.ui.vaadin.integration.contentconnector.JcrContentConnector

Implementation class that implements the 

Javadoc resource link
classNameinfo.magnolia.ui.vaadin.integration.contentconnector.ContentConnector
 interface. If you store content in the JCR repository this property is not needed. The value must be a fully-qualified class name.

...

A JCR content connector definition introduces properties that identify a JCR workspace as a data source. It also defines the node types to operate on.

...

false
Code Block
languagejs
subapps:
  browser:
    contentConnector:
      defaultOrder: jcrName
      includeProperties: false
      rootPath: /
      workspace: contacts
      nodeTypes: 
        - name: mgnl:contact  
          icon: icon-user-public        
Localtab
titleJCR node
Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlighting
Node nameValue
Mgnl f
subApps

Mgnl n
browser

Mgnl n
contentConnector

Mgnl n
nodeTypes

Mgnl n
contact

Mgnl p
icon

icon-user-public

Mgnl p
name

mgnl:contact

Mgnl p
defaultOrder

jcrName

Mgnl p
includeProperties

false

Mgnl p
rootPath

/

Mgnl p
workspace

contacts

Properties:

nodeTypes

required

List of node types the content connector operates on. For example, the connector in the Contacts app displays contacts and folders.

<node‑type‑name>

required

Arbitrary node name such as contact if you are displaying contacts in the browser.

name

required

Node type the connector operates on. These are Magnolia or JCR node types such as  mgnl:contact.

icon

optional , default is none

CSS class name of the icon displayed on the workbench. See the default icons that ship with Magnolia or create your own.

strict

optional

Specifies whether to include only the exact node type and ignore subtypes. 

hideInList

optional

Specifies whether to display the current node in list view. Use this property to, for example, exclude folders.

workspace

required

workspace in the magnolia repository that you want to browse.

defaultOrder

optional

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.

includeProperties

optional, default is false

Displays also the JCR properties of the node when set to true. Only nodes and subnodes are displayed when false.

includeSystemNodes

optional , default is false

Displays also nodes used by the system such as nodes internal to the operations of the JCR implementation. Set to true if you want to see image renditions in the imaging workspace for example.

rootPath

optional , default is / (root)

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

...

The connect definition for a detail subapp is much simpler. You only need to define the workspace.  

...

JCR node
Code Block
languagejs
subapps:
  detail:
    contentConnector:
      workspace: contacts
Localtab
title
Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
Node nameValue
Mgnl f
subApps

Mgnl n
detail

Mgnl n
contentConnector

Mgnl p
workspace

contacts

Example: non-JCR content connector

This is an example content connector definition for a content app that manages files on the local file system. This is a simplified example.

...

/Users/jsmith/Documents/magnolia
titleYAML
Code Block
languagejs
title../apps/fs-browser-app/fs-browser.yaml
subApps:
  browser:
    contentConnector:
      class: info.magnolia.filesystembrowser.app.contentconnector.FSContentConnectorDefinition
      rootFolder: 
/Users/jsmith/Documents/magnolia
Localtab
titleJCR node
Advanced Tables - Table Plus
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
Node nameValue
Mgnl f
fs-browser-app

Mgnl f
apps

Mgnl n
fs-browser

Mgnl n
subApps

Mgnl n
browser

Mgnl n
contentConnector

Mgnl p
class

info.magnolia.filesystembrowser.app.contentconnector.FSContentConnectorDefinition

Mgnl p
rootFolder


Credits: