The JCR Javadocs seem to be ambiguous about whether nodes are
persisted when they are created, but they are very clear that they
must be persisted when Node.save() is called. I did, indeed, just need
to call ContentManager.addPage(). Seems to work just dandy.
Actually, JSR-170 spec says about Node.addNode()
"An ItemExistsException will be thrown either immediately (by this
method), or on save, if an item at the specified path already exists
and same name siblings are not allowed. Implementations may differ on
when this validation is performed. "
The end result might be a bit confusing if same name siblings were
allowed, and the JCR repo would just silently add multiple copies. It
means that we should choose a nodetype which does not allow same name
siblings. At the moment everything is stored with nt:unstructured,
which does allow such beasts.
I'm not sure whether calling addNode() would actually work with other
repos than Priha. Priha does not validate until save(). But now is
difficult to think what a good solution would be, too much noise around.
/Janne