[ 
https://issues.apache.org/jira/browse/SLING-10012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17263288#comment-17263288
 ] 

Radu Cotescu commented on SLING-10012:
--------------------------------------

bq. I don't really follow why this is mandatory, just imagine you combine a 
non-bundled resource type myAggregate using via data-sly-include to a bundled 
and precompiled resource type myBundledResource1. In that case you clearly 
don't have a requires file for myAggregate and it should still work.

Sorry, I was a bit ambiguous: {{requires}} is not mandatory, but it helps with 
creating an explicit dependency chain. {{extends}} on the other hand is, 
otherwise you won't be able to solve scripts coming from the super type, nor 
use the super type's main script to drive the rendering.

bq. Having a JCR Resource Provider Factory for /apps and in there having 
/apps/my/type/sling:resourceSuperType set to some value. In addition have the 
precompiled script for /apps/my/type/type.html. Why is the extends mandatory in 
that case, as it would only duplicate the information already provided via 
/apps/my/type/sling:resourceSuperType?

In this case the {{extends}} file is not mandatory. It would if all the script 
deployment for your setup would rely solely on bundled scripts, in which case 
the {{extends}} file would basically help the {{o.a.s.servlets.resolver}} to 
correctly define the {{ServletResources}} hierarchy. If you have a merged view 
(e.g. parent folder of the {{ServletResource}} defined via JCR and the 
{{ServletResource}} created by the resolver, based on a bundled script), the 
Servlets Resolver should take into consideration your 
{{sling:resourceSuperType}} value.

> 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)

Reply via email to