Ignacio Renuncio <[EMAIL PROTECTED]> wrote:
> We finally put the following code:
>
> // We get a nodemanager for the desired information type
> NodeManager nodeManager = cloud.getNodeManager("desired_builder");
> // We get an iterator with all of the objects sorted
> NodeList listaElementos = nodeManager.getList(null, "number", "DOWN");
>
> So just now we're retrieving all of the items, the most recent first.
You'r not limiting the query-result now. It might be a problem when you get
a zilliono f desired_builder object which you might not want to have in
memory all.
> More questions:
>
> (a) Is the NodeQuery the preferred way of making a complex query to the CMS
> storage engine?
Yes. Or a 'Query' object for even more complex queries (which don't even
return real nodes).
> I'm thinking of retrieving at most N items of a given type that match
> certain conditions (the limit is because of performance penalties, we're
> using the remote cloud interface).
That is indeed possible. You may use the functions from
org.mmbase.bridge.util.Queries to manipulate the NodeQuery object which you
will need then.
> We may also need to retrieve mixed nodes
> of different types.
You mean 'multilevel' results?
> (b) To retrieve an object -and- all of the objects related to it:
>
> NodeList related = element.getRelatedNodes("type_1");
> NodeList related = element.getRelatedNodes("type_2");
> And so on...
>
> Is this the preferred method to do it? Any other possibilities?
All related nodes can simply be gotten with element.getRelatedNodes() IIRC.
Michiel
--
Michiel Meeuwissen
Mediacentrum 140 H'sum
+31 (0)35 6772979
nl_NL eo_XX en_US
mihxil'
[] ()