You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Olaf Otto (JIRA)" <ji...@apache.org> on 2015/03/19 13:56:39 UTC

[jira] [Issue Comment Deleted] (SLING-4524) Provide the properties of the current Resource as a ValueMap via the sling:defineObjects tag

     [ https://issues.apache.org/jira/browse/SLING-4524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Olaf Otto updated SLING-4524:
-----------------------------
    Comment: was deleted

(was: Pull request: https://github.com/apache/sling/pull/74)

> Provide the properties of the current Resource as a ValueMap via the sling:defineObjects tag
> --------------------------------------------------------------------------------------------
>
>                 Key: SLING-4524
>                 URL: https://issues.apache.org/jira/browse/SLING-4524
>             Project: Sling
>          Issue Type: Wish
>            Reporter: Olaf Otto
>
> One of the most common use cases in JSP views is accessing the properties of the current resource. However, this currently requires explicit adaptation of the current resource to ValueMap, which is boilerplate. I'd thus love to see "properties" as one of the defaults provided by the before mentioned tag library.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Re: [jira] [Issue Comment Deleted] (SLING-4524) Provide the properties of the current Resource as a ValueMap via the sling:defineObjects tag

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

For Sightly we also need the properties object in the scope of a script.
Currently this is handled with the help of a BindingsValuesProvider. Given
that probably most scripting engines rely on some of the objects defined by
sling:defineObjects wouldn't it be better, from a developer-friendliness
point of view, if we actually add a generic BVP that provides these
objects? Alternatively we could restrict the BVP to only a sub-set of the
available scripting languages (e.g. JSP, Groovy, Sightly and maybe
Thymeleaf).

The org.apache.sling.scripting.jsp.taglib bundle could then just extract
what it needs for its sling:defineObjects tag and expose the objects:

public int doEndTag() {
final SlingBindings bindings =
(SlingBindings)pageContext.getRequest().getAttribute(SlingBindings.class.getName());
pageContext.setAttribute(propertiesName,
bindings.get(DEFAULT_PROPERTIES_NAME));
...
}


WDYT?

Cheers,
Radu

On Thu, Mar 19, 2015 at 2:56 PM, Olaf Otto (JIRA) <ji...@apache.org> wrote:

>
>      [
> https://issues.apache.org/jira/browse/SLING-4524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
> ]
>
> Olaf Otto updated SLING-4524:
> -----------------------------
>     Comment: was deleted
>
> (was: Pull request: https://github.com/apache/sling/pull/74)
>
> > Provide the properties of the current Resource as a ValueMap via the
> sling:defineObjects tag
> >
> --------------------------------------------------------------------------------------------
> >
> >                 Key: SLING-4524
> >                 URL: https://issues.apache.org/jira/browse/SLING-4524
> >             Project: Sling
> >          Issue Type: Wish
> >            Reporter: Olaf Otto
> >
> > One of the most common use cases in JSP views is accessing the
> properties of the current resource. However, this currently requires
> explicit adaptation of the current resource to ValueMap, which is
> boilerplate. I'd thus love to see "properties" as one of the defaults
> provided by the before mentioned tag library.
>
>
>
> --
> This message was sent by Atlassian JIRA
> (v6.3.4#6332)
>