Hi,
Am Mittwoch, den 27.02.2008, 07:33 -0800 schrieb Carsten Ziegeler
(JIRA):
> I think we should remove "resource.node" completly, it causes too many
> problems.
> The proper way is to use "currentNode".
+1, and as this has been discussed before, I think we just should go
ahead, create an issue and do it ;-)
>
> > missing node functions in node wrapper
> > --------------------------------------
> ...
> > (this is on Launchpad revision 629151 running on top of crx)
> > got an esp template that looks like:
> > <h1><%= resource.node %>: <%= resource.node.getName() %></h1>
> >
> > <%
> > var child = resource.node.getNode("2008-02")
> > if (child.getProperty("sling:resourceType") == "emailListMonth") {
> > %>yay<%
> > }
> > %>
> > .getName() and .getNode("...") works OK, but .getProperty throws an
> > exception:
> > TypeError: getProperty is not a function
> > same for .getNodes()
>
I am confused. We decided to provide JavaScript-like API, that is JCR
node properties are properties of the JavaScript Node object, thus the
sling:resourceType property would be accessed as
child["sling:resourceType"]. Therefore, I do not see a need for
Node.getProperty(String), but then we might just as well add them ...
But then, we should probably add each and every method defined in the
Node and Property (and Item) interfaces to the wrappers ....
Regards
Felix