AEM Modernizer tool Error - Showing component and rule count is zero | Community
Skip to main content
AEMLearner-1989
Level 4
July 18, 2023
Solved

AEM Modernizer tool Error - Showing component and rule count is zero

  • July 18, 2023
  • 1 reply
  • 833 views

Hi Team,

 

We have installed AEM modernizer tool and are not sure where we need to configure the rules. 

 

com.adobe.aem.modernize.component.impl.ComponentRewriteRuleServiceImpl 

 

search.paths=[path to rule root] -  do we have any sample zip or format to check it?

 

https://opensource.adobe.com/aem-modernize-tools/pages/component/config.html

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by yuriy_shestakov

You have to create your own (`nt:unstructured`) nodes tree somewhere in the repo, for example, `/apps/my-migration-project/rules`, and create there all the rule definitions you need as children. The OSGi configuration file for the ComponentRewriteRuleServiceImpl I believe should be placed somewhere in /apps/.../config..., as usual.

All those XML pieces on the documentation page are definitions for those migration rules, you should go through them and get what you need for your project. 

 

Some kind of a sample that you are looking for, you can see at the end of that page, I am copying it here:

<teaser jcr:primaryType="nt:unstructured" jcr:title="GeoDemo Teaser" cq:rewriteRanking="1"> <aggregate jcr:primaryType="nt:unstructured"> <patterns jcr:primaryType="nt:unstructured"> <imagePattern jcr:primaryType="nt:unstructured" sling:resourceType="foundation/components/image"/> <titlePattern jcr:primaryType="nt:unstructured" sling:resourceType="geometrixx/components/title"/> <textPattern jcr:primaryType="nt:unstructured" sling:resourceType="foundation/components/text"/> </patterns> </aggregate> <replacement jcr:primaryType="nt:unstructured"> <text jcr:primaryType="nt:unstructured" sling:resourceType="geodemo/components/content/teaser" jcr:title="${'./[pattern:titlePattern]/jcr:title'}" jcr:description="${./[pattern:textPattern]/text}" textIsRich="${./[pattern:textPattern]/text}" fileReference="${'./[pattern:imagePattern]/fileReference'}" /> </replacement> </teaser>

 

For this sample rule, it should find some node with such children as image, title, and text (resource types in the patterns section) and convert the whole parent node to one `geodemo/components/content/teaser` element.

 

Note that you can mark properties that you are looking for as optional, and also you can add the `cq:rewriteFinal` property to the replacement section to stop checking the processed node for other rules once it is replaced by one of them.

1 reply

Nishant-Singh
Adobe Employee
Adobe Employee
July 18, 2023
AEMLearner-1989
Level 4
July 18, 2023

Please check the question.. I have already checked the blogs

yuriy_shestakov
yuriy_shestakovAccepted solution
Level 3
July 18, 2023

You have to create your own (`nt:unstructured`) nodes tree somewhere in the repo, for example, `/apps/my-migration-project/rules`, and create there all the rule definitions you need as children. The OSGi configuration file for the ComponentRewriteRuleServiceImpl I believe should be placed somewhere in /apps/.../config..., as usual.

All those XML pieces on the documentation page are definitions for those migration rules, you should go through them and get what you need for your project. 

 

Some kind of a sample that you are looking for, you can see at the end of that page, I am copying it here:

<teaser jcr:primaryType="nt:unstructured" jcr:title="GeoDemo Teaser" cq:rewriteRanking="1"> <aggregate jcr:primaryType="nt:unstructured"> <patterns jcr:primaryType="nt:unstructured"> <imagePattern jcr:primaryType="nt:unstructured" sling:resourceType="foundation/components/image"/> <titlePattern jcr:primaryType="nt:unstructured" sling:resourceType="geometrixx/components/title"/> <textPattern jcr:primaryType="nt:unstructured" sling:resourceType="foundation/components/text"/> </patterns> </aggregate> <replacement jcr:primaryType="nt:unstructured"> <text jcr:primaryType="nt:unstructured" sling:resourceType="geodemo/components/content/teaser" jcr:title="${'./[pattern:titlePattern]/jcr:title'}" jcr:description="${./[pattern:textPattern]/text}" textIsRich="${./[pattern:textPattern]/text}" fileReference="${'./[pattern:imagePattern]/fileReference'}" /> </replacement> </teaser>

 

For this sample rule, it should find some node with such children as image, title, and text (resource types in the patterns section) and convert the whole parent node to one `geodemo/components/content/teaser` element.

 

Note that you can mark properties that you are looking for as optional, and also you can add the `cq:rewriteFinal` property to the replacement section to stop checking the processed node for other rules once it is replaced by one of them.