Marco Ciancimino <[EMAIL PROTECTED]> wrote:
>    the following code (from the docs) illustates how to create a node with
>    the NodeManager, but I can't understand how to obtain a node from the
>    bridge.

>    Must I use a NodeQuery?

That is possible.

You cited 2 examples, I removed the part which is 'core'.

>    // or nicer, with the bridge:
>    Cloud cloud = LocalContext.getCloudContext().getCloud("mmbase"));
>    NodeManager images = cloud.getNodeManager("episode");
>    Node node = images.createNode();
>    node.setField("title", "TEST");
>    node.commit();

You can obtain nodes via the cloud object. E.g. by number or alias:

Node node = cloud.getNode(123);
Node node = cloud.getNode("my_node");

or indeed, you can search.

NodeManager images = cloud.getNodeManager("images");
NodeQuery query = images.createQuery();

NodeList allImages = images.getList(query);

NodeIterator i = allImages.nodeIterator();
...


Or something similar. See also the javadoc of bridge.
http://www.mmbase.org/mmdocs/mmci/api/index.html

Michiel



-- 
Michiel Meeuwissen       |
Mediapark C101 Hilversum | 
+31 (0)35 6772979        |  I hate Internet Explorer
nl_NL eo_XX en_US        |
mihxil'                  |
 [] ()                   |

Reply via email to