Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Magnolia 5 UI field transformer classes no  no longer exist in the Magnolia 6 UI framework. Their functionality has been replaced there by the

Javadoc resource link
classNameinfo.magnolia.ui.framework.databinding.ItemProviderStrategy
renderTypeasynchronous
interface - abstract logic for accessing form datasource items.

Most of the original transformer functions are realized in the 6 UI using data binding item providers and handlers, for example by FetchJcrSubNode or JcrChildNodeOrderHandler. The following tables describe the nature of the ports in more detail.

. The transformer functionality is now distributed among different components. The following is a summary of what the components do:

  • Modify the target property name by appending a locale suffix or by prepending a field prefix. This is done by concrete PropertySet implementations (JcrItemPropertySet) and/or by PropertyNameDecorator.
  • Resolve an item data source of complex fields, a functionality usually covered by item providers.
  • Manage item data sources of multi-value field entries. This is handled by MultiFormView.EntryResolution, which resolves the children and binds each of them to the item provider strategy.

Table of Contents

Replacements for transformers

Default classes

Default 5 UI transformer classes

(info.magnolia.ui.form.field.transformer.*)
Magnolia 6 UI equivalents
basic.BasicTransformer Not needed. Its functions are obsolete; some are taken over by Vaadin PropertySet.
composite.CompositeTransformer

Use info.magnolia.ui.editor.CurrentItemProvider and set propertyNameDecorator to info.magnolia.ui.field.PrefixNameDecorator.

composite.SwitchableTransformer

Use info.magnolia.ui.editor.CurrentItemProvider and set propertyNameDecorator to info.magnolia.ui.field.PrefixNameDecorator.

Other classes

Other available 5 UI transformer classes

(info.magnolia.ui.form.field.transformer.*)
Magnolia 6 UI equivalents
composite.DelegatingCompositeFieldTransformerUse info.magnolia.ui.editor.CurrentItemProvider.
composite.NoOpCompositeTransformercompositeNot needed.DelegatingCompositeFieldTransformer
multi.DelegatingMultiValueFieldTransformermulti.MultiValueJSONTransformermulti.MultiValueChildrenNodeTransformermulti.MultiValueChildNodeTransformerUse info.magnolia.ui.editor.CurrentItemProvider.
multi.DelegatingMultiValueSubnodeTransformer

Use info.magnolia.ui.editor.JcrChildNodeProvider and set:

  • supportI18N to false
  • entryResolution to info.magnolia.ui.editor.MultiFieldEntryResolution$Definition
  • propertyNameDecorator to info.magnolia.ui.field.AlwaysEmptyPrefixNameDecorator
multi.MultiValueChildNodeTransformerDeprecated, no automatic conversion.
multi.MultiValueChildrenNodeTransformerDeprecated, no automatic conversion.
multi.MultiValueJSONTransformerDeprecated, no automatic conversion.
multi.MultiValueSubChildrenNodePropertiesTransformer

Use info.magnolia.ui.editor.JcrChildNodeProvider and set:

  • supportI18N to false
  • entryResolution to the now deprecated info.magnolia.ui.editor.ByLexicographicallyIndexedChildNodes$Definition
  • orderHandler to the now deprecated info.magnolia.ui.editor.LexicographicallyIndexedJcrNodeOrderHandler$Definition
multi.MultiValueSubChildrenNodeTransformerDeprecated, no automatic conversion.

Personalization transformers

Transformers with personalization-related functions still use the Magnolia 5 UI framework (magnolia-personalization-compatibility).

info.magnolia.personalization.* Description
cookie.CookieFieldTransformerCustom transformer for cookie traits.
ui.SimpleTraitValueTransformerNow functions as the default trait transformer.
visitor.transformer.VisitorTraitListToSetTransformerStill exists, but is no longer needed.

Example definitions

The following configurations in both frameworks will produce the same results.

Magnolia 5 UIMagnolia 6 UI
Code Block
languageyml
collapsetrue
form:
  tabs:
    - name: tabSwitch
      fields:
        - name: switchable
          fieldType: switchable
          options:
            - name: text
              value: text
            - name: richText
              value: richText
          fields:
            - name: text
              fieldType: text
            - name: richText
              fieldType: richText

    - name: tabMultiBasic
      fields:
        - name: multitext
          fieldType: multiValue
          transformerClass: info.magnolia.ui.form.field.transformer.multi.DelegatingMultiValueFieldTransformer
          field:
            name: text
            fieldType: text

    - name: tabMultiDeleg
      fields:
        - name: items
          fieldType: multiValue
          transformerClass: info.magnolia.ui.form.field.transformer.multi.DelegatingMultiValueSubnodeTransformer
          field:
            name: itemComposite
            fieldType: composite
            transformerClass: info.magnolia.ui.form.field.transformer.composite.DelegatingCompositeFieldTransformer
            fields:
              - name: text
                fieldType: text
              - name: link
                fieldType: text

    - name: tabMultiLex
      fields:
        - name: itemsLex
          fieldType: multiValue
          transformerClass: info.magnolia.ui.form.field.transformer.multi.MultiValueSubChildrenNodePropertiesTransformer
          field:
            name: itemComposite
            fieldType: composite
            transformerClass: info.magnolia.ui.form.field.transformer.composite.NoOpCompositeTransformer
            fields:
              - name: text
                fieldType: text
              - name: link
                fieldType: text
Code Block
languageyml
collapsetrue
form:
  properties:
    switchable:
      $type: switchableField
      field:
        $type: radioButtonGroupField
        datasource:
          $type: optionListDatasource
          options:
            - name: text
              value: text
            - name: richText
              value: richText
      itemProvider:
        $type: currentItemProvider
      propertyNameDecorator: info.magnolia.ui.field.PrefixNameDecorator
      forms:
        - name: text
          properties:
            text:
              $type: textField
        - name: richText
          properties:
            richText:
              $type: richTextField

    multitext:
      $type: jcrMultiField
      itemProvider:
        $type: currentItemProvider
      field:
        name: text
        $type: textField

    items:
      $type: jcrMultiField
      itemProvider:
        $type: jcrChildNodeProvider
        supportI18N: false
      entryResolution:
        class: info.magnolia.ui.editor.MultiFieldEntryResolution$Definition
        propertyNameDecorator: info.magnolia.ui.field.AlwaysEmptyPrefixNameDecorator
      field:
        $type: compositeField
        properties:
          text:
            $type: textField
          link:
            $type: textField

    itemsLex:
      $type: jcrMultiField
      itemProvider:
        $type: jcrChildNodeProvider
        supportI18N: false
      entryResolution:
        class: info.magnolia.ui.editor.ByLexicographicallyIndexedChildNodes$Definition
      orderHandler:
        class: info.magnolia.ui.editor.LexicographicallyIndexedJcrNodeOrderHandler$Definition
      field:
        $type: compositeField
        properties:
          text:
            $type: textField
          link:
            $type: textField
multi.MultiValueSubChildrenNodeTransformer