Hello,

In SLING-4330 [0] Oliver suggests that Sightly should be configured to
render templates only from some search paths sub-paths, because he'd also
like to write some Thymeleaf templates in a project, where the Thymeleaf
script engine also binds itself to the *.html extension.

However, if we'd like scripting engines to process templates based on
allowed paths I think that this should happen at a higher level. AFAIK a
scripting engine registers itself for an extension, but that's about it.
The behaviour that determines which script engine will provide the
rendering for a resource is implemented by the SlingServletResolver, which
adapts the component's resource to a ScriptEngine.

The AdapterFactory that performs the adaptation is implemented by
SlingScriptAdapterFactory, which picks the scripting engine based solely on
extension. If we'd change the ScriptEngineFactories to also provide the
path patterns for which they register and we'd expose the patterns as a
configurable OSGi property I think we'd reach the goal of having scripting
engines render templates also based on paths.

WDYT?

Regards,
Radu

[0] - https://issues.apache.org/jira/browse/SLING-4330

Reply via email to