Hi Guys,

here is my take (using JCR of course ;) ):

<%
var qm=currentNode.getSession().getWorkspace().getQueryManager();
var q=qm.createQuery("SELECT * FROM nt:resource ORDER BY
jcr:lastModified", "sql");
var res=q.execute().getNodes();

while (res.hasNext) {
        hit=res.nextNode();
        %><%= hit.getPath() %><br><%
}
%>

However, I think this really should be a lot simpler...
looking the the Sling.getContent() on the client side, I think for
javascript on the client
side we should have something like a Sling.query() that returns a
collection of nodes.
Since think that we in the long run it would be great to offer scripts
on the server
side the same level of convience i think the resulting script (both on
the client
and on the server) should look something like this.

<%
var res=Sling.query("SELECT * FROM nt:resource ORDER BY jcr:lastModified");

for (var a in res) {
        hit=res[a];
        %><%= hit.getPath() %><br><%
}
%>


regards,
david

Reply via email to