Unable to customize sling:resourceType during Convert to Experience Fragment Variation — ConvertToExperienceFragmentVariation servlet not extensible
1. Description
When an AEM author uses the "Convert to Experience Fragment Variation" action from the page editor, the OOTB servlet ConvertToExperienceFragmentVariation (from bundle com.adobe.cq.cq-experience-fragments) hardcodes the sling:resourceType on the converted component node to:
cq/experience-fragments/editor/components/experiencefragment
This prevents us from using our custom brand-specific Experience Fragment component during and after conversion. There is currently no extension point, OSGi hook, or request parameter to override this value.
. Steps to Reproduce
- Open any AEM page in the page editor.
- Right-click a component (e.g. Hero component).
- Select "Convert to Experience Fragment Variation".
- Fill in the conversion dialog and click Submit.
- Observe the POST request sent to:
/libs/cq/experience-fragments/content/v2/conversion/converter
- Open CRXDE Lite and inspect the converted component node.
- Observe that sling:resourceType is hardcoded to the OOTB value.
Expected vs. Actual Behavior
Expected Behavior
The servlet should support one of the following:
- Accept a request parameter (e.g. customResourceType) to allow passing a custom sling:resourceType, falling back to the OOTB value as default.
- Provide an OSGi extension point or service interface that allows custom implementations to override the sling:resourceType post-conversion.
- Expose a configuration or hook mechanism so brand-specific XF components can be plugged in without modifying /libs.
Actual Behavior
Problem: The replacePageComponents() method in ConvertToExperienceFragmentVariation hardcodes the value (line 203 in decompiled source):
properties.put("sling:resourceType",
"cq/experience-fragments/editor/components/experiencefragment");
properties.put("fragmentPath", fragmentPath);
There is no way to override or extend this behavior because:
- The servlet is part of bundle com.adobe.cq.cq-experience-fragments
- It is NOT included in the AEM uber-jar
- Therefore it cannot be extended or overridden via standard OSGi/Sling mechanisms
7. Request to Adobe
We request Adobe to provide one or more of the following:
| # | Request | Description |
| 1 | OSGi Extension Point | Expose an OSGi service interface (e.g. ExperienceFragmentConversionHandler) that allows custom implementations to override the sling:resourceType during conversion. |
| 2 | Request Parameter Support | Add support for an optional request parameter (e.g. customResourceType) in the converter servlet, with the OOTB value as the default fallback. |
| 3 | Uber-Jar Inclusion | Include ConvertToExperienceFragmentVariation (or an abstract/interface version) in the AEM uber-jar so it can be properly extended. |
| 4 | Official Documentation | Provide official documentation on the recommended approach to customize XF conversion behavior for brand-specific component types. |
.