New: wcm.io WCM Core Components 1.0.0

wcm.io has a new module: the WCM Core Components. They are not a replacement the AEM Sites Core Components, but extend them in a natural way with the wcm.io Handler features.

Why WCM Core Components

Adobe provides AEM developers with a set of Core Components that should be the starting point for every AEM application. The team from Adobe did a fantastic job in creating them, and in the decision to create an Open Source community around them.

However, from the viewpoint of wcm.io-based AEM applications, the AEM Sites Core Components have some conceptual shortcomings that are currently “baked” into the API and the implementation that limit their usage and do not allow to re-use technical aspects:

  • The image (media) handling is only implemented in a black box “image component”, with a proprietary and non HTML-standard way to display the images in a responsive fashion. The only solution to re-use the “image” functionality in another component is to embed it, which is an awkward pattern with a lot of limitations.

  • The handling of internal and external links is inconsistent across the different components and does not allow to take central control of it. And it’s not possible to re-use this limited link handling support in custom components.

  • Detection of the current site root page is inconsistent across the components and the logic not reusable

  • The URL externalization is based on the “Day CQ Link Externalizer” service which has no proper multi tenancy support

More details about this conceptional limitations are covered in the adapTo() 2019 talk: Assets and Links in AEM Projects.

The WCM Core Components provide a solution for this problems by “weaving” wcm.io Handler support into the Core Components. The WCM Core Components can act as drop-in replacement for the AEM Sites Core Components: by updating the super resource types all components are wcm.io Handler-enabled.

If you start a new project the best starting point is the wcm.io Maven Archetype for AEM, which can bootstrap a new AEM application with a full setup for wcm.io Handler and the WCM Core Components included.

Component Overview

As shown in the component overview from AEM Sites Core Components 2.5.0 all components are supported. Only the “Sharing” component is excluded. In cases where multiple versions of core components exists only the latest (v2) version is supported.

The component overview marks the components that are enhanced by either URL, Link, Media or RichText Handler. The other components are untouched.

Wherever possible the enhancement was implemented in a way to extend and not overwrite existing functionality. That means if some new features are added to the AEM Sites Core Component there is a good chance this works out-of-the-box also for the WCM Core Components.

Usage

The usage is simple - you use the same “Proxy Component Pattern” that is required for the AEM Sites Core Components. But instead of their resource type, you use the resource type provided by the WCM Core Components. Example:

  • You want to use the title component with resource type wcm-io/wcm/core/components/title/v2/title

  • Create your own proxy component e.g. at /apps/my-application/components/title with sling:resourceSuperType = wcm-io/wcm/core/components/title/v2/title

  • Make sure to reference only your project-specific resource type my-application/components/title in your application and content

Component Library

Following the example of the AEM Sites Core Components, the WCM Core Components also provide a component library that can be installed locally and used as a show-case for all core components. It’s also possible to try out the edit mode and the content policies.

See wcm.io WCM Core Component Library for further instructions.

Future Outlook

We will provide new releases for each new release of the AEM Sites Core Components, that introduces new features.

Furthermore we plan to get in touch with the AEM Sites Core Component team to work with them together to fine-tune and improve the APIs to make it easier to apply the wcm.io Enhancements to it and reduce the need to overlay scripts or duplicate logic.