List<RepositoryInitializer> initializers = new ArrayList<RepositoryInitializer>();
initializers.addAll(config.getRegistry().lookupCollection(RepositoryInitializer.POINT));
initializers.addAll(config.getRegistry().lookupCollection(JcrNodeWrapperFactory.POINT));
try {
JcrSession s = getCurrentSession(null);
for (RepositoryInitializer initializer : initializers) {
initializer.initializeRepository(this, s);
}
s.save();
s.logout();
}
catch (RepositoryException e) {
throw new RuntimeException("Couldn't initialize repository", e);
}
for (Workspace w : getWorkspaceManager().getWorkspaces()) {
JcrSession s = getCurrentSession(w.getId());
initWorkspace(w, s);
s.logout();
}
}