[
https://issues.apache.org/jira/browse/SLING-10012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17263223#comment-17263223
]
Radu Cotescu commented on SLING-10012:
--------------------------------------
bq. I was assuming that both extends and provides only drive
requirements/capabilities (and therefore are not mandatory to have). This seems
to be a case where the extends actually affects the run time functionality. It
is worth mentioning that explicitly at
https://sling.apache.org/components/scriptingbundle-maven-plugin/usage.html.
The {{extends}} and {{requires}} files are mandatory when using bundled scripts
to create the resource type hierarchy:
# {{extends}} is the equivalent of {{sling:resourceSuperType}} when deploying
scripts into the resource tree
# {{requires}} makes sure to add the correct {{TypeProvider}} into the
hierarchy when searching for a script to delegate to (e.g.
{{data-sly-include}}, {{sling:call}})
bq. Also mention the case where the {{sling:resourceSuperType}} is set as
resource property and you are using precompiled scripts. Are precompiled
scripts leveraging both the {{extends}} file and the property
{{sling:resourceSuperType}}? Which one takes precedence?
What do you mean by leveraging both? Do you have an example?
> Lookup of precompiled template files does not work
> --------------------------------------------------
>
> Key: SLING-10012
> URL: https://issues.apache.org/jira/browse/SLING-10012
> Project: Sling
> Issue Type: Bug
> Components: Scripting
> Affects Versions: Scripting HTL Engine 1.4.6-1.4.0
> Reporter: Konrad Windszus
> Assignee: Radu Cotescu
> Priority: Major
>
> I have a resource type {{a}} with a bundled script {{a.html}} which contains
> {code}
> <sly data-sly-use.simpleTemplate="simple.html"
> data-sly-call="${simpleTemplate.simple}"></sly>
> {code}
> I have an extended resource type {{myA}} which has {{a}} as
> resourceSuperType. That one contains {{simple.html}} as precompiled script
> file. Still the lookup when trying to render a resource based on {{myA}}
> fails with
> {code}
> Caused by: org.apache.sling.scripting.sightly.SightlyException: No use
> provider could resolve identifier simple.html
> at
> org.apache.sling.scripting.sightly.impl.engine.extension.use.UseRuntimeExtension.call(UseRuntimeExtension.java:79)
> [org.apache.sling.scripting.sightly:1.4.6.140]
> at
> org.apache.sling.scripting.sightly.impl.engine.runtime.RenderContextImpl.call(RenderContextImpl.java:72)
> [org.apache.sling.scripting.sightly:1.4.6.140]
> at
> org.apache.sling.scripting.sightly.<a>__002e__html.render(container__002e__html.java:62)
> {code}
> It works fine when trying to render a resource directly leveraging {{a}}, but
> in that case obviously the bundled {{a/simple.html}} is used
> Seems that the fix from SLING-9718 has not yet covered this use case.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)