Expand my Community achievements bar.

SOLVED

How to Create a new componentgroup in AEM via a service

Avatar

Level 3

Hi all,

We have a requirement where we need to create a custom component group via a Java service. This service will be responsible of reading a list of components and adding those in the custom Group.

The purpose is to display only the configured components in the sidekick irrespective of the templates selected. We know AEM provides OOTB etc\design functionality but just want to know if anyone in the forum has come up with any such scenario.

 

Thanks,

Shikha

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hey Shikha,

You want to modify components that appear in sidekick(e.g. modify what appears in the first part of sidekick) correct?

Simply, create a Sling filter on top of /libs/wcm/core/content/components.1446482347879.json endpoint.

So, that after result is being generated by the parent servlet, your custom filter get's executed and filters resulting JSON data as you see it needed for your requirement.

Thanks,

Peter

View solution in original post

3 Replies

Avatar

Level 10

I dont think you have any service to create component group. Once you get the list of components you want to show in the sidekick, add the property componentGroup fro each of the components. That should automatically take care. 

However, I dont think we should have such configuration done via service.

Avatar

Correct answer by
Community Advisor

Hey Shikha,

You want to modify components that appear in sidekick(e.g. modify what appears in the first part of sidekick) correct?

Simply, create a Sling filter on top of /libs/wcm/core/content/components.1446482347879.json endpoint.

So, that after result is being generated by the parent servlet, your custom filter get's executed and filters resulting JSON data as you see it needed for your requirement.

Thanks,

Peter

Avatar

Level 5

I guess you can try this add a component group property via sling post either as curl or custom http  client depending on what you need

assuming cq:component  is /apps/components/sample/ you can add componentGroup - name via post