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

Bertrand Delacretaz commented on SLING-7772:
--------------------------------------------

I don't know how the script engine is currently selected but it might make 
sense to use extensions or mime-types to indicate which language you are using, 
and let the standard Sling script engine selection work as usual.

I know little about how Sling Pipes work, but maybe using a prefix such as

{code}
${js:2 + 2}
{code}

or

{code}
${groovy:2 + 2}
{code}

to indicate which language the expression is in would be practical, without 
having to code anything special for Sling Pipes: just ask the Sling scripting 
core to executing a "js" or a "groovy" script. Or use "pjs" if you need to 
select a specific "js" engine for Sling Pipes.

Note that, if needed, implementing a minimal scripting engine is fairly easy, 
see for example 
https://github.com/apache/sling-samples/tree/master/org.apache.sling.graphql.samples.website/src/main/java/org/apache/sling/scripting/handlebars
 

> add other scripting options for pipe expressions
> ------------------------------------------------
>
>                 Key: SLING-7772
>                 URL: https://issues.apache.org/jira/browse/SLING-7772
>             Project: Sling
>          Issue Type: Improvement
>          Components: Extensions, pipes
>    Affects Versions: Pipes 2.0.2
>            Reporter: Nicolas Peltier
>            Priority: Major
>
> nashorn is being deprecated (http://openjdk.java.net/jeps/335). There might 
> be another option soon, that will be another dependency.
> Thinking about it, we should provide an option for script in pipe expression 
> (which should be fairly easy to do). And may be thinking of changing the 
> default script engine not to be JS anymore but something that does not need 
> dependency installed, popular and performant



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to