[jira] [Commented] (SLING-4330) provide a configuration parameter for paths patterns Sightly should handle

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (SLING-4330) provide a configuration parameter for paths patterns Sightly should handle

Andrei Shilov (Jira)

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

Oliver Lietz commented on SLING-4330:
-------------------------------------

bq. Do I understand it correctly, that you propose to limit a ScriptEngine to only handle scripts found at a certain location ?

Yes. I'm bringing an application to AEM 6 where different teams from different companies work on the HTML templating in a round-trip manner. I had to disable Sightly on AEM 6 as it always kicks in for scripts/templates with extension {{.html}} and fails. This seems not to be a problem right now as Classic UI is used for authoring and administration and JSPs besides Thymeleaf for templating, but could (_will_) be a problem in the future of course. Ideally I can configure Sightly to only handle scripts e.g. in {{/libs/foundation}} and {{/apps/client/app2}}.

> provide a configuration parameter for paths patterns Sightly should handle
> --------------------------------------------------------------------------
>
>                 Key: SLING-4330
>                 URL: https://issues.apache.org/jira/browse/SLING-4330
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting
>    Affects Versions: Scripting Sightly Engine 1.0.0
>            Reporter: Oliver Lietz
>
> Running multiple script engines for same script (template) extension should be possible.
> Scripting Thymeleaf already provides that parameter, see {{org.apache.sling.scripting.thymeleaf.SlingTemplateModeHandler#getPatternSpec():org.thymeleaf.PatternSpec}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
Reply | Threaded
Open this post in threaded view
|

Re: [jira] [Commented] (SLING-4330) provide a configuration parameter for paths patterns Sightly should handle

Felix Meschberger-3
Hi

So we have a problem in that two script engines are using the same script/template extension ?

I think we cannot handle this with a mechanism such as SLING-4330. I also think that script engines should not limit themselves in where they would like to be evaluated. That’s none of their business. They get a script and they should (try to) evaluate it. It is the ScriptResolver’s task to decide whether to evaluate a script or not given that it has a certain location.

Now, the deeper problem really is that the ScriptEngine infrastructure is not intended to support two different script languages with the same extension. Also the intent of a script extension is to indicate the language the script is written in.

Also, the ScriptEngineManager as we use it today is *not* able to register multiple script engines for the same extension — its always one or the other — unfortunately its the last one registered that wins.

So we really have to fix the underlying problem (and needless to say, that I really don’t like using the extension „html“ for a script/template…) and maybe change the extension of one or the other scripting language if they should be used concurrently on the same instance.

Regards
Felix

> Am 19.01.2015 um 11:40 schrieb Oliver Lietz (JIRA) <[hidden email]>:
>
>
>    [ https://issues.apache.org/jira/browse/SLING-4330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14282371#comment-14282371 ]
>
> Oliver Lietz commented on SLING-4330:
> -------------------------------------
>
> bq. Do I understand it correctly, that you propose to limit a ScriptEngine to only handle scripts found at a certain location ?
>
> Yes. I'm bringing an application to AEM 6 where different teams from different companies work on the HTML templating in a round-trip manner. I had to disable Sightly on AEM 6 as it always kicks in for scripts/templates with extension {{.html}} and fails. This seems not to be a problem right now as Classic UI is used for authoring and administration and JSPs besides Thymeleaf for templating, but could (_will_) be a problem in the future of course. Ideally I can configure Sightly to only handle scripts e.g. in {{/libs/foundation}} and {{/apps/client/app2}}.
>
>> provide a configuration parameter for paths patterns Sightly should handle
>> --------------------------------------------------------------------------
>>
>>                Key: SLING-4330
>>                URL: https://issues.apache.org/jira/browse/SLING-4330
>>            Project: Sling
>>         Issue Type: New Feature
>>         Components: Scripting
>>   Affects Versions: Scripting Sightly Engine 1.0.0
>>           Reporter: Oliver Lietz
>>
>> Running multiple script engines for same script (template) extension should be possible.
>> Scripting Thymeleaf already provides that parameter, see {{org.apache.sling.scripting.thymeleaf.SlingTemplateModeHandler#getPatternSpec():org.thymeleaf.PatternSpec}}.
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v6.3.4#6332)

Reply | Threaded
Open this post in threaded view
|

Re: [jira] [Commented] (SLING-4330) provide a configuration parameter for paths patterns Sightly should handle

Felix Meschberger-3
Threads collide .. lets continue the discussion on Radu’s thread "[discussion] allow Script Engines to also render components based on paths“

Regards
Felix

> Am 23.01.2015 um 11:19 schrieb Felix Meschberger <[hidden email]>:
>
> Hi
>
> So we have a problem in that two script engines are using the same script/template extension ?
>
> I think we cannot handle this with a mechanism such as SLING-4330. I also think that script engines should not limit themselves in where they would like to be evaluated. That’s none of their business. They get a script and they should (try to) evaluate it. It is the ScriptResolver’s task to decide whether to evaluate a script or not given that it has a certain location.
>
> Now, the deeper problem really is that the ScriptEngine infrastructure is not intended to support two different script languages with the same extension. Also the intent of a script extension is to indicate the language the script is written in.
>
> Also, the ScriptEngineManager as we use it today is *not* able to register multiple script engines for the same extension — its always one or the other — unfortunately its the last one registered that wins.
>
> So we really have to fix the underlying problem (and needless to say, that I really don’t like using the extension „html“ for a script/template…) and maybe change the extension of one or the other scripting language if they should be used concurrently on the same instance.
>
> Regards
> Felix
>
>> Am 19.01.2015 um 11:40 schrieb Oliver Lietz (JIRA) <[hidden email]>:
>>
>>
>>   [ https://issues.apache.org/jira/browse/SLING-4330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14282371#comment-14282371 ]
>>
>> Oliver Lietz commented on SLING-4330:
>> -------------------------------------
>>
>> bq. Do I understand it correctly, that you propose to limit a ScriptEngine to only handle scripts found at a certain location ?
>>
>> Yes. I'm bringing an application to AEM 6 where different teams from different companies work on the HTML templating in a round-trip manner. I had to disable Sightly on AEM 6 as it always kicks in for scripts/templates with extension {{.html}} and fails. This seems not to be a problem right now as Classic UI is used for authoring and administration and JSPs besides Thymeleaf for templating, but could (_will_) be a problem in the future of course. Ideally I can configure Sightly to only handle scripts e.g. in {{/libs/foundation}} and {{/apps/client/app2}}.
>>
>>> provide a configuration parameter for paths patterns Sightly should handle
>>> --------------------------------------------------------------------------
>>>
>>>               Key: SLING-4330
>>>               URL: https://issues.apache.org/jira/browse/SLING-4330
>>>           Project: Sling
>>>        Issue Type: New Feature
>>>        Components: Scripting
>>>  Affects Versions: Scripting Sightly Engine 1.0.0
>>>          Reporter: Oliver Lietz
>>>
>>> Running multiple script engines for same script (template) extension should be possible.
>>> Scripting Thymeleaf already provides that parameter, see {{org.apache.sling.scripting.thymeleaf.SlingTemplateModeHandler#getPatternSpec():org.thymeleaf.PatternSpec}}.
>>
>>
>>
>> --
>> This message was sent by Atlassian JIRA
>> (v6.3.4#6332)
>