Unable to reuse RTE and UI settings plugins using sling:resourceType - granite/ui/components/foundation/include | Community
Skip to main content
Level 4
August 18, 2020
Solved

Unable to reuse RTE and UI settings plugins using sling:resourceType - granite/ui/components/foundation/include

  • August 18, 2020
  • 1 reply
  • 1431 views

We have a global dialog which has a a couple of text fields and a RTE which is being referred in multiple components using sling:resourceType - granite/ui/components/foundation/include and path properties. So far it works fine. Now we created the RTE plugins and UI settings as separate nodes and we have referred them within the global dialog for RTE by using sling:resourcesuperType. But it is not picking up the plugins when we edit the component dialogs. Looks like if we use "include" to refer a RTE node which is in turn using slingresourceSuperType to fetch the plugins then it does not seem to work.


Below are the cq dialog xml's:


Component where we have reused the global dialog

<globalTab
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/include"
path="/apps/test/components/base/_globalTab"/>

 _globalTab dialog where we referred the RTE and UI settings plugins

<descriptionText
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog/richtext"
fieldDescription="description text"
fieldLabel="description text"
name="./descriptionText"
removeSingleParagraphContainer="{Boolean}true"
required="false"
useFixedInlineToolbar="{Boolean}true">
<rtePlugins
jcr:primaryType="nt:unstructured"
sling:resourceSuperType="/apps/test/components/base/rtePlugins"/>
<uiSettings
jcr:primaryType="nt:unstructured"
sling:resourceSuperType="/apps/test/components/base/uiSettings"/>

 

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 Vijayalakshmi_S

Hi @nalla0109,

I could reproduce the issue you have mentioned and could realize that it is expected with the way "include" granite resource works.(/libs/granite/ui/components/coral/foundation/include/include.jsp)

It works like this

  • Gets the resource from the "path" property - usual way of getting resource from path - resourceResolver.getResource(path)
  • Makes use of ComponentHelper.include method which is equivalent to <sling:include resource="".. />

Reference:

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/com/adobe/granite/ui/components/ComponentHelper.html#include(org.apache.sling.api.resource.Resource,%20java.lang.String,%20com.adobe.granite.ui.components.ComponentHelper.Options)

With this set up, looks like sling:resourceSuperType is not evaluated and I don't think include within include(instead of sling:resourceSuperType) again would work.

Will check if there is any other possible options for your requirement and update this thread.

 

 

1 reply

Vijayalakshmi_S
Vijayalakshmi_SAccepted solution
Level 10
August 19, 2020

Hi @nalla0109,

I could reproduce the issue you have mentioned and could realize that it is expected with the way "include" granite resource works.(/libs/granite/ui/components/coral/foundation/include/include.jsp)

It works like this

  • Gets the resource from the "path" property - usual way of getting resource from path - resourceResolver.getResource(path)
  • Makes use of ComponentHelper.include method which is equivalent to <sling:include resource="".. />

Reference:

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/com/adobe/granite/ui/components/ComponentHelper.html#include(org.apache.sling.api.resource.Resource,%20java.lang.String,%20com.adobe.granite.ui.components.ComponentHelper.Options)

With this set up, looks like sling:resourceSuperType is not evaluated and I don't think include within include(instead of sling:resourceSuperType) again would work.

Will check if there is any other possible options for your requirement and update this thread.