Hey Olivier,

Thanks for the explanation! For me real the benefit would be that I could take 
a vanilla sling launchpad and install the project where I would add a config 
file making the thymeleaf engine a higher service ranking and it would all work 
without any manual action of the user in the system console (unless there is a 
way I don’t know of that you can deactivate bundles through a config / maven 
plugin).

Also I still seem to be getting errors in the fling sample. 

Firstly, when going to the form page, I get following error which can be fixed 
by making the <input> tags closed in the templates:

        org.thymeleaf.exceptions.TemplateInputException: Exception parsing 
document: template="/apps/fling/page/form/html.html", line 52 - column 
        Caused by: org.xml.sax.SAXParseException; lineNumber: 52; columnNumber: 
9; The element type "input" must be terminated by the matching end-tag 
"</input>”.

Secondly, when I manually close the input tags myself in the 
/apps/fling/page/form/html.html template and I submit the form, I just get 
redirected to following page and no validation occures:

        Content modified /content/fling/validation

        Status                  200
        Message                 OK
        Location                        /fling/validation
        Parent Location /fling
        Path                            /content/fling/validation
        Referer                 http://localhost:8080/fling/validation.html
        ChangeLog               
<pre>modified("/content/fling/validation/formType");<br/>modified("/content/fling/validation/name");<br/></pre>
        Go Back

        Modified Resource

        Parent of Modified Resource

Lastly, I was wondering what should be on the sling commons messaging page in 
the example. I just get a page with three columns, subject from and text but 
nothing filled in.

Thanks!
Greetings,
Roy



> On 01 May 2016, at 09:42, Oliver Lietz <apa...@oliverlietz.de> wrote:
> 
> 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