You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Amidst a number of successful PoCs, experiments and even productized work (MCTP), this concept aims at formalizing early support for content types in Magnolia, and help feature development move on from there.

High-level requirements

There's general consensus about the following:

[Magnolia needs] a formal definition for a type of content [...] including the fields that type may contain, and its relationships to other types of content.
Based on this definition, other things can be created with little or no work such as a content app, an editing dialog, and REST endpoints.

—via Content Types


What is going to be the format?

At this stage, the format does not matter as much as what we're going to do with it.
It's also unclear why our YAML format should be considered a misfit—we've been pushing it all around the place—or for what use cases it falls short, concretely.

Either way, Magnolia needs awareness of content types. Covering that with a ContentTypeRegistry is a natural starting point, implying a ContentTypeDefinition as well.

With Magnolia 5.4+ config & resource-loading APIs, this is trivial to set up. We get significant value out of the box:

  • light-module conventions
  • visibility inside the definitions app
  • problem reporting
  • familiar YAML format

Should we hit the wall with the registry or format, and get an alternative on par with benefits above, nothing is set in stone. It just allows us to move on with downstream technical challenges.


What does a content-type consist of?

This is also a never-ending topic. We should start small, and add more aspects/features as we go.
In fact, there is potential for many existing Magnolia features to shift under the umbrella of content types, eventually.

As per the high-level vision at the top of this page, the most prominent part of a content-type is its model, its form, its fields.

The model debate

As foreseen, content-types are shifting upstream of apps, that is upstream of any UI/UX consideration.

On the one hand, modeling purists advocate for a strict, dry representation of the model, with almost exclusively primitive property types.
On the other hand, Magnolia has always provided users with pretty loose modeling, driven by field-definitions. The author experience comes first, the data model is deduced from it.

There may be some middle-ground there. With few key improvements, we can keep our familiar field-definitions, while decoupling them from UI/UX considerations.

Again, nothing set in stone. This in turn helps progressing towards generation of content apps and endpoints.

Content type all-the-things :allthethings:

Just for reference, here's a non-exhaustive list of many more aspects a content type could specify:

  • data source (envisioning an evolution of content-connectors, without the Vaadin bits)
    • kind
    • coordinates
    • workspace / table / collection name
    • node types
  • model / fields
    • relationships, 1-to-1, 1-to-many, etc.
    • evolution, content version-handling
  • locales
  • folder-support
  • tagging
  • versioning
  • publication
  • personalization
  • renditions / URI bindings / previews
  • cache policies
  • naming / id strategy
  • ownership model / security
  • consistency model
    • all consistent against latest schema (hence content migration)
    • vs. mixed-model version w/ compatibility
  • ...


Action plan proposal

Based on a registry on one hand, and starting off with a form on the other hand, we can start implementing a minimal user story with a set of concrete actions.
Again, this is non-exhaustive, and we may well add more as we uncover potential roadblocks along the way.


Registration & config

CT01. Pick ContentTypeRegistry + ContentTypeDefinition into a new module  MGNLCT-8 - Getting issue details... STATUS

  • Module will sit above core & config, but below UI
  • Move registry <-> config-source bindings to the new module class
  • tentatively YAML-only to start with


Making FormDefinitions less UI/UX-bound

CT11. Make Form a flat list of Fields  MGNLUI-4245 - Getting issue details... STATUS

  • ditch TabDefinitions in favor of an optional layout config

CT12. Infer field-types vs. types both ways  MGNLCT-10 - Getting issue details... STATUS

  • setting "fieldType": FieldDefinition impls have hard-coded types (already)
  • setting "type": infer a simple field type upon form creation (dialog, app)

CT13. Detach Validators from Vaadin  MGNLUI-4246 - Getting issue details... STATUS

  • boilerplate: must implement:
    • Vaadin Validator
    • Magnolia ValidatorFactory
    • Magnolia ValidatorDefinition
  • switch towards standard Bean Validation (well supported by Vaadin too)
  • provide config short-hands for standard bean validators (max-length, range, etc.)
    • validator-registry?


Connecting the dots w/ JCR, apps, endpoints

CT21. Reuse automatic workspace creation  MGNLCT-9 - Getting issue details... STATUS   MGNLCT-11 - Getting issue details... STATUS

CT22. Connect an existing app or sub-app descriptor to a ContentTypeDefinition  MGNLUI-4247 - Getting issue details... STATUS

  • experimented in Sang's PoC, via plain contentType reference id

CT23. Generate apps on-the-fly, upon AppController#start  MGNLUI-4238 - Getting issue details... STATUS

  • AppDescriptorRegistry listens/delegates fluently to the ContentTypeRegistry
  • broadly speaking, CTR is a source for apps
  • resolve a placeholder DefinitionMetadata
  • use a dynamic DefinitionProvider building the app on-the-fly from the type





  • No labels