public void checkin(String path, String[] versionLabels) {
try {
Node node = (Node) session.getItem(path);
checkIfNodeLocked(node.getPath());
if (!node.isNodeType("mix:versionable")) {
throw new VersionException("The object " + path + "is not versionable");
}
javax.jcr.version.Version newVersion = node.checkin();
if (versionLabels != null) {
VersionHistory versionHistory = node.getVersionHistory();
for (int i = 0; i < versionLabels.length; i++) {
versionHistory.addVersionLabel(newVersion.getName(), versionLabels[i], false);
}
}
} catch (ClassCastException cce) {
throw new ObjectContentManagerException("Cannot retrieve an object from a property path " + path);
} catch (PathNotFoundException pnfe) {
throw new ObjectContentManagerException("Cannot retrieve an object at path " + path, pnfe);
} catch (InvalidItemStateException iise) {
throw new ObjectContentManagerException("Cannot checking modified object at path " + path, iise);
} catch (javax.jcr.version.VersionException ve) {
throw new VersionException("Impossible to checkin the object " + path, ve);
} catch (UnsupportedRepositoryOperationException uroe) {
throw new VersionException("Cannot checkin unversionable node at path " + path, uroe);
} catch (LockException le) {
throw new VersionException("Cannot checkin locked node at path " + path, le);
} catch (RepositoryException e) {
throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Impossible to checkin the object " + path, e);
}
}