Adobe-Consulting-Services / acs-aem-commons

http://adobe-consulting-services.github.io/acs-aem-commons/
Apache License 2.0
451 stars 597 forks source link

Provide Contextual PathField and PageField in addition to Contextual PathBrowser #2160

Closed kwin closed 4 years ago

kwin commented 4 years ago

Required Information

Expected Behavior

Since the pathbrowser is deprecated since AEM 6.3 (https://helpx.adobe.com/experience-manager/6-3/release-notes/deprecated-removed-features.html) instead a contextual variant of the replacement, the pathfield should be provided. Also the derived components in /libs/cq/gui/components/coral/common/form/pagefield should have a contextual variant.

Actual Behavior

Only a Contextual variant of the legacy pathbrowser is being provided in https://github.com/Adobe-Consulting-Services/acs-aem-commons/tree/master/ui.apps/src/main/content/jcr_root/apps/acs-commons/touchui-widgets/contextualpathbrowser. It should be pretty straightforward to provide a variant for the pathfield and pagefield in addition.

kwin commented 4 years ago

Maybe instead of providing custom variants for all those resource types there can be a more generic version which leverages the ExpressionCustomizer to provide the contextual root path via EL as custom variable. One idea could be to provide a custom container within the dialog (ACS AEM Commons specific resource type) which inherits from granite/ui/components/coral/foundation/container and injects the contextual root into a EL variable. Such a custom container could also potentially inject other variables. The required variables names should probably be explicitly requested via property requiredVariables in the container. There should also be an SPI which allows injecting custom EL variables.

Update: Unfortunately only certain properties support EL variables. Although rootPath has EL support e.g. in granite/ui/components/coral/foundation/form/pathfield (also documented with type stringel in https://helpx.adobe.com/experience-manager/6-5/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/pathfield/index.html), the derived resource type in cq/gui/components/coral/common/form/pagefield doesn't support EL in that property.

Update2: I reported this bug in AEM via https://daycare.day.com/home/netcentric/netcentric_de/partner_services/203876.html.

Update3: This is now tracked in Adobe's bugtracker in CQ-4287814. No ETA though.

HitmanInWis commented 4 years ago

@kwin has the new usage pattern been documented? Would it be worth updating docs at https://adobe-consulting-services.github.io/acs-aem-commons/features/ui-widgets/contextual-pathfield-browser/index.html ?

kwin commented 4 years ago

@HitmanInWis Tracked the documentation update now in https://github.com/Adobe-Consulting-Services/adobe-consulting-services.github.io/issues/189.