Expand my Community achievements bar.

SOLVED

Include multiple property to match in patterns | AEM Modernization Tool

Avatar

Community Advisor

I want to match more than just the sling:resourceType for a component which I want to convert. I want the component to be converted if and only if it the jcr:property , say "testProp" has the value "testValue".

If the property "testProp" has any other value then I don't want to convert the component. 

 

<patterns jcr:primaryType="nt:unstructured">
  <lead jcr:primaryType="nt:unstructured"
        sling:resourceType="geometrixx/components/lead"
        testProp="testValue">
  </lead>
</patterns>

 

This pattern is matching with sling:resourceType, but not matching with testProp as I can see components which don't have testProp value as something else other than testValue are also showing up for conversion.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
<patterns jcr:primaryType="nt:unstructured">
   <lead
      jcr:primaryType="nt:unstructured" 
      sling:resourceType="geometrixx/components/lead" 
      testProp="testValue" >
   </lead>
</patterns>

This is the right way to match more than one properties.

When we search for the components with the pattern, all the components with the matching resource type will show up for conversion. 

Only the components which match the pattern exactly are going to be converted.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor
<patterns jcr:primaryType="nt:unstructured">
   <lead
      jcr:primaryType="nt:unstructured" 
      sling:resourceType="geometrixx/components/lead" 
      testProp="testValue" >
   </lead>
</patterns>

This is the right way to match more than one properties.

When we search for the components with the pattern, all the components with the matching resource type will show up for conversion. 

Only the components which match the pattern exactly are going to be converted.