adobe / aem-modernize-tools

A suite of tools to modernize your AEM Sites implementations off legacy features.
http://opensource.adobe.com/aem-modernize-tools/
Apache License 2.0
64 stars 40 forks source link

Inconsistent Component Converter configuration and output in documentation #214

Closed ConnorJamesLow closed 1 month ago

ConnorJamesLow commented 1 month ago

Docs Issue

In the Rewrite Map Properties section of the COMPONENT CONVERSION > CONFIGURING THE RULES, the example rule does not match the example output.

Based on this cq:rewriteMapProperties node:

{
  "jcr:primaryType": "nt:unstructured",
  "rewrite-map": {
    "jcr:primaryType": "nt:unstructured",
    "One": "First",
    "Two": "Middle",
    "Three": "Last"
  }
}

I'd expect the output to include "First", "Middle", and "Last". Instead, the documentation shows the following input:

{
  "rewriteMapPropertiesOne": {
    "jcr:primaryType": "nt:unstructured",
    "sling:resourceType": "aem-modernize/components/rewritten",
    "rewrite-map": "First"
  },
  "rewriteMapPropertiesTwo": {
    "jcr:primaryType": "nt:unstructured",
    "sling:resourceType": "aem-modernize/components/rewritten",
    "rewrite-map": "Second"
  },
  "rewriteMapPropertiesThree": {
    "jcr:primaryType": "nt:unstructured",
    "sling:resourceType": "aem-modernize/components/rewritten",
    "rewrite-map": "Third"
  }
}

"First" matches, but where did "Second" and "Third" come from?

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

bstopp commented 1 month ago

I see the confusion. Let me try to clarify:

rewriteMapProperties Is a literal one-to-one swap of values.

In the example in the docs, there are three components in the content. But one rule will transform all three into new output.

Configuration___Component_Converter___AEM_Modernization_Tools

And then it processes the next node:

Configuration___Component_Converter___AEM_Modernization_Tools

Does this help?

ConnorJamesLow commented 1 month ago

Thanks, @bstopp. I actually understand how it works; I'm pointing out that if Two maps to Middle then the result should be

  "rewriteMapPropertiesTwo": {
    "jcr:primaryType": "nt:unstructured",
    "sling:resourceType": "aem-modernize/components/rewritten",
    "rewrite-map": "Middle"
  },

but the docs say the result is

  "rewriteMapPropertiesTwo": {
    "jcr:primaryType": "nt:unstructured",
    "sling:resourceType": "aem-modernize/components/rewritten",
    "rewrite-map": "Second"
  },

Note the rewrite-map property. The output is inconsistent in the example—I think it was a typo.

bstopp commented 1 month ago

Nope, you are absolutely correct. That is a typo in the documentation. Addressing it now.