public synchronized void save() throws RepositoryException {
if (loading || !changed) {
return;
}
try {
Node repoNode = getRepositoryNode();
NamespaceHelper helper = new NamespaceHelper(NAMESPACE, "", "site");
int revision = getRevision(repoNode) + 1;
helper.getDocument().getDocumentElement().setAttribute("revision",
Integer.toString(revision));
saveNodes(getRoot(), helper, helper.getDocument().getDocumentElement());
helper.save(repoNode.getOutputStream());
this.lastModified = repoNode.getLastModified();
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
throw new RepositoryException(e);
}