Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: MGNLUI-5520

The term Item Provider Strategy refers to a Magnolia 6 UI an abstract logic of accessing form datasource items. It exists in several Several item provider implementations are available in Magnolia 6 UI, covering one of the following two generic uses:

  • In a subapp Data item provider definition in a sub app descriptor, usually in the detail viewsub app
  • Data item provider definition In a form definition for containing composite and complex fields, where a .  In this use, the provider replaces the former field transformer functionality that is part of the UI framework 5.

In a subapp sub app definition

In a subapp sub app definition, a strategy is implemented for example in the Pages app, where the jcrNodeFromLocationProvider is used (see line 16 below). This type of provider resolves a JCR node from location context:

...

A strategy can be used to handle data-read operations in forms containing complex field forms. Item Provider Strategy is a much simpler solution than the 5 UI field transformers. An item provider only needs to know how to access the data. In contrast, the transformers in the 5 UI framework were responsible for both types of data operations - reading and writing. In addition to this:

  • The 6 UI strategy is implemented in a much reduced number of item providers compared to a relatively high number of field transformers in the 5 UI.
  • The implementations can handle also JSON structures, task <link-tasks app> and notifications <notifications app> related items, assets or a specific product content items from a defined product location.

Consider the following definition of a complex field called address, composed of two simple fields, city and country.

...