You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "David Nuescheler (JIRA)" <ji...@apache.org> on 2008/01/14 17:59:34 UTC

[jira] Created: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
----------------------------------------------------------------------------------

                 Key: SLING-154
                 URL: https://issues.apache.org/jira/browse/SLING-154
             Project: Sling
          Issue Type: Improvement
          Components: Scripting
            Reporter: David Nuescheler
            Priority: Minor


I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.

I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
out from my very convenient ScriptableNode.

This discussion already talks about a similar issue:
http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html

So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
that I could access the same information through for example prop.length or prop.getLength().

I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
the script user. I think maybe the solution also requires a ScriptableProperty.

WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569887#action_12569887 ] 

Bertrand Delacretaz commented on SLING-154:
-------------------------------------------

addNode(path, [primaryType]) and getNode(path) added to ScriptableNode in revision 628709. These methods should now be accessible from server-side javascript.

Leaving this issue open are other Node methods are still missing from ScriptableNode.

I don't think Rhino generates any methods in this case, as we're using a wrapper for the Node class. Or is there something wrong in ScriptableNode that prevents Rhino from calling the Node methods that are not explicitely defined?

> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: SLING-154.partial.patch, SLING-154_2.patch
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger reopened SLING-154:
-------------------------------------


Reopen because my fix was completely broken. Thanks Bertrand for providing the patch.

> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: SLING-154.partial.patch
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12561724#action_12561724 ] 

Bertrand Delacretaz commented on SLING-154:
-------------------------------------------

The node.properties.propertyname syntax didn't work, I have fixed it (after a looooooong debugging session - it would be good to be able to plugin the Rhino debugger) in revision 614542.

A stray "org.mozilla.javascript.EvaluatorException: Property is not a constructor" remains, but the scripting/javascript tests pass now.

> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: SLING-154.partial.patch, SLING-154_2.patch
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "David Nuescheler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Nuescheler reopened SLING-154:
------------------------------------


add all methods of the Node interface to ScriptableNode

> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: SLING-154.partial.patch, SLING-154_2.patch
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12573291#action_12573291 ] 

Bertrand Delacretaz commented on SLING-154:
-------------------------------------------

Although all tests pass in the scripting/javascript and launchpad-webapp modules, we get some rhino warnings while running the former module's tests:

org.mozilla.javascript.EvaluatorException: Node is not a constructor (NO_SCRIPT_NAME#4)
...
        at org.apache.sling.scripting.wrapper.ScriptableNodeTest.testGetNodesNoPattern(ScriptableNodeTest.java:155)

Something's wrong in our wrappers, but I haven't been able to spot exactly what yet.



> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: SLING-154.partial.patch, SLING-154_2.patch
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569219#action_12569219 ] 

Felix Meschberger commented on SLING-154:
-----------------------------------------

> add all methods

This is actually the intention and is though to be done automatically be Rhino. This does not seem to be the case and we will have to review why this is the case.

> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: SLING-154.partial.patch, SLING-154_2.patch
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved SLING-154.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0
         Assignee: Felix Meschberger

Implemented in Rev. 613895:

Added more scriptable mappings:
   - Completed getters for ScriptableNode
   - Created ScriptableProperty to map properties
   - Added getters for child nodes (node.children) and
     properties (node.properties) to ScriptableNode

All parameter-less getter methods as well as some "isXXX" methods, such as isNew and isModified are now mapped to ScriptableNode and ScriptableProperty properties.

Please report back if this suites your need or not. Thanks.

> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: 2.0.0
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12561066#action_12561066 ] 

Bertrand Delacretaz commented on SLING-154:
-------------------------------------------

To be clear, what I mean by "breaks my launchpad-webapp integration tests" is that when running "mvn clean install" in launchpad-webapp fails with revision 613932, 12 tests out of 67 fail.

> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: SLING-154.partial.patch
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger updated SLING-154:
------------------------------------

    Priority: Blocker  (was: Minor)

Raising priority to blocker, because IMHO we should be API complete for the initial release.

> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Blocker
>             Fix For: 2.0.0
>
>         Attachments: SLING-154.partial.patch, SLING-154_2.patch
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bertrand Delacretaz resolved SLING-154.
---------------------------------------

    Resolution: Fixed

SLING-397 should give access to all Node and Property methods, and the above "Node is not a constructor" warning is gone, marking this as resolved.

> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Blocker
>             Fix For: 2.0.0
>
>         Attachments: SLING-154.partial.patch, SLING-154_2.patch
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bertrand Delacretaz updated SLING-154:
--------------------------------------

    Attachment: SLING-154.partial.patch

Rev 613895 breaks my launchpad-webapp integration tests, it seems like the wrapping does not work for JcrNodeResource and related classes.

Here's a partial fix, I didn't have time to finish it today, and maybe you want to solve that differently.

Still, with my patch, I have to use

   resource.node.properties.text.value.string

To output the value of the "text" property of the current Node.

...which is not totally optimal, but I'm probably missing something ;-)

> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: SLING-154.partial.patch
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger updated SLING-154:
------------------------------------

    Attachment: SLING-154_2.patch

Slightly modified patch:

  * Add getClassName() method to SlingWrapper interface
  * Check whether the host object class implements SlingWrapper before 
      trying to register
  * Readd ScriptableItemMap - this is needed as a host object
  * Modified ScriptableNode and ScriptableProperty: Removed getDefaultValue(Class)
      and added toString() method: ScriptableNode returns the node path, ScriptableProperty
      returns the string value of the property.

Esp. with the ScriptableProperty.toString() addition, it should be possible to use

            <%= node.properties.prop %>

To output the string value of the property (again).

WDYT ?

> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: SLING-154.partial.patch, SLING-154_2.patch
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12562041#action_12562041 ] 

Bertrand Delacretaz commented on SLING-154:
-------------------------------------------

I have re-added the ScriptableNode.get(String name, Scriptable start) method, from revision 605630, as the launcher-webapp tests failed without that.

This means that a Property named "text" is accessible in javascript with node.text, but that currently hides the JCR methods, i.e. node.primaryNodeType does not work anymore.

I'll discuss this on the mailing list - we need to agree on a strategy for these property names.

> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: SLING-154.partial.patch, SLING-154_2.patch
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12558950#action_12558950 ] 

Felix Meschberger commented on SLING-154:
-----------------------------------------

+1, thanks for reporting.

In fact, we might well consider extending JavaScript support for more classes as mention in the referenced message. This would also underline some kind of "JavaScript is the primary choice for scripting besides JSP" :-)

> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Priority: Minor
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "David Nuescheler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12569217#action_12569217 ] 

David Nuescheler commented on SLING-154:
----------------------------------------

I was recently looking for the "addNode()" method and couldn't find it in the code. Am I looking in the wrong place?
If not I would really like to recommend to map all Node methods.


> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: SLING-154.partial.patch, SLING-154_2.patch
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bertrand Delacretaz resolved SLING-154.
---------------------------------------

    Resolution: Fixed

In revision 619901 I have restored access to Node methods using their "real" names.

See ScriptableNodeTest for examples.

> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: SLING-154.partial.patch, SLING-154_2.patch
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-154) Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12561628#action_12561628 ] 

Bertrand Delacretaz commented on SLING-154:
-------------------------------------------

Committed SLING-154_2.patch which is better than the current state but not perfect yet - some integration tests still fail in launchpad-webapp, working on that.

> Allow access to Node and Property Methods on ScriptableNode and ScriptableProperty
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-154
>                 URL: https://issues.apache.org/jira/browse/SLING-154
>             Project: Sling
>          Issue Type: Improvement
>          Components: Scripting
>            Reporter: David Nuescheler
>            Assignee: Felix Meschberger
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: SLING-154.partial.patch, SLING-154_2.patch
>
>
> I would like to propose access to all jcr Node methods from ScriptableNode and access to the jcr Property.
> I recently wanted to access the Property.getLength() method from a .esp script and didn't find a good way starting
> out from my very convenient ScriptableNode.
> This discussion already talks about a similar issue:
> http://www.mail-archive.com/sling-dev@incubator.apache.org/msg01481.html
> So ideally somthing like an automatic getter mapping that I know from earlier rhino projects would mean 
> that I could access the same information through for example prop.length or prop.getLength().
> I think it would be great if all jcr Property and Node methods would be exposed, otherwise we are hiding jcr features from
> the script user. I think maybe the solution also requires a ScriptableProperty.
> WDYT?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.