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

2015-03-20 Thread Radu Cotescu
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) j...@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)



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

2015-03-19 Thread Olaf Otto (JIRA)

 [ 
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)