On Sunday 01 May 2016 10:05:33 Vlad Bailescu wrote:
> Hi,
> 
> My comments are inline.
> 
> On Sunday, 1 May 2016, Oliver Lietz <apa...@oliverlietz.de> wrote:
> > On Saturday 30 April 2016 22:04:57 Vlad Bailescu wrote:
> > > On Saturday, 30 April 2016, Oliver Lietz <apa...@oliverlietz.de
> > 
> > <javascript:;>> wrote:
> > > > (service ranking is not honored by Sling's script engine manager, no
> > 
> > need
> > 
> > > > to try).
> > > 
> > > Any idea why this is not a bug?
> > 
> > Why do you think it should be a bug?
> 
> Because Sling generally uses the service ranking and it's a great mechanism.

"generally" is a somewhat optimistic term when it comes to service ranking at 
Sling. I don't think it's a bug still, but using service ranking could be an 
improvement indeed.

> > Sling's Scripting support is built around Java's Scripting API (JSR-223)
> > and
> > that was obviously not designed to handle multiple script engines for one
> > extension or mime type. So it is a limitation in Java's Scripting API.
> 
> The implementation could use service ranking as an optional/custom
> extension of the standard.

Right. And we will need an extension somehow when script engine manager is 
asked for an engine by extension or mime type. The manager could return null, 
throw an Exception or select the engine by service ranking when more than one 
engine is registered per extension or mime type. It will be implemented as 
part of SLING-4330 (work in progress).

> > >   https://issues.apache.org/jira/browse/SLING-4330
> > > 
> > > I was under the impression SLING-4330 is about using both Sightly and
> > > Thymeleaf in the same running instance; and how to solve which one gets
> > > used on a file/script level.
> > 
> > Right.
> > 
> > > But for using just one scripting engine (Thymeleaf in this case) for a
> > > given extension we could just use the service ranking.
> > 
> > What is the benefit?
> > 
> > If you give Thymeleaf's script engine a higher service ranking than
> > Sightly's
> > to render HTML templates (.html) you make Sightly quite useless. The
> > result is
> > similar to deactivating/deinstalling Sightly's bundles (correct me if I'm
> > wrong).
> > 
> > The other way round is not that destructive because Thymeleaf's script
> > engine
> > can be configured for different extensions (e.g. .htm, .thtml), can handle
> > not
> > only HTML but also XML, CSS, JavaScript, text and raw templates and makes
> > its
> > TemplateEngine available as OSGi service to render templates outside of
> > Sling's Scripting context (see Fling sample).
> > 
> > So unless SLING-4330 is implemented and you want to use Thymeleaf for
> > .html
> > just deinstall Sightly.
> 
> Right, but that seems a bit counter-intuitive since Sightly ships as
> default with Sling. From an user point of view it would make sense to just
> bump the ranking of Thymeleaf to make it "cut in front" instead of
> uninstalling something.

Sling Launchpad ships with Sightly because Adobe is pushing Sightly with full 
force. If you use Sling Launchpad Karaf no Scripting implementation is 
installed at all and you have the freedom to choose.

> This will not solve SLING-4330, of course, but will provide a better user
> experience, IMO.

Patches are welcome, go ahead!

O.

> > Regards,
> > O.
> 
> Best,
> Vlad


Reply via email to