Best approach to migrate Foundation Component to WCM Core component in AEM 6.4

Avatar

Avatar

TUmesh

Avatar

TUmesh

TUmesh

14-04-2020

Dear Members,

In my current project some components are standalone( neither a child of  foundation nor wcm core component's) and some are child of foundation component so requirement is to migrate all those foundation components to wcm core components. After reading some adobe articles I reached on the conclusion that:

There are two ways to migrate foundation to core component-

1. If functionality matches then use resourceSuperType to refer the respective core component and write interface based sling model if customised.

2. If functionality doesn't matches, at least write interface based sling model. 

Please confirm whether my understanding is correct or not.

If not, please suggest an approach to accomplish the requirement.

 

Thanks

Umesh Thakur

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Theo_Pendle

MVP

Avatar

Theo_Pendle

MVP

Theo_Pendle
MVP

14-04-2020

Hi,

Globally that's correct, yes 🙂

However, one thing to be aware of is that Core Components come with a number of methods to modify them without needing to write new code. These non-code customizations are called policies, you can read more about them here. If you want an example:

Before Core Components, the Image component let authors upload images from their PC (bad idea). The Core Component Image has a policy that lets you disable this feature (much safer). You can read about that here.

In order to use policies though, you'll have to migrate from Static Templates to Editable Templates (which I highly recommend). These let you build and design your templates in an editor rather than in code, and offer many more features than Static Templates.

Also, one semantic detail: a component that uses a Sling Model is not, by definition, a "core component". The term "core component" refers specifically to the components offered by AEM Core Components

Answers (1)

Answers (1)

Avatar

Avatar

BrianKasingli

MVP

Avatar

BrianKasingli

MVP

BrianKasingli
MVP

14-04-2020

Can you please explain why you would want to migrate all existing components from foundation components to WCM Core components? Why was this decided?
Taking a closer look at the content WCM Core Content Components:

  1. WCM Core Components are implemented with Sling Models.
  2. WCM Core Components all implement the Jackson Exporter to be exported in a serialized JSON object; Jackson Exporter enabled components are useful in combination with editable templates (content services).

What's more interesting is the WCM Core Page Component:

  1. Supports editable templates.
  2. Supports out of the box content services of .model.json (on the page) with exposes a serialised JSON object from the cq:Page object; when using a combination of the editable templates and the layout container component.
  3. Supports Closed user groups and permissions
  4. Supports Cloud services.
  5. More supporting features: https://github.com/adobe/aem-core-wcm-components/tree/master/content/src/content/jcr_root/apps/core/...

Here's what I would do. The first thing I would do is to convert the base page to extend the WCM Core Page Component. The WCM Core Page Component is important as there are new behaviours included in the supporting scripts of the Sightly HTL templates that support new features such as editable templates; used for templates or experience fragments (read more here). After creating a new base page component and all other supporting page components, you would need to either think about using editable templates or continue on using static templates. Whatever choice you decide, you would next need to apply a migration script; to update all existing content nodes to point to the new static or editable templates. During script migration, ensure that you are progressively upgrading pages to test as you go.

Next, Content Components; I would focus on converting JSPs to Sling Model backend logic and Sightly for the view logic while implementing the Jackson Exporter feature for all Sling Models. Don't forget to update the Classic UI, convert Classic UI -> Touch UI using this tool https://docs.adobe.com/content/help/en/experience-manager-64/developing/devtools/dialog-conversion.h....

Maybe only some existing components can overlay (extend) WCM core components, but not all.

I hope this helps.