I was just reverting/cleaning up stuff after my Modeshape 3 Beta3 adventure.
I noticed that I had to change the following code to get it to run properly in MS3:
private static void bootstrapSequence(Session session, Node parent, String relativePath) throws RepositoryException
if( !session.propertyExists( parent.getPath() + "/" + relativePath + "/counter" ) )
Long returnValue = 0l;
Node sequenceNode = DezideJcrUtils.getOrCreateNode( parent, relativePath.split( "/" ) );
sequenceNode.setProperty( "counter", returnValue );
String sequenceNodePath = parent.getPath() + "/" + relativePath;
if( !session.nodeExists( sequenceNodePath ) || !session.propertyExists( sequenceNodePath + "/counter" ) )
I don't have a working MS3 setup at the time, but I think the first original code block threw a "node does not exist" exception on MS 3 while it just worked in MS 2.8.2.
In the bootstrap scenario the code is called like this:
bootstrapSequence( session, session.getRootNode(), "authorutil/sequence/revisionId" );
(The relative path does not exist yet in the repository so it is path containing 3 non-existing nodes) - I think this is a bug, but do not have the time to re-test - so I thought I'd mention it here.
Chris Poulsen wrote:
but I think the first original code block threw a "node does not exist" exception on MS 3 while it just worked in MS 2.8.2.
If that's the case, then it is a bug. Would you mind logging it?