On Oct 17, 2007, at 19:51 , Mike D. Jones wrote:
Hi all,
Thanks in advance for any insight you can give me.
I have two questions; both of which deal with pulling specific
subsets of nodes from the source content via code.
1) When using SQL in JSP to execute a query against the repository,
is it possible to limit the number of "records" pulled from the
cms? That is, I know how to identify which specific nodes to pull
based on their path. However, if say there are 100 nodes that
match that path, I only want to pull out 10 -- anything like a
LIMIT keyword available?
AFAIK, the jcr-1 spec does not provide this. Maybe repository
specific extensions do, or maybe that'll be in jcr 2.
2) Can someone provide an example of how to use ContentFilter in
the Content.getChildren() method? What arguments does it accept
and how?
Please tell us what's unclear so we can write proper javadoc
(admittedly the current one isn't perfect, but I'm not sure I could
improve it more than by just improving the grammar...)
Just a silly example:
//----
Collection result = myNode.getChildren(new Content.ContentFiler() {
public boolean accept(Content content) {
return content.hasNodeData("foo");
}
});
//----
The "result" collection will contain the children nodes of the
"myNode" node which have a property called "foo". So basically the
getChildren(filter) method returns the children of the node for which
the accept method returns true. Each children of "myNode" is passed
as a parameter to the accept method. (*)
hth
greg
* Note that I use the terms Node and Content interchangeably, as I do
for NodeData and Property.
----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------