Felix Meschberger wrote:
Hi all,

This issue and SLING-329 give raise to an interesting question: The
ScriptableNode implements the ECMA getNodes() method returning an EMCA
object containing all properties. This is fundamentally different from
the spec which says an Iterator is returned.

In fact, it completely breaks my knowledge of JCR in that I would not be
able to iterate as I would expect it: while (iter.hasNext()) { Node n =
iter.next(); }

In addition, this might also be a performance hog because the
constructor of the respective object iterates the complete JCR iterator
to build the object (this is probably required for the implementation).

So what are the opinions out there on this break in API ?
I think this should be fixed according to the spec; we stay compatible with Java and avoid performance problems.

Carsten


Regards
Felix


Am Donnerstag, den 13.03.2008, 09:40 -0700 schrieb Michael Marth (JIRA):
access to node props in esp
---------------------------

                 Key: SLING-328
                 URL: https://issues.apache.org/jira/browse/SLING-328
             Project: Sling
          Issue Type: Bug
            Reporter: Michael Marth


My .esp looks like

for (var i in currentNode.getNodes()) {
            if(currentNode.getNodes()[i].getProperty("approved").getString() == 
"true") {
...

Bertrand tells me that in the second line this should work as well:
if(currentNode.getNodes()[i].approved (...)
It does not give an exception but the property is undefined.





--
Carsten Ziegeler
[EMAIL PROTECTED]

Reply via email to