file.setContents(content.marshal());
cms.lockResource(file.getRootPath());
cms.writeFile(file);
cms.unlockResource(cms.getSitePath(file));
OpenCms.getPublishManager().publishResource(cms, cms.getSitePath(file), false, new CmsLogReport(locale, getClass()));
cms.getRequestContext().setCurrentProject(oldProject);
}