[dna-dev] Generating Events For Child Nodes

Daniel Florian dflorian at redhat.com
Wed Nov 25 10:41:51 EST 2009


The requirements for generating events for children of nodes that have been added/removed/moved/copied seems to be different between JCR 1.0 to JCR 2.0. For JCR 1.0 it seems these events are required. For JCR 2.0 it they are optional.

These 2 TCK observation tests are failing because of this:

NodeRemovedTest.testMultiNodesRemoved
WorkspaceOperationTest.testCopy

Here are the spec details:

1. JSR 170 1.0 (JCR 1.0 11 May 2005)

a. Section 8.3.7.1 Creating a new Node

... as well for each of the automatically created child nodes or properties (either NODE_ADDED or PROPERTY_ADDED, as the case may be).

b. Section 8.3.7.4 Removing a Child Node

... Additionally, an implementation should also generate a NODE_REMOVE or PROPERTY_REMOVE (as appropriate) for each item in the removed subtree.

c. Section 8.3.7.6 Copying a Subtree

... Additionally, an implementation should generate appropriate events for each resulting node and property addition in the copied subtree.

d Section 8.3.7.7 Moving a Subtree

... Additionally, an implementation should generate a NODE_REMOVE or PROPERTY_REMOVE (as appropriate) for each node and property removed from its source path location and a NODE_ADDED or PROPERTY_ADDED (as appropriate) for each node and property added at its destination path location.

e. Section 8.3.7.8 Re-ordering a set of Child Nodes

... Additionally, an implementation should generate appropriate events reflecting the “shifting over” of the node B and any nodes that come after it in the child node ordering. Each such shifted node would also produce a NODE_REMOVED and NODE_ADDED event pair with paths differing at most by a final index.

2. JSR 283 FCS (JCR 2.0 10 Aug 2009)- Section 12.2 Scope of Event Reporting

The scope of event reporting is implementation-dependent. An implementation
should make a best-effort attempt to report all events, but may exclude events if
reporting them would be impractical given implementation or resource limitations.
For example, on an import, move or remove of a subgraph containing a large
number of items, an implementation may choose to report only events associated
with the root node of the affected graph and not those for every subitem in the
structure.



More information about the dna-dev mailing list