You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Hakim Sadikali <ha...@contentthread.com> on 2016/07/28 01:05:40 UTC

Sightly Scripting Question

Hi Guys,

Question on sightly templates and custom expression options.  Right now we
have the following options:

1. Format
2. i18n
3. Join
4. URI Manipulation

What if we wanted to create a custom expression, is this possible?  I know
the Filter class is part of the impl package and not exposed, so its
obviously not an extension point at this point but is this something thats
possible to change going forward?  I can think of many use cases where
custom expressions are desirable, to list a few:

1. Resource Resolver Map
2. Number Formatting
3. Image mapping

Without these additional extension points we have to write a lot more code
via the Use API to provide the same functionality.

Hakim

Re: Sightly Scripting Question

Posted by Radu Cotescu <ra...@apache.org>.
Hi Hakim,

Could you please give us an example about how your expressions should look
like?

The filters you've mentioned just augment or transform an expression.
Option processing however is handled by the RuntimeExtensions [0].

Regards,
Radu

[0] -
https://github.com/apache/sling/blob/trunk/bundles/scripting/sightly/java-compiler/src/main/java/org/apache/sling/scripting/sightly/extension/RuntimeExtension.java

On Thu, 28 Jul 2016 at 03:05 Hakim Sadikali <
hakim.sadikali@contentthread.com> wrote:

> Hi Guys,
>
> Question on sightly templates and custom expression options.  Right now we
> have the following options:
>
> 1. Format
> 2. i18n
> 3. Join
> 4. URI Manipulation
>
> What if we wanted to create a custom expression, is this possible?  I know
> the Filter class is part of the impl package and not exposed, so its
> obviously not an extension point at this point but is this something thats
> possible to change going forward?  I can think of many use cases where
> custom expressions are desirable, to list a few:
>
> 1. Resource Resolver Map
> 2. Number Formatting
> 3. Image mapping
>
> Without these additional extension points we have to write a lot more code
> via the Use API to provide the same functionality.
>
> Hakim
>